incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Connelly <>
Subject AtomicTypeConversion not used when NodeTypePerHierarchy ??
Date Fri, 15 Sep 2006 10:43:33 GMT
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 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?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message