cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cayenne] stariy95 opened a new pull request #400: CAY-2604 Specialization of property API for PK
Date Wed, 07 Aug 2019 13:07:16 GMT
stariy95 opened a new pull request #400: CAY-2604 Specialization of property API for PK
URL: https://github.com/apache/cayenne/pull/400
 
 
   You can optionally generate PK properties like this in `cgen`:
   ```java
   public static final NumericIdProperty<Long> ARTIST_ID_PK_PROPERTY = 
       PropertyFactory.createNumericId("ARTIST_ID", "Artist", Long.class);
   ```
   
   They can be used in all cases:
   - directly in `where`
   ```java
   Artist.ARTIST_ID_PK_PROPERTY.gt(2L)
   ```
   - with `dot()` operator
   ```java
   Artist.PAINTING_ARRAY.dot(Painting.PAINTING_ID_PK_PROPERTY).eq(13)
   ```
   - to sort in db and in memory
   ```java
   Painting.PAINTING_ID_PK_PROPERTY.desc().orderList(paintings);
   ```
   - for in-memory evaluation
   ```java
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message