FAQ
On http://cayenne.apache.org/doc/modeling-inheritance.html , I see this statement:
"As of this writing Cayenne does not support horizontal inheritance. It may in the future."

Well, guess what, the first instance where I absolutely need inheritance does require horizontal modeling. Two legacy tables happen to have a very similar column structure and server very similar purposes, and since the processing is complicated and accesses many fields of each record, having a common superclass wired up would really simplify a lot of code.

So the question is: Is there any realistic hope that this will be done soon?
Would outside help speed up things?
Limited help, unfortunately. I'll have to justify any time I sink into this :-(

The other approach might be faking a vertical/joined scenario using views.
However, I'd like to avoid that because I know that views tend to come with their own cans of worms (updateability and lack of useful metadata).

Regards,
Jo

Search Discussions

  • Marek Šabo at Nov 30, 2011 at 8:54 pm
    Hi,

    my app that uses cayenne got few rows changed externally in mysql
    database. I observed that app didn't behave according to these changes
    and after restarting it worked as expected (with those changed rows).
    Could this be due to cayenne caching mechanism. Or is it probably bug on
    my side? If former, is it possible to set time expiration on cache, or
    invoke expiration manually?

    Thanks,

    Regards,

    Marek
    On 11/30/2011 06:47 PM, Durchholz, Joachim wrote:
    On http://cayenne.apache.org/doc/modeling-inheritance.html , I see this statement:
    "As of this writing Cayenne does not support horizontal inheritance. It may in the future."

    Well, guess what, the first instance where I absolutely need inheritance does require horizontal modeling. Two legacy tables happen to have a very similar column structure and server very similar purposes, and since the processing is complicated and accesses many fields of each record, having a common superclass wired up would really simplify a lot of code.

    So the question is: Is there any realistic hope that this will be done soon?
    Would outside help speed up things?
    Limited help, unfortunately. I'll have to justify any time I sink into this :-(

    The other approach might be faking a vertical/joined scenario using views.
    However, I'd like to avoid that because I know that views tend to come with their own cans of worms (updateability and lack of useful metadata).

    Regards,
    Jo
  • Michael Gentry at Dec 5, 2011 at 2:30 pm
    Hi Marek,

    Are you talking about saving or fetching? On saving, optimistic
    locking can help catch stale data issues. On fetching, I always
    prefer to go back to the DB and get fresh data (not use the cache).

    mrg

    On Wed, Nov 30, 2011 at 3:53 PM, Marek Šabo wrote:
    Hi,

    my app that uses cayenne got few rows changed externally in mysql database.
    I observed that app didn't behave according to these changes and after
    restarting it worked as expected (with those changed rows). Could this be
    due to cayenne caching mechanism. Or is it probably bug on my side? If
    former, is it possible to set time expiration on cache, or invoke expiration
    manually?

    Thanks,

    Regards,

    Marek
    On 11/30/2011 06:47 PM, Durchholz, Joachim wrote:

    On http://cayenne.apache.org/doc/modeling-inheritance.html , I see this
    statement:
    "As of this writing Cayenne does not support horizontal inheritance. It
    may in the future."

    Well, guess what, the first instance where I absolutely need inheritance
    does require horizontal modeling. Two legacy tables happen to have a very
    similar column structure and server very similar purposes, and since the
    processing is complicated and accesses many fields of each record, having a
    common superclass wired up would really simplify a lot of code.

    So the question is: Is there any realistic hope that this will be done
    soon?
    Would outside help speed up things?
    Limited help, unfortunately. I'll have to justify any time I sink into
    this :-(

    The other approach might be faking a vertical/joined scenario using views.
    However, I'd like to avoid that because I know that views tend to come
    with their own cans of worms (updateability and lack of useful metadata).

    Regards,
    Jo
  • Gilbertoca at Dec 1, 2011 at 2:00 pm
    Hi jo,

    Durchholz, Joachim wrote
    On http://cayenne.apache.org/doc/modeling-inheritance.html , I see this
    statement:
    "As of this writing Cayenne does not support horizontal inheritance. It
    may in the future."

    Well, guess what, the first instance where I absolutely need inheritance
    does require horizontal modeling. Two legacy tables happen to have a very
    similar column structure and server very similar purposes, and since the
    processing is complicated and accesses many fields of each record, having
    a common superclass wired up would really simplify a lot of code.

    So the question is: Is there any realistic hope that this will be done
    soon?
    This issue is old[1]. Taking the Andrus' words "here you ran across
    something on the edges of Cayenne". I think some guys give up on Apache
    Cayenne when they find it can't manage inheritance completely, so for some
    projects this is limitation (After all it is an ORM, isn't it?[2]).
    I've tried to introduce Cayenne in my work[3], but that limitation was the
    main reason it wasn't choose.
    So we are using JPA2 (eclipselink) in our projects.

    Regards,

    Gilberto

    [1] https://issues.apache.org/jira/browse/CAY-795
    [2] http://c2.com/cgi/wiki?ObjectRelationalToolComparison
    [3] http://www.secad.to.gov.br


    --
    View this message in context: http://cayenne.195.n3.nabble.com/Table-per-class-inheritance-in-Cayenne-tp3549101p3551656.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Durchholz, Joachim at Dec 1, 2011 at 6:24 pm
    Thanks, I wasn't aware of that JIRA report.
    I see Andrus has it on his radar for 3.1, that's good.

    BTW the c2.com link is outdated, it's from 2007 and hence does not list Ebean.

    Regards,
    Jo

    -----Original Message-----
    From: gilbertoca
    Sent: Thursday, December 01, 2011 3:00 PM
    To: user@cayenne.apache.org
    Subject: Re: Table-per-class inheritance in Cayenne?

    Hi jo,

    Durchholz, Joachim wrote
    On http://cayenne.apache.org/doc/modeling-inheritance.html , I see
    this
    statement:
    "As of this writing Cayenne does not support horizontal inheritance.
    It may in the future."

    Well, guess what, the first instance where I absolutely need
    inheritance does require horizontal modeling. Two legacy tables happen
    to have a very similar column structure and server very similar
    purposes, and since the processing is complicated and accesses many
    fields of each record, having a common superclass wired up would really simplify a lot of code.

    So the question is: Is there any realistic hope that this will be done
    soon?
    This issue is old[1]. Taking the Andrus' words "here you ran across something on the edges of Cayenne". I think some guys give up on Apache Cayenne when they find it can't manage inheritance completely, so for some projects this is limitation (After all it is an ORM, isn't it?[2]).
    I've tried to introduce Cayenne in my work[3], but that limitation was the main reason it wasn't choose.
    So we are using JPA2 (eclipselink) in our projects.

    Regards,

    Gilberto

    [1] https://issues.apache.org/jira/browse/CAY-795
    [2] http://c2.com/cgi/wiki?ObjectRelationalToolComparison
    [3] http://www.secad.to.gov.br


    --
    View this message in context: http://cayenne.195.n3.nabble.com/Table-per-class-inheritance-in-Cayenne-tp3549101p3551656.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Michael Gentry at Dec 5, 2011 at 2:27 pm
    Hi Joachim,

    Is this something that Embeddables might could help out with? Also,
    if you need to share common methods, you can create your own abstract
    class that inherits from DataObject and then in Cayenne Modeler, use
    the Superclass field for the ObjEntity to specify it. When you
    generate your classes, they'll inherit from whatever you specify.

    mrg


    On Wed, Nov 30, 2011 at 12:47 PM, Durchholz, Joachim
    wrote:
    On http://cayenne.apache.org/doc/modeling-inheritance.html , I see this statement:
    "As of this writing Cayenne does not support horizontal inheritance. It may in the future."

    Well, guess what, the first instance where I absolutely need inheritance does require horizontal modeling. Two legacy tables happen to have a very similar column structure and server very similar purposes, and since the processing is complicated and accesses many fields of each record, having a common superclass wired up would really simplify a lot of code.

    So the question is: Is there any realistic hope that this will be done soon?
    Would outside help speed up things?
    Limited help, unfortunately. I'll have to justify any time I sink into this :-(

    The other approach might be faking a vertical/joined scenario using views.
    However, I'd like to avoid that because I know that views tend to come with their own cans of worms (updateability and lack of useful metadata).

    Regards,
    Jo
  • Durchholz, Joachim at Dec 5, 2011 at 3:05 pm
    Hey, yes, Embeddables might do the trick.
    It's all too easy to run into that "I need inheritance" trap, most of the time, you don't.
    Suggestion: Add a paragraph explaining the alternatives to inheritance in the documentation. I bet other people reading that page will miss that one, too.

    Regards
    Jo

    -----Original Message-----
    From: Michael Gentry
    Sent: Monday, December 05, 2011 3:26 PM
    To: user@cayenne.apache.org
    Subject: Re: Table-per-class inheritance in Cayenne?

    Hi Joachim,

    Is this something that Embeddables might could help out with? Also, if you need to share common methods, you can create your own abstract class that inherits from DataObject and then in Cayenne Modeler, use the Superclass field for the ObjEntity to specify it. When you generate your classes, they'll inherit from whatever you specify.

    mrg

    On Wed, Nov 30, 2011 at 12:47 PM, Durchholz, Joachim wrote:
    On http://cayenne.apache.org/doc/modeling-inheritance.html , I see this statement:
    "As of this writing Cayenne does not support horizontal inheritance. It may in the future."

    Well, guess what, the first instance where I absolutely need inheritance does require horizontal modeling. Two legacy tables happen to have a very similar column structure and server very similar purposes, and since the processing is complicated and accesses many fields of each record, having a common superclass wired up would really simplify a lot of code.

    So the question is: Is there any realistic hope that this will be done soon?
    Would outside help speed up things?
    Limited help, unfortunately. I'll have to justify any time I sink into
    this :-(

    The other approach might be faking a vertical/joined scenario using views.
    However, I'd like to avoid that because I know that views tend to come with their own cans of worms (updateability and lack of useful metadata).

    Regards,
    Jo

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedNov 30, '11 at 5:47p
activeDec 5, '11 at 3:05p
posts7
users4
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase