You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by GitBox <gi...@apache.org> on 2019/08/07 13:07:16 UTC

[GitHub] [cayenne] stariy95 opened a new pull request #400: CAY-2604 Specialization of property API for PK

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