users@glassfish.java.net

Re: Postgres inheritance mapping solution

From: <glassfish_at_javadesktop.org>
Date: Wed, 01 Aug 2007 05:58:51 PDT

>> My questions are:
>> 1) Am I right that TABLE_PER_CLASS would be the right mapping for inherited tables (If it were available)?
>>
>>
>I'd go for the JOINED strategy. With TABLE_PER_CLASS you're duplicating
>the common columns in all the tables of the inheritance hierarchy, and

The "column duplication" is in many ways similar to the INHERITS declaration in postgres so this is would not be a great deal.

>queries on the "root" class join all tables. The JOINED strategy avoids
>column duplication, but queries on the "root" class also join all the
>tables. Theoretically, you don't need a discriminator column when using

Theory is the one thing. In practice this did not work yet as far as I could discover with toplink essentials. I will give it further tests..

>the JOINED strategy. This is only required for the SINGLE_TABLE strategy.
>> 2) Can anybody say when TABLE_PER_CLASS will be available?
>>
>> 3) Did anybody find another solution for inherited table mapping with similar features as the SINGLE_TABLE mapping?
>>
>Table inheritance in Postgres seems to be an orthogonal feature, which
>doesn't match the JPA concept, which assumes that the inheritance is
>managed by the Persistence Provider.

Yes, I understand that. But the question was if there is a mapping technique which makes table inheritance fitting to jpa and if so, then would this mapping type be TABLE_PER_CLASS, when it comes available.


Thank you for your first answers, they have been helpful anyhow, but I leave my questions open for further comments.
[Message sent by forum member 'senortorpedo' (senortorpedo)]

http://forums.java.net/jive/thread.jspa?messageID=229013