[
https://issues.apache.org/jira/browse/CAY-2526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nikita Timofeev updated CAY-2526:
---------------------------------
Fix Version/s: (was: 4.2.M3)
4.3.M1
> Dynamic join at query time in ObjectSelect
> ------------------------------------------
>
> Key: CAY-2526
> URL: https://issues.apache.org/jira/browse/CAY-2526
> Project: Cayenne
> Issue Type: Task
> Components: Core Library, Database integration
> Reporter: Nikita Timofeev
> Assignee: Nikita Timofeev
> Priority: Major
> Fix For: 4.3.M1
>
>
> For complex queries there is a need to join tables that are not directly
> linked with root via relationship.
> Currently this can be done only in raw SQL queries (like {{SQLTemplate}}).
> We can introduce support for that in {{ObjectSelect}}.
> API can look something like this (we probably need some improvements in
> {{Property}} API as well):
> {code:java}
> StringProperty<String> paintingTitle =
> PropertyFactory.createString("p.paintingTitle", String.class);
> ObjectSelect
> .columnQuery(Artist.class, Artist.ARTIST_NAME, paintingTitle)
> .join(Painting.class, "p",
> Artist.ARTIST_NAME.length().eq(paintingTitle.length()))
> .select(context);
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)