db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oliver.m...@ppi.de
Subject Identity.realClass set to abstract class?!
Date Wed, 20 Aug 2003 13:52:41 GMT
Hello,

I have encountered a behaviour that I consider
suspicous.  It has to do with the meaning of
Identity.realClass.  I won't explain
what I am doing, because my problem is difficult to 
observe and it is easy to workaround.

But nevertheless I would like to understand a little
more, as there might be a performance issue related to it.

The following description is in the source code.

    /**
     * the Class of the identified object<br>
     * ie: an Interface
     */
    private Class objectsTopLevelClass;

    /**
     * the real Class of the identified object<br>
     * ie: the implementing Class
     */
    private Class objectsRealClass = null;


I think the description of objectsTopLevelClass is 
wrong, but that's not important.

By point is that objectsRealClass should be the class
of the identified object, i.e. the result of Object.getClass().
However, there are various points in the code where
objectsRealClass is set differently (to an abstract class
in my case).  E.g. from PersistenceBrokerImpl:

  // ensure that top-level extents are used for Identities
  referencedClass =
descriptorRepository.getTopLevelClass(rds.getItemClass());
  id = new Identity(rds.getItemClass(), referencedClass, pkVals);
                    ^^^^^^^^^^^^^^^^^^
                    (suspicious, see previous line.)


If I have understood the meaning of these two fiels correctly,
I would say:
 
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.


What do you think?

Olli

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