On Sun, Aug 25, 2013 at 10:55 AM, Mantas Indrasius <[email protected]>wrote:

> 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?
>

I might be wrong here, but CQL was born in catalogue services where there
is no concept of feature type joining, and thus
no aliases, and our ExtendedCQL probably inherits the same limitation, the
. is likely being interpreted as drilling down
into a single feature type attributes.

Cheers
Andrea

-- 
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
------------------------------------------------------------------------------
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