cayenne
cayenne copied to clipboard
CAY-2759 Add utility methods to the SELF property
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);