cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: Problem with inheritance
Date Mon, 12 Dec 2011 17:08:26 GMT
Hi Mathias,

I believe you are trying to use a currently unimplemented inheritance
mechanism.  Cayenne does not currently support horizontal
(multiple-table) inheritance:

http://cayenne.apache.org/doc/inheritance-overview.html

There are tricks you can do to make working with multiple related
tables easier (such as adding getters/setters in your subclass to
reference the parent), but you cannot currently model this behavior
automatically.

mrg


On Fri, Dec 9, 2011 at 3:00 AM, Mathias Clerc <tlarhices@gmail.com> wrote:
> Hello,
>
> It seems like I have missed something in inheritance in Cayenne.
>
> I have one main table called "Element" with fields id (PK), name and description
> Another table "File" inherits from "Element" with fields ID(PK, FK on
> Element.id) and path.
>
> When I do a context.performIteratedQuery(new
> SelectQuery(Element.class)) The query I see is :
> SELECT t0.ID, t0.DESCRIPTION, t0.NAME, t0.TYPE, t0.ID, t0.ID, t0.PATH
> FROM ELEMENT t0
>
> I tried checking and unchecking the "To Dep PK" field for the relation in ID.
>
> What did I miss ?

Mime
View raw message