You are viewing a plain text version of this content. The canonical link for it is here.
Posted to graffito-dev@incubator.apache.org by Dan Connelly <ds...@adelphia.net> on 2006/09/15 10:43:33 UTC
AtomicTypeConversion not used when NodeTypePerHierarchy ??
ObjectConverterImpl#retrieveSimpleFields has this guard for one branch
of its logic:
* (classDescriptor.usesNodeTypePerHierarchyStrategy() &&
classDescriptor.hasDiscriminator()) *
When that test is true, then there is *no type conversion* when the
object field is set from a getValue().getString() on the node property.
For my object model, this condition is true (somehow?) and I have an
*int* field in the object. The int cannot be set from the String.
If the inheritance strategy were not NodeTypePerHierarchy, it would work.
Note that this is a test program. I pm.save the object model and then
immediately do pm.getObject(root) to retrieve a second model
instance. The same mapping is used for the ite and the read.
I have tried this with and without extend="xxxx" class attributes in the
mapping (trying to contol the inheritance stragety). It fails with and
without the extends. However, my guess is that type conversion on
atomic fields is needed for all inheritance strategies, even when there
is a class discriminator.
BTW: The DTD comment says "extends" but the !ATTLIST wants it to be
"extend". Confusing. Since its optional, why would I ever want to
give the "extend" in the mapping?