cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <>
Subject Re: [CAY-1683]- Injectable PkGenerator
Date Fri, 06 Jul 2012 14:31:49 GMT
I think it would be nice if alternative PK generators could be
specified in the Modeler.


On Fri, Jul 6, 2012 at 2:57 AM, Andrus Adamchik <> wrote:
> Per this document Cayenne supports various PK generation strategies with "Meaningful
Primary Key" being user-defined, and the rest generated by the framework:
> PkGenerator is an existing interface that implements these strategies. The task is about
making it managed by Cayenne dependency injection (DI) container. A similar task done in 3.1
was switching DbAdapter to DI. Currently DbAdapter owns PkGenerator. The task is about breaking
this dependency and making PkGenerator directly injectable where it is needed.
> BTW this may sound simple, but is actually a fairly deep design task. So if you feel
like you need to learn Cayenne runtime before taking on it, I'd recommend maybe other tasks
from my earlier list. But of course you are welcome to take on this one right away :)
> Andrus
> On Jul 5, 2012, at 5:59 PM, Eshan Sudharaka wrote:
>> Or is it about adding the primary key functionality like auto increment
>> which we can see in JPA ? (generating the values of the primary keys for
>> each rows of a table)
>> On Thu, Jul 5, 2012 at 8:00 PM, Eshan Sudharaka <>wrote:
>>> Hi,
>>> I am interested in this task and need some more information regarding
>>> this. I have a basic question regarding this PkGenerator.
>>> As i see DbEntity contains a collection of DbAttributes for primary key
>>> construction and I think this collection is initialized when we configure
>>> primary keys through the cayenne modeler. So It is bit unclear me to
>>> understand the requirement of having a Pkgenerator while is is the users
>>> responsibility to set the primary key for a DbEntity. It would be great if
>>> you can explain to logic behind this.
>>> --
>>> *~Thanks & Regards~*
>>> ***
>>> *
>>> Eshan
>> --
>> *~Thanks & Regards~*
>> ***
>> *
>> P.A.Eshan Sudharaka
>> Dept of Computer Science and Engineering
>> University of Moratuwa
>> Sri Lanka

View raw message