jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@gmail.com>
Subject [ocm] mapping selection
Date Wed, 26 Sep 2007 07:08:22 GMT

When a node is mapped by calling the ObjectConverter.getObject(Session,
Class, String) method and no discriminator property is configured the
ObjectConverterImpl class tries to find a "best" mapping for the
effective node. This is done by walking the class descriptor hierarchy
starting at the descriptor for the selected class until a mapping for
the node type is found.

In case the class descriptor hierarchy is incomplete because an
improperly defined class descriptor would actually perfectly map the
node but is not declared to extend (or implement) its parent
classes/interfaces, the hierarchy walk down will not find the mapping
and thus in the end, the originally requested class will be
instantiated. If the class is abstract or an interface this of course

If an exact class descriptor for the node type would be looked up
directly, the mapping might be found immediately and the class of the
descriptor can be verified it actually is assignement compatible with
the requested class. If this would fail, we could still walk the
hierarchy to see, whether we find another classdescriptor. What do you
think of this modification to the algorithm ? 


View raw message