FAQ
Hi!
My first contact with an ORM was EOF... an ever since I have felt that
nothing compares to it ;-).

The thing is, I have had to work with JPA/Hibernate for a few years now...
and I feel it has some weaknesses I really do not like, I am thinking about
"switching to cayenne" but first i would like to be sure that Cayenne does
not have this weaknesses too.

List of weaknesses in JPA/Hibernate:

-No way to manage an object that "will be persisted", in JPA/Hibernate if
you call entityManager.persist(object) and the database does not support
sequences (like MS-Sql) an insert will be triggered, and if any of the non
nullable fields of the objects is null, it will crash. If your object has a
compound primery key, things get worse, because the entityManager can not
deal with it until the compound primary key is set, and if you compound
primary key is formed by foreign keys pointing to objects that are new too,
that means you will not be able to save stuff with with a simple single call
to entityManager.persist to one of the objects, cascading will not help you
(I really miss something "magic" like ObjectContext.commitChanges() )

-No easy way to know if "an object is dirty" (if it has changed/deleted
since it was read from the database, there is just no API for that), and
since you can not know what objects will be persisted, and what object have
changed, and what objects will be deleted from database, that means you can
not easily create an unified API for centralized polymorphic validation
(that is no easy way to create validateForSave, or validateForDelete)

-No real equivalent for validateForXXX, JPA lifecycle callbacks are not
match for validateForXXX because you can not query the database during the
lifecycle callbacks, and if you throw an exception inside a lifecycle
callback, the JPA/Hibernate entityManager enters an invalid state, and after
that you can not continue to use your POJOs, you have to start over with a
fresh entityManager... and without you modifications to the POJOs. Note that
Hibernate new validation framework does not offer a real solution for this
problem... and AFAIK JSR-000303 will not help with this either.

-No support for some kind of temporary id: In JPA/Hibernate, the id for an
object is "null" until you flush it to the database, so if you need to
reference a particular object instance from the user interface... there is
plain no way to do it, you have to "save it first" to get a primary key.

Those are my main disagreements with the way I have to work with
JPA/Hibernate... will switching to
Cayenne help me with those? And if it works... here is a crazy idea... what
if you guys developed a wrapper that could work on top of any JPA provider
to offer a higher level EOF like API ?

Regards,
Francisco

--
View this message in context: http://www.nabble.com/Coming-from-EOF%3A-Cayenne-vs-Hibernate-tp22463349p22463349.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Search Discussions

  • Robert Zeigler at Mar 11, 2009 at 8:19 pm

    On Mar 11, 2009, at 3/113:06 PM , Francisco Peredo wrote:
    Hi!
    My first contact with an ORM was EOF... an ever since I have felt that
    nothing compares to it ;-).

    The thing is, I have had to work with JPA/Hibernate for a few years
    now...
    and I feel it has some weaknesses I really do not like, I am
    thinking about
    "switching to cayenne" but first i would like to be sure that
    Cayenne does
    not have this weaknesses too.

    List of weaknesses in JPA/Hibernate:

    -No way to manage an object that "will be persisted", in JPA/
    Hibernate if
    you call entityManager.persist(object) and the database does not
    support
    sequences (like MS-Sql) an insert will be triggered, and if any of
    the non
    nullable fields of the objects is null, it will crash. If your
    object has a
    compound primery key, things get worse, because the entityManager
    can not
    deal with it until the compound primary key is set, and if you
    compound
    primary key is formed by foreign keys pointing to objects that are
    new too,
    that means you will not be able to save stuff with with a simple
    single call
    to entityManager.persist to one of the objects, cascading will not
    help you
    (I really miss something "magic" like ObjectContext.commitChanges() )
    I routinely: objectContext.newObject(Foo.class);
    or:
    objectContext.registerNewObject(foo);

    with objects that have required fields, etc. Cayenne will mark this as
    an object in state "NEW" (as opposed to transient, which is an
    unmanaged object).
    I've had no issues with compound primary keys which are also FK's.
    (make sure toDepPK is checked on the proper side of teh relationship
    in the modeler).
    -No easy way to know if "an object is dirty" (if it has changed/
    deleted
    since it was read from the database, there is just no API for that),
    and
    since you can not know what objects will be persisted, and what
    object have
    changed, and what objects will be deleted from database, that means
    you can
    not easily create an unified API for centralized polymorphic
    validation
    (that is no easy way to create validateForSave, or validateForDelete)
    Sure. You can query the object context for all modified objects.
    You can also directly check the state of an object (MODIFIED, NEW,
    COMMITTED, DELETED, TRANSIENT).
    Of those, only COMMITTED implies that an object is managed, stored in
    the db, and unmodified since it's fetch.
    I've used this to do things like implementing object "histories"
    stored to the db.

    -No real equivalent for validateForXXX, JPA lifecycle callbacks are
    not
    match for validateForXXX because you can not query the database
    during the
    lifecycle callbacks, and if you throw an exception inside a lifecycle
    callback, the JPA/Hibernate entityManager enters an invalid state,
    and after
    that you can not continue to use your POJOs, you have to start over
    with a
    fresh entityManager... and without you modifications to the POJOs.
    Note that
    Hibernate new validation framework does not offer a real solution
    for this
    problem... and AFAIK JSR-000303 will not help with this either.
    validateForXXX is supported, including querying into the database.
    I have an app that has an "Enrollment" object with a start and end date.
    One of the business rules is that no two enrollments for a given user
    should overlap.
    So when the object is saved (update or insert), I query the db for
    existing enrollments, and add a validation violation
    -No support for some kind of temporary id: In JPA/Hibernate, the id
    for an
    object is "null" until you flush it to the database, so if you need to
    reference a particular object instance from the user interface...
    there is
    plain no way to do it, you have to "save it first" to get a primary
    key.
    Yup; definitely an annoyance in hibernate/JPA. Fortunately, cayenne
    objects that are in state NEW /do/ have a temporary id.
    the tapestry5/cayenne integration module takes advantage of this fact
    to do exactly what you mention (referencing a particular object in the
    UI, even if it's new).

    Those are my main disagreements with the way I have to work with
    JPA/Hibernate... will switching to
    Cayenne help me with those? And if it works... here is a crazy
    idea... what
    if you guys developed a wrapper that could work on top of any JPA
    provider
    to offer a higher level EOF like API ?
    Heh. That's an interesting idea. Seems like we have our hands full
    just developing the core cayenne framework at the moment, though....
    patches always welcome, of course. ;)

    Robert
    Regards,
    Francisco

    --
    View this message in context: http://www.nabble.com/Coming-from-EOF%3A-Cayenne-vs-Hibernate-tp22463349p22463349.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Michael Gentry at Mar 11, 2009 at 8:37 pm
    Comments inline ...


    On Wed, Mar 11, 2009 at 4:06 PM, Francisco Peredo
    wrote:
    Hi!

    Hi Francisco.

    My first contact with an ORM was EOF... an ever since I have felt that
    nothing compares to it ;-).

    I'm still doing WebObjects/EOF and have a decent idea about how the
    two frameworks compare. Cayenne is very similar to EOF (not
    identical, but carries much of the spirit). If you are familiar and
    comfortable with EOF, it would probably be a fairly straightforward
    and easy transition for you to use Cayenne (unless you do multiple
    table inheritance, which Cayenne lacks).

    The thing is, I have had to work with JPA/Hibernate for a few years now...
    and I feel it has some weaknesses I really do not like, I am thinking about
    "switching to cayenne" but first i would like to be sure that Cayenne does
    not have this weaknesses too.

    List of weaknesses in JPA/Hibernate:

    -No way to manage an object that "will be persisted", in JPA/Hibernate if
    you call entityManager.persist(object) and the database does not support
    sequences (like MS-Sql) an insert will be triggered, and if any of the non
    nullable fields of the objects is null, it will crash. If your object has a
    compound primery key, things get worse, because the entityManager can not
    deal with it until the compound primary key is set, and if you compound
    primary key is formed by foreign keys pointing to objects that are new too,
    that means you will not be able to save stuff with with a simple single call
    to entityManager.persist to one of the objects, cascading will not help you
    (I really miss something "magic" like ObjectContext.commitChanges() )

    Cayenne, like EOF, can use sequences or a PK table, but if you have
    complex keys, you should write your own PK generator. If a PK field
    is null, Cayenne will attempt to assign it (and cascade where
    necessary) using the PK generator, just like EOF. If the PK is
    non-null, Cayenne assumes you've provided your own PK (this is an
    "easy out" over writing your own PK generator).

    -No easy way to know if "an object is dirty" (if it has changed/deleted
    since it was read from the database, there is just no API for that), and
    since you can not know what objects will be persisted, and what object have
    changed, and what objects will be deleted from database, that means you can
    not easily create an unified API for centralized polymorphic validation
    (that is no easy way to create validateForSave, or validateForDelete)

    You can ask the Cayenne DataContext (similar to an EOEditingContext)
    for deletedObjects(), modifiedObjects(), and newObjects(). You can
    also call the object's getPersistenceState() method to see if it is
    COMMITTED, DELETED, HOLLOW (a fault), MODIFIED, NEW, or TRANSIENT.

    -No real equivalent for validateForXXX, JPA lifecycle callbacks are not
    match for validateForXXX because you can not query the database during the
    lifecycle callbacks, and if you throw an exception inside a lifecycle
    callback, the JPA/Hibernate entityManager enters an invalid state, and after
    that you can not continue to use your POJOs, you have to start over with a
    fresh entityManager... and without you modifications to the POJOs. Note that
    Hibernate new validation framework does not offer a real solution for this
    problem... and AFAIK JSR-000303 will not help with this either.

    Cayenne has validate methods and has added JPA lifecycle callbacks
    (which I'm not too familiar with at this point). Take a look at:

    http://cayenne.apache.org/doc/dataobject-validation.html

    and

    http://cayenne.apache.org/doc/lifecycle-callbacks.html

    -No support for some kind of temporary id: In JPA/Hibernate, the id for an
    object is "null" until you flush it to the database, so if you need to
    reference a particular object instance from the user interface... there is
    plain no way to do it, you have to "save it first" to get a primary key.

    Cayenne doesn't really have this, either. (Neither does EOF.) You
    have to commit to have the PKs assigned (unless you assign them
    yourself). There might be a temporary ID, but it sounds like you are
    asking about something more permanent that can be looked up later.

    Those are my main disagreements with the way I have to work with
    JPA/Hibernate... will switching to
    Cayenne help me with those? And if it works... here is a crazy idea... what
    if you guys developed a wrapper that could work on top of any JPA provider
    to offer a higher level EOF like API ?

    Regards,
    Francisco
  • Robert Zeigler at Mar 11, 2009 at 8:49 pm
    Interesting to see the comments coming from a hibernate + cayenne user
    (me) vs. an EOF + cayenne user (Mike). :)
    Just wanted to follow up on the question and comment below:
    Cayenne doesn't really have this, either. (Neither does EOF.) You
    have to commit to have the PKs assigned (unless you assign them
    yourself). There might be a temporary ID, but it sounds like you are
    asking about something more permanent that can be looked up later.

    Those are my main disagreements with the way I have to work with
    JPA/Hibernate... will switching to
    Cayenne help me with those? And if it works... here is a crazy
    idea... what
    if you guys developed a wrapper that could work on top of any JPA
    provider
    to offer a higher level EOF like API ?

    Regards,
    Francisco
    It's true that there is no /long term/ temporary pk; you have to
    commit for the db for that.
    But the following also holds:

    MyPersistentObj obj = context.newObject(MyPersistentObj.class);
    assert obj.getObjectId() != null

    MyPersistentObj obj2 = context.newObject(MyPersistentObj.class);
    assert !obj.getObjectId().equals(obj2.getObjectId());

    which is the critical piece of information that, I think, Francisco
    was looking for.
    In the hibernate world, your object is "new" if the object's id is null.
    Otherwise, it's persisted in the database w/ a pk. There is no "in
    between" state.

    Robert
  • Michael Gentry at Mar 11, 2009 at 9:03 pm
    Hi Robert,

    I was just guessing that since Francisco wanted to be able to display
    the "temporary ID" on the user interface that there might be an
    expectation (on the user's part?) of being able to write it down/etc
    and query for it later. Like a tracking number of some kind. Either
    way, I hope his question was answered. :-)

    /dev/mrg


    On Wed, Mar 11, 2009 at 4:48 PM, Robert Zeigler
    wrote:
    Interesting to see the comments coming from a hibernate + cayenne user (me)
    vs. an EOF + cayenne user (Mike). :)
    Just wanted to follow up on the question and comment below:
    Cayenne doesn't really have this, either.  (Neither does EOF.)  You
    have to commit to have the PKs assigned (unless you assign them
    yourself).  There might be a temporary ID, but it sounds like you are
    asking about something more permanent that can be looked up later.

    Those are my main disagreements with the way I have to work with
    JPA/Hibernate... will switching to
    Cayenne help me with those? And if it works... here is a crazy idea...
    what
    if you guys developed a wrapper that could work on top of any JPA
    provider
    to offer a higher level EOF like API ?

    Regards,
    Francisco
    It's true that there is no /long term/ temporary pk; you have to commit for
    the db for that.
    But the following also holds:

    MyPersistentObj obj = context.newObject(MyPersistentObj.class);
    assert obj.getObjectId() != null

    MyPersistentObj obj2 = context.newObject(MyPersistentObj.class);
    assert !obj.getObjectId().equals(obj2.getObjectId());

    which is the critical piece of information that, I think, Francisco was
    looking for.
    In the hibernate world, your object is "new" if the object's id is null.
    Otherwise, it's persisted in the database w/ a pk.  There is no "in between"
    state.

    Robert


  • Francisco Peredo at Mar 11, 2009 at 9:35 pm
    Hi!

    Thanks a lot for your answers Robert and Mike, Robert was right, I was
    looking for
    short term/ temporary pk that can be apparently be obtained with
    obj.getObjectId() for
    cases where the object has not been persisted in to the database.

    Seems like Cayenne could be a better fit for the way my mind works, but I do
    require inheritance support on a level like the one available in
    hibernate... do you know how far in the future is a full JPA 1.0 3 types of
    inheritance support for Cayenne?

    Another thing a really miss a lot from EOF are NestedEditingContexts... ( I
    think they would be a perfect fit for Seam Conversations). Is there support
    for them in Cayenne?

    Regards,

    Francisco


    --
    View this message in context: http://www.nabble.com/Coming-from-EOF%3A-Cayenne-vs-Hibernate-tp22463349p22465074.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Robert Zeigler at Mar 11, 2009 at 9:40 pm
    Support for nested contexts: yes.
    (Although I'm pretty sure that the newest versions of hibernate have
    nested sessions? Haven't played with them, though).

    Inheritance: someone who has worked on the issue will have to comment.
    Various stops and starts have been made, and I haven't followed the
    issue.

    Robert
    On Mar 11, 2009, at 3/114:34 PM , Francisco Peredo wrote:


    Hi!

    Thanks a lot for your answers Robert and Mike, Robert was right, I was
    looking for
    short term/ temporary pk that can be apparently be obtained with
    obj.getObjectId() for
    cases where the object has not been persisted in to the database.

    Seems like Cayenne could be a better fit for the way my mind works,
    but I do
    require inheritance support on a level like the one available in
    hibernate... do you know how far in the future is a full JPA 1.0 3
    types of
    inheritance support for Cayenne?

    Another thing a really miss a lot from EOF are
    NestedEditingContexts... ( I
    think they would be a perfect fit for Seam Conversations). Is there
    support
    for them in Cayenne?

    Regards,

    Francisco


    --
    View this message in context: http://www.nabble.com/Coming-from-EOF%3A-Cayenne-vs-Hibernate-tp22463349p22465074.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Francisco Peredo at Mar 11, 2009 at 9:50 pm
    Nope, it does not have anything like it. JbossSeam does support nested
    conversations, but since the underlying ORM (Hibernate) has no support for
    anything like it, there is a kind of "impedance mismatch" that makes nested
    conversations very unusable (even the Seam experts use nested conversation
    only as a last resort)

    Have you guys heard of a new web framework "AribaWeb (http://aribaweb.org/)"
    after what you guys have told me I am starting to think that Cayenne would
    be better persistence framework for that project.... of course for that to
    work Cayenne 3.0 would have to be finished. :-(

    I wonder.... what do you when you have to do something like validateForXXX
    in hibernate and you need to query the database?

    Regards,

    Francisco

    --
    View this message in context: http://www.nabble.com/Coming-from-EOF%3A-Cayenne-vs-Hibernate-tp22463349p22465347.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Francisco Peredo at Mar 11, 2009 at 10:05 pm
    Hi!I really wonder why nobody has built something like Cayenne on top of JPA,
    I mean, it should be clear that Cayenne is higher level API that offers a
    lot of advantages...I have another question: when using in Cayenne JPA
    api... after you call entityManager.persist(object)... in what state is the
    object? NEW (as it should to be consistent with Cayenne classic?) or
    COMMITTED? (to be consistent with JPA)Regards,Francisco
    --
    View this message in context: http://www.nabble.com/Coming-from-EOF%3A-Cayenne-vs-Hibernate-tp22463349p22465578.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Aristedes Maniatis at Mar 11, 2009 at 11:18 pm

    On 12/03/2009, at 9:04 AM, Francisco Peredo wrote:

    Hi!I really wonder why nobody has built something like Cayenne on
    top of JPA,
    I mean, it should be clear that Cayenne is higher level API that
    offers a
    lot of advantages..
    Andrus has already spent a vast amount of time on moving Cayenne
    toward JPA compliance. It is not a goal for 3.0 because other more
    important issues are being addressed first. Even though quite a lot of
    JPA already works, as you know with the JSR process, you can't be
    'almost compliant'. Cayenne will only be able to be advertised as JPA
    compliant when all the tests pass.

    As for inheritance, Cayenne already supports single table inheritance
    and vertical/horizontal are probably only some months away.

    Finally, don't be scared by the 3.0M6 naming. It is certainly stable
    enough to be used in production, however there is no guarantee that
    the API is finalised. So if you use the milestone you may need to
    alter your code slightly for the next milestone.


    Regards
    Ari

    -------------------------->
    ish
    http://www.ish.com.au
    Level 1, 30 Wilson Street Newtown 2042 Australia
    phone +61 2 9550 5001 fax +61 2 9550 4001
    GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A
  • Francisco Peredo at Mar 12, 2009 at 2:35 pm
    Hi!

    And about the state of an object after you call
    entityManager.persist(object) with Cayenne... can your offer any
    insights?...I mean in what state is the object? NEW (as it should to be
    consistent with Cayenne classic?) or COMMITTED? (to be consistent with JPA
    as implemented by Hibernate)

    Does it really need to be COMMITTED to be consistent with JPA? Or is this an
    abstraction leak in JPA/Hibernate ?

    Regards,

    Francisco



    Aristedes Maniatis wrote:
    On 12/03/2009, at 9:04 AM, Francisco Peredo wrote:

    Hi!I really wonder why nobody has built something like Cayenne on
    top of JPA,
    I mean, it should be clear that Cayenne is higher level API that
    offers a
    lot of advantages..
    Andrus has already spent a vast amount of time on moving Cayenne
    toward JPA compliance. It is not a goal for 3.0 because other more
    important issues are being addressed first. Even though quite a lot of
    JPA already works, as you know with the JSR process, you can't be
    'almost compliant'. Cayenne will only be able to be advertised as JPA
    compliant when all the tests pass.

    As for inheritance, Cayenne already supports single table inheritance
    and vertical/horizontal are probably only some months away.

    Finally, don't be scared by the 3.0M6 naming. It is certainly stable
    enough to be used in production, however there is no guarantee that
    the API is finalised. So if you use the milestone you may need to
    alter your code slightly for the next milestone.


    Regards
    Ari

    -------------------------->
    ish
    http://www.ish.com.au
    Level 1, 30 Wilson Street Newtown 2042 Australia
    phone +61 2 9550 5001 fax +61 2 9550 4001
    GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A


    --
    View this message in context: http://www.nabble.com/Coming-from-EOF%3A-Cayenne-vs-Hibernate-tp22463349p22477651.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Andrus Adamchik at Mar 12, 2009 at 3:35 pm
    NEW, IIRC. Would be weird to have it COMMITTED at this point in
    lifecycle. In general if you want to stay on JPA, I'd still recommend
    using a compliant provider. Cayenne's strength is its "classic" API.

    Andrus
    On Mar 12, 2009, at 4:35 PM, Francisco Peredo wrote:


    Hi!

    And about the state of an object after you call
    entityManager.persist(object) with Cayenne... can your offer any
    insights?...I mean in what state is the object? NEW (as it should to
    be
    consistent with Cayenne classic?) or COMMITTED? (to be consistent
    with JPA
    as implemented by Hibernate)

    Does it really need to be COMMITTED to be consistent with JPA? Or is
    this an
    abstraction leak in JPA/Hibernate ?

    Regards,

    Francisco



    Aristedes Maniatis wrote:
    On 12/03/2009, at 9:04 AM, Francisco Peredo wrote:

    Hi!I really wonder why nobody has built something like Cayenne on
    top of JPA,
    I mean, it should be clear that Cayenne is higher level API that
    offers a
    lot of advantages..
    Andrus has already spent a vast amount of time on moving Cayenne
    toward JPA compliance. It is not a goal for 3.0 because other more
    important issues are being addressed first. Even though quite a lot
    of
    JPA already works, as you know with the JSR process, you can't be
    'almost compliant'. Cayenne will only be able to be advertised as JPA
    compliant when all the tests pass.

    As for inheritance, Cayenne already supports single table inheritance
    and vertical/horizontal are probably only some months away.

    Finally, don't be scared by the 3.0M6 naming. It is certainly stable
    enough to be used in production, however there is no guarantee that
    the API is finalised. So if you use the milestone you may need to
    alter your code slightly for the next milestone.


    Regards
    Ari

    -------------------------->
    ish
    http://www.ish.com.au
    Level 1, 30 Wilson Street Newtown 2042 Australia
    phone +61 2 9550 5001 fax +61 2 9550 4001
    GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A


    --
    View this message in context: http://www.nabble.com/Coming-from-EOF%3A-Cayenne-vs-Hibernate-tp22463349p22477651.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Francisco Peredo at Mar 12, 2009 at 5:47 pm
    Well, Cayenne 3.0 (when finally released) will be a complaint provider. :-P

    What I would like is to switch from Hibernate in to Cayenne to take
    advantage what I percieve to be weaknesses of Hibernate way of doing ORM.

    I am looking to progressively switch from JPA/Hibernate to JPA/Cayenne. Do
    you think it is a bad idea?

    Regards,





    Andrus Adamchik wrote:
    NEW, IIRC. Would be weird to have it COMMITTED at this point in
    lifecycle. In general if you want to stay on JPA, I'd still recommend
    using a compliant provider. Cayenne's strength is its "classic" API.

    Andrus
    On Mar 12, 2009, at 4:35 PM, Francisco Peredo wrote:


    Hi!

    And about the state of an object after you call
    entityManager.persist(object) with Cayenne... can your offer any
    insights?...I mean in what state is the object? NEW (as it should to
    be
    consistent with Cayenne classic?) or COMMITTED? (to be consistent
    with JPA
    as implemented by Hibernate)

    Does it really need to be COMMITTED to be consistent with JPA? Or is
    this an
    abstraction leak in JPA/Hibernate ?

    Regards,

    Francisco



    Aristedes Maniatis wrote:
    On 12/03/2009, at 9:04 AM, Francisco Peredo wrote:

    Hi!I really wonder why nobody has built something like Cayenne on
    top of JPA,
    I mean, it should be clear that Cayenne is higher level API that
    offers a
    lot of advantages..
    Andrus has already spent a vast amount of time on moving Cayenne
    toward JPA compliance. It is not a goal for 3.0 because other more
    important issues are being addressed first. Even though quite a lot
    of
    JPA already works, as you know with the JSR process, you can't be
    'almost compliant'. Cayenne will only be able to be advertised as JPA
    compliant when all the tests pass.

    As for inheritance, Cayenne already supports single table inheritance
    and vertical/horizontal are probably only some months away.

    Finally, don't be scared by the 3.0M6 naming. It is certainly stable
    enough to be used in production, however there is no guarantee that
    the API is finalised. So if you use the milestone you may need to
    alter your code slightly for the next milestone.


    Regards
    Ari

    -------------------------->
    ish
    http://www.ish.com.au
    Level 1, 30 Wilson Street Newtown 2042 Australia
    phone +61 2 9550 5001 fax +61 2 9550 4001
    GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A


    --
    View this message in context:
    http://www.nabble.com/Coming-from-EOF%3A-Cayenne-vs-Hibernate-tp22463349p22477651.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
    --
    View this message in context: http://www.nabble.com/Coming-from-EOF%3A-Cayenne-vs-Hibernate-tp22463349p22481898.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Michael Gentry at Mar 12, 2009 at 6:00 pm
    Actually, Cayenne 3.0 final will probably *not* be JPA compliant.
    Things change, of course, but that is my guess at this point. If
    immediate JPA compliance is a requirement, Cayenne doesn't currently
    meet that. The "Cayenne Classic" functionality, which is similar to
    EOF, is in pretty good shape, though.

    Does JPA even offer the object context feature? To me, that is a huge
    feature of Cayenne (and EOF).

    /dev/mrg


    On Thu, Mar 12, 2009 at 1:47 PM, Francisco Peredo
    wrote:
    Well, Cayenne 3.0 (when finally released) will be a complaint provider.  :-P

    What I would like is to switch from Hibernate in to Cayenne to take
    advantage what I percieve to be weaknesses of Hibernate way of doing ORM.

    I am looking to progressively switch from JPA/Hibernate to JPA/Cayenne. Do
    you think it is a bad idea?

    Regards,





    Andrus Adamchik wrote:
    NEW, IIRC. Would be weird to have it COMMITTED at this point in
    lifecycle. In general if you want to stay on JPA, I'd still recommend
    using a compliant provider. Cayenne's strength is its "classic" API.

    Andrus
    On Mar 12, 2009, at 4:35 PM, Francisco Peredo wrote:


    Hi!

    And about the state of an object after you call
    entityManager.persist(object) with Cayenne... can your offer any
    insights?...I mean in what state is the object? NEW (as it should to
    be
    consistent with Cayenne classic?) or COMMITTED? (to be consistent
    with JPA
    as implemented by Hibernate)

    Does it really need to be COMMITTED to be consistent with JPA? Or is
    this an
    abstraction leak in JPA/Hibernate ?

    Regards,

    Francisco



    Aristedes Maniatis wrote:
    On 12/03/2009, at 9:04 AM, Francisco Peredo wrote:

    Hi!I really wonder why nobody has built something like Cayenne on
    top of JPA,
    I mean, it should be clear that Cayenne is higher level API that
    offers a
    lot of advantages..
    Andrus has already spent a vast amount of time on moving Cayenne
    toward JPA compliance. It is not a goal for 3.0 because other more
    important issues are being addressed first. Even though quite a lot
    of
    JPA already works, as you know with the JSR process, you can't be
    'almost compliant'. Cayenne will only be able to be advertised as JPA
    compliant when all the tests pass.

    As for inheritance, Cayenne already supports single table inheritance
    and vertical/horizontal are probably only some months away.

    Finally, don't be scared by the 3.0M6 naming. It is certainly stable
    enough to be used in production, however there is no guarantee that
    the API is finalised. So if you use the milestone you may need to
    alter your code slightly for the next milestone.


    Regards
    Ari

    -------------------------->
    ish
    http://www.ish.com.au
    Level 1, 30 Wilson Street Newtown 2042 Australia
    phone +61 2 9550 5001   fax +61 2 9550 4001
    GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A


    --
    View this message in context:
    http://www.nabble.com/Coming-from-EOF%3A-Cayenne-vs-Hibernate-tp22463349p22477651.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
    --
    View this message in context: http://www.nabble.com/Coming-from-EOF%3A-Cayenne-vs-Hibernate-tp22463349p22481898.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Francisco Peredo at Mar 12, 2009 at 6:13 pm
    Yes, but the thing is I already have some systems built with JPA/Hibernate,
    so I do need JPA compliace (maybe not full, but very close to full)

    Well, JPA has its own object context like feature, it is called
    "entityManager" the problem is that its API is poorer than Cayenne's API

    As I stated before, I really think someone should build a Cayenne like API
    that used any JPA compliant as its internal storage engine, JPA is just too
    low level

    Regards,


    Michael Gentry-2 wrote:
    Actually, Cayenne 3.0 final will probably *not* be JPA compliant.
    Things change, of course, but that is my guess at this point. If
    immediate JPA compliance is a requirement, Cayenne doesn't currently
    meet that. The "Cayenne Classic" functionality, which is similar to
    EOF, is in pretty good shape, though.

    Does JPA even offer the object context feature? To me, that is a huge
    feature of Cayenne (and EOF).

    /dev/mrg


    --
    View this message in context: http://www.nabble.com/Coming-from-EOF%3A-Cayenne-vs-Hibernate-tp22463349p22482429.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Aristedes Maniatis at Mar 12, 2009 at 10:33 pm

    On 13/03/2009, at 5:12 AM, Francisco Peredo wrote:

    As I stated before, I really think someone should build a Cayenne
    like API
    that used any JPA compliant as its internal storage engine, JPA is
    just too
    low level
    That doesn't really make sense because JPA is a description of an
    interface, not an internal structure or storage engine. JPA is a
    specification for how an ORM should present to the user, not how that
    ORM works internally. And because the JPA was largely modelled around
    Hibernate, it looks a lot like Hibernate: for example, the lifecycle
    events don't quite make sense (and are even less sensible in ROP).

    If you are going to keep your code using JPA, I don't really see a
    huge benefit for you to move away from Hibernate. After all, it meets
    the specification. If on the other hand, you don't like the way it
    works and want the benefits of the Cayenne API, then you'll need to
    rewrite some code in your application. Only you can determine whether
    the effort is worth it. You could certainly try Cayenne as a JPA
    provider and see if it works for your needs as an interim step, but
    you aren't going to derive a lot of benefit from that approach.

    For what it is worth, there are a few EOF refugees here. In a parallel
    universe where Apple and Andrus were on JSR-220, the final JPA
    specification might have looked more like the Cayenne and EOF API.


    Ari Maniatis



    -------------------------->
    ish
    http://www.ish.com.au
    Level 1, 30 Wilson Street Newtown 2042 Australia
    phone +61 2 9550 5001 fax +61 2 9550 4001
    GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A
  • Andrus Adamchik at Mar 12, 2009 at 3:51 pm

    On Mar 12, 2009, at 1:18 AM, Aristedes Maniatis wrote:

    As for inheritance, Cayenne already supports single table
    inheritance and vertical/horizontal are probably only some months
    away.
    Yeah, IMO absence of the two types of inheritance out of 3 is the only
    major ORM feature missing in Cayenne. My time became the bottleneck on
    this one, but I am hopeful :-)

    Andrus

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedMar 11, '09 at 8:07p
activeMar 12, '09 at 10:33p
posts17
users5
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase