Grokbase Groups Cayenne dev July 2012
FAQ
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

Search Discussions

  • Eshan Sudharaka at Jul 5, 2012 at 3:00 pm
    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
    http://esudharaka.blogspot.com/
  • Andrus Adamchik at Jul 6, 2012 at 6:57 am
    Per this document Cayenne supports various PK generation strategies with "Meaningful Primary Key" being user-defined, and the rest generated by the framework:

    http://cayenne.apache.org/doc/primary-key-generation.html

    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
    http://esudharaka.blogspot.com/
  • Michael Gentry at Jul 6, 2012 at 2:32 pm
    I think it would be nice if alternative PK generators could be
    specified in the Modeler.

    mrg
    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:

    http://cayenne.apache.org/doc/primary-key-generation.html

    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
    http://esudharaka.blogspot.com/
  • Andrus Adamchik at Jul 6, 2012 at 2:57 pm
    When designing DI (and specifically filling in the standard DI modules), I always asked myself a question whether this or that piece is a part of "model" or "runtime services". Before DI was in place, our model was in a way fulfilling DI role, so we'd stick something like a JGroups port in it, which was completely inflexible of course... Now all the runtime decisions about this or that "service" can be deferred till runtime, i.e. *after* modeling, which is good and flexible.

    I think with PkGenerator we have a similar case. We allow the model to define a few standard strategies, but then override (or implement them) depending on deployment conditions if needed. Very similar to how DI handles DbAdapter now.

    Andrus

    On Jul 6, 2012, at 5:31 PM, Michael Gentry wrote:
    I think it would be nice if alternative PK generators could be
    specified in the Modeler.

    mrg
    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:

    http://cayenne.apache.org/doc/primary-key-generation.html

    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
    http://esudharaka.blogspot.com/
  • Michael Gentry at Jul 6, 2012 at 3:29 pm
    It is probably habit, but the first place I'd look to see the PK
    generation information is in the Modeler.

    mrg
    On Fri, Jul 6, 2012 at 10:57 AM, Andrus Adamchik wrote:
    When designing DI (and specifically filling in the standard DI modules), I always asked myself a question whether this or that piece is a part of "model" or "runtime services". Before DI was in place, our model was in a way fulfilling DI role, so we'd stick something like a JGroups port in it, which was completely inflexible of course... Now all the runtime decisions about this or that "service" can be deferred till runtime, i.e. *after* modeling, which is good and flexible.

    I think with PkGenerator we have a similar case. We allow the model to define a few standard strategies, but then override (or implement them) depending on deployment conditions if needed. Very similar to how DI handles DbAdapter now.

    Andrus

    On Jul 6, 2012, at 5:31 PM, Michael Gentry wrote:
    I think it would be nice if alternative PK generators could be
    specified in the Modeler.

    mrg
    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:

    http://cayenne.apache.org/doc/primary-key-generation.html

    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
    http://esudharaka.blogspot.com/
  • Andrus Adamchik at Jul 12, 2012 at 11:09 am
    Hi Eshan,

    so were the replies here helpful at all?

    Cheers,
    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
    http://esudharaka.blogspot.com/
  • Eshan Sudharaka at Jul 12, 2012 at 12:21 pm
    Hi Andrus,

    Sorry for the late reply. As you mentioned I think it would be better if I
    learn cayenne run time first. So I what I thought was to look in to this
    task in your list.
    https://issues.apache.org/jira/browse/CAY-1714
    I could not go in to deeper yet. I will raise some questions soon.
    Also In my working place we are using java 7 and maven 3. I could not get
    the project build successfully. There is a compilation error in Cayenne
    Project. I have the latest version of trunck.
    On Thu, Jul 12, 2012 at 4:38 PM, Andrus Adamchik wrote:

    Hi Eshan,

    so were the replies here helpful at all?

    Cheers,
    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 <esudharaka@gmail.com
    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
    http://esudharaka.blogspot.com/

    --
    *~Thanks & Regards~*
    ***
    *
    P.A.Eshan Sudharaka
    Dept of Computer Science and Engineering
    University of Moratuwa
    Sri Lanka
    http://esudharaka.blogspot.com/
  • Andrus Adamchik at Jul 12, 2012 at 12:52 pm
    Great.

    Maven 3 is what is required for Cayenne builds, so that should be ok.

    Re: Java version... you can have multiple versions of Java installed on the same machine. Also not so long ago we've actually made the builds work with Java 7, so if the build fails, let's work on fixing it (the code should of course be compatible with Java 6, so no new Java 7 fancy stuff in it).

    Andrus

    On Jul 12, 2012, at 3:20 PM, Eshan Sudharaka wrote:
    Hi Andrus,

    Sorry for the late reply. As you mentioned I think it would be better if I
    learn cayenne run time first. So I what I thought was to look in to this
    task in your list.
    https://issues.apache.org/jira/browse/CAY-1714
    I could not go in to deeper yet. I will raise some questions soon.
    Also In my working place we are using java 7 and maven 3. I could not get
    the project build successfully. There is a compilation error in Cayenne
    Project. I have the latest version of trunck.
    On Thu, Jul 12, 2012 at 4:38 PM, Andrus Adamchik wrote:

    Hi Eshan,

    so were the replies here helpful at all?

    Cheers,
    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 <esudharaka@gmail.com
    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
    http://esudharaka.blogspot.com/

    --
    *~Thanks & Regards~*
    ***
    *
    P.A.Eshan Sudharaka
    Dept of Computer Science and Engineering
    University of Moratuwa
    Sri Lanka
    http://esudharaka.blogspot.com/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedJul 5, '12 at 2:30p
activeJul 12, '12 at 12:52p
posts9
users3
websitecayenne.apache.org

People

Translate

site design / logo © 2021 Grokbase