Hi,

I have a datastore of type "oracle" and trying to join to two types on an 
attribute SAV_ID. My CQL looks like: "SAV_ID = b.SAV_ID". The problem is that 
CQL.toFilter converts the "b.SAV_ID" to "b/SAV_ID" and querying the features 
ends with:

java.lang.IllegalArgumentException: Attribute 'b/SAV_ID' not present in either 
type 'SAVIVALDYBES_2011_SDO' or 'SENIUNIJOS_2011_SDO'
        at org.geotools.jdbc.JoinInfo$JoinQualifier.visit(JoinInfo.java:333)
        at 
org.geotools.filter.AttributeExpressionImpl.accept(AttributeExpressionImpl.java:381)
        at 
org.geotools.filter.visitor.DuplicatingFilterVisitor.visit(DuplicatingFilterVisitor.java:132)
        at 
org.geotools.filter.visitor.DuplicatingFilterVisitor.visit(DuplicatingFilterVisitor.java:178)
        at org.geotools.filter.IsEqualsToImpl.accept(IsEqualsToImpl.java:162)
        at org.geotools.jdbc.JoinInfo.create(JoinInfo.java:80)
        at org.geotools.jdbc.JoinInfo.create(JoinInfo.java:41)
        at 
org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:584)

Building the same filter with ff.equals(ff.property("SAV_ID"), 
ff.property("b.SAV_ID")) produces a valid result, but I have requirements that 
don't allow building queries in code.

My code snippet:

            Query query = new Query("ResultSet", filter);
            
            Join join = new Join(joinType, CQL.toFilter(joinCQL));
            join.setAlias("b");
            
            query.getJoins().add(join);


Tried versions 9.2, 9.5 and 10-RC1.

So is there anything I am doing wrong here or there is a problem in the library 
itself?

Regards
Mantas IndraĊĦius
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to