h1. Problem description Marshalling a JaxbHbmTuplizerType to Xml : * Does not take into account the entity mode attribute may be null whereas the xml-schema does not specifies it as use="required" (a NPE is thrown). * Does not serialize the entity mode properly. The Enum litteral is inserted (POJO, MAP) instead of the xsd-specified values ("pojo", "dynamic-map"). Creating a session factory with the generated Xml throws a org.hibernate.boot.InvalidMappingException.
As a consequences, the xml cannot be generated or the generated xml does not define a valid mapping file.
h1. Steps to reproduce See attached file.
h1. Workaround The first problem (NPE) may be avoided specifying explicitly the entity mode but the generated xml still cannot be added to a Configuration.
h1. Fix {{org.hibernate.boot.jaxb.hbm.internal.EntityModeConverter.toXml(EntityMode)}} should return {{entityMode.getExternalName()}} instead of {{entityMode.name()}} and handle a potentially null argument.
h1. Edit * Updated test case * provide patch for fix. |
|