db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Armin Waibel" <ar...@code-au-lait.de>
Subject Re: Identity.realClass set to abstract class?!
Date Thu, 04 Sep 2003 10:04:23 GMT
Hi Olli,

> 
> > 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?
>

Think you are right, this will be in accordance with
the definition of 'objectsRealClass'. What about the
side-effects if we change the matching lines in code
(without using your proposed field 'lowestKnownClass')?

regards,
Armin
 
> 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())
> 
> 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