openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: Parent reference is loaded, but disappears while working with the object.
Date Mon, 15 Nov 2010 15:29:37 GMT

Hi Gerald,
> "inheritance reflected in mapping descriptors"
Generally for an inheritance hierarchy of persistent classes, one would use
<inheritance> and <discriminator-column/value> tag (though all of them are
defaulted). The default SINGLE_TABLE inheritance mapping strategy will store
all the derived types in a single table and identify record of a particular
type by the value of discriminator column. 
For example, YP_INSTANCE_TYPE_ID may be gainfully used as a discriminator
for YPInstanceItem records. However, for a mere suggestion, given the wide
variance on persistent properties of the  derived classes default
SINGLE_TABLE inheritance strategy may not be the best choice.
In fact I am bit perplexed by the intent behind target database mapping with
the combination of 
a) default SINGLE_TABLE inheritance strategy 
*and* 
b) attribute-override of primary column for each derived type 
*and* 
c) each derived type declaring its own table.

My guess is SINGLE_TABLE inheritance strategy is not what you intend.

> the problem occurs very quick (after 10 minutes or ca. 100 selects). 
Coming back to your question, does this imply that the problem of losing
parent reference is intermittent?
Or is every parent reference is lost?

Another minor observation: the mapping descriptor uses <generated-value
strategy="IDENTITY"/> for the primary identity field. In such case, setId()
method is not necessary and can even lead to application coding error. 



-----
Pinaki 
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/Parent-reference-is-loaded-but-disappears-while-working-with-the-object-tp5728025p5740209.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message