You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ol...@ppi.de on 2003/09/04 10:46:36 UTC
RE: Identity.realClass set to abstract class?!
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?
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
Re: Identity.realClass set to abstract class?!
Posted by Armin Waibel <ar...@code-au-lait.de>.
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
Re: Identity.realClass set to abstract class?!
Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi olli, thomas,
i fixed this in Collection- and ReferencePrefetcher.
jakob
Thomas Mahler wrote:
> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org
Re: Identity.realClass set to abstract class?!
Posted by Thomas Mahler <th...@web.de>.
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