db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mahler <thm...@web.de>
Subject Re: Identity.realClass set to abstract class?!
Date Thu, 04 Sep 2003 11:32:31 GMT
Hi Olli,

oliver.matz@ppi.de wrote:
> Hello,
> 
> I am sorry if I am a bit pedantic on this issue,
> but I fear that there is some irritation about
> the meaning of Identity.realClass and 
> Identity.topLevelClass.
> 
> 
>>-----Original Message-----
>>From: oliver.matz@ppi.de [mailto:oliver.matz@ppi.de]
> 
> 
> Armin and I agreed that this is the intended meaning 
> of these values:
> 
> 
>>objectsTopLevelClass - the highest persistence-capable 
>>   class or interface (in the inheritance hierarchy)
>>   that the identified object is an instance of
>>
>>objectsRealClass - the concrete class of the object, 
>>   or null if not known.
> 
> 
> But in the code I often find statements like that:
> (from class ReferencePrefetcher, line 104 ff)
> -- snip ---
> Class topLevelClass = getBroker().getTopLevelClass(
> 	getObjectReferenceDescriptor().getItemClass());
> Class realClass = getObjectReferenceDescriptor().getItemClass();
> // ...
> id = new Identity(realClass, topLevelClass, fkValues);
> -- snap ---
> 
> The class mentioned in the reference-descriptor need not
> be the real class, right? So it would be better to say:
> 
> -- snip ---
> Class topLevelClass = getBroker().getTopLevelClass(
> 	getObjectReferenceDescriptor().getItemClass());
> // ..
> id = new Identity(null, topLevelClass, fkValues);
> -- snap ---
> 
> Am I right, or am I misconceiving things?

I agree with you. the above code snippet could lead to different 
Identies identifying the same object. So IMO it's clearly a bug.

> Please see also my other posting on this issue:
> I could imaging to have something like that in order
> not to lose the information from the reference-descriptor:
> id.setLowestKnownClass(getObjectReferenceDescriptor().getItemClass())

yes that could be helpful. (but I'm still in doubt about the performance 
gain ;-))

cheers,
Thomas

> Regards,
> 	Olli
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message