cayenne icon indicating copy to clipboard operation
cayenne copied to clipboard

CAY-2759 Add utility methods to the SELF property

Open stariy95 opened this issue 3 years ago • 0 comments

Here are some usage examples of the methods added:

// 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);
// column select
List<String> names = Artist.SELF.columnQuery(Artist.ARTIST_NAME).select(context);

stariy95 avatar Sep 22 '22 15:09 stariy95