[ 
https://issues.apache.org/jira/browse/CAY-2759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev closed CAY-2759.
--------------------------------
    Resolution: Fixed

https://github.com/apache/cayenne/pull/521

> Add utility methods to the SELF property
> ----------------------------------------
>
>                 Key: CAY-2759
>                 URL: https://issues.apache.org/jira/browse/CAY-2759
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>            Reporter: Nikita Timofeev
>            Assignee: Nikita Timofeev
>            Priority: Major
>             Fix For: 5.0.M1
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> After CAY-2754 is done we have SELF property generated for the entities.
> We could make it a separate type rather than {{EntityProperty}} and add some 
> convenience methods to it.
> Here's what I already played with:
> {code}
> // query() method to create ObjectSelect
> List<Artist> artistList = Artist.SELF.query().select(context);
> // same with a where clause
> Artist artistById = Artist.SELF.query(Artist.SELF.eqId(1)).selectOne(context);
> // shortcut for a EXISTS/NOT EXISTS subquery 
> long count = 
> Artist.SELF.query(Painting.SELF.notExists(Painting.TO_ARTIST.eq(Artist.SELF.enclosing()))).selectCount(context);
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to