Actually NOT making PK a part of the object model was a default in Cayenne 
since day 1. 

1. If all you need is to read the PK value, you can use Cayenne.pkForObject(..)
2. If this is a meaningful PK and you need a setter, just create a new 
ObjAttribute in the Modeler manually and map it to PK column.

HTH,
Andrus

---------------
Andrus Adamchik
@andrus_a | @ApacheCayenne

> On Jan 20, 2017, at 10:50 AM, sagar bijlwan <sagar.bijl...@gmail.com> wrote:
> 
> Hello,
> 
> In cayenne 3 primary key column is also available as a property in auto
> generated java model so it can  be easily accessed using setters and
> getters, However, it seems same can't be said about cayenne 4. When I am
> generating Java model of the same DB table, I am only getting PK column (
> and not the new "Property" type for the primary key) thus I don't have any
> setters and getters for the primary key.
> 
> Am I missing something here as I don't seem to recall doing anything
> special in cayenne 3? Or should I do anything extra in cayenne 4 to make it
> work?
> 
> Any insight into this would be appreciated.
> 
> Regards
> Sagar


Reply via email to