[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-796?page=co...
]
manav chauhan commented on HHH-796:
-----------------------------------
Still an issue in 3.2.5.
Hibernate fails to determine identifier of association inside
composite-element in EntityMode.DOM4J when declared with embed-xml="false"
----------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-796
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-796
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.0.5
Environment: Hibernate 3.0.5; Windows; MySQL 4.1
Reporter: Vladimir Demochko
Fix For: entity-modes
Attachments: TestBug.zip
Having the following mapping declaration:
<class name="Parent">
<id name="id"/>
<property name="label"/>
<bag name="associations" table="ASSOCIATION"
cascade="all">
<key column="PARENT_ID"/>
<composite-element class="Association"
node="associations">
<parent name="parent"/>
<many-to-one name="child" class="Child"
column="CHILD_ID" node="child" embed-xml="false"/>
<property name="info" column="INFO"
type="string"/>
</composite-element>
</bag>
</class>
<class name="Child">
<id name="id"/>
<property name="info"/>
</class>
Hibernate fails with NullPointerException while constructing Parent/assosiations/child
element (in fact while getting an identifier of a Child object) in EntityMode.DOM4J:
java.lang.NullPointerException
at org.hibernate.type.EntityType.getIdentifierType(EntityType.java:227)
at org.hibernate.type.EntityType.setToXMLNode(EntityType.java:417)
at org.hibernate.property.Dom4jAccessor$ElementSetter.set(Dom4jAccessor.java:307)
at
org.hibernate.tuple.AbstractComponentTuplizer.setPropertyValues(AbstractComponentTuplizer.java:80)
at org.hibernate.type.ComponentType.setPropertyValues(ComponentType.java:262)
at org.hibernate.type.ComponentType.resolve(ComponentType.java:446)
at org.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:182)
at
org.hibernate.persister.collection.AbstractCollectionPersister.readElement(AbstractCollectionPersister.java:612)
at
org.hibernate.collection.PersistentElementHolder.readFrom(PersistentElementHolder.java:97)
at org.hibernate.loader.Loader.readCollectionElement(Loader.java:645)
at org.hibernate.loader.Loader.readCollectionElements(Loader.java:355)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:306)
at org.hibernate.loader.Loader.doQuery(Loader.java:395)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1401)
at
org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:107)
at
org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:483)
at
org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1422)
at org.hibernate.type.CollectionType.getCollection(CollectionType.java:474)
at org.hibernate.type.CollectionType.resolveKey(CollectionType.java:332)
at org.hibernate.type.CollectionType.resolve(CollectionType.java:326)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:105)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:510)
at org.hibernate.loader.Loader.doQuery(Loader.java:419)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1312)
at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:116)
at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:101)
at
org.hibernate.persister.entity.BasicEntityPersister.load(BasicEntityPersister.java:2461)
at
org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:350)
at
org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:331)
at
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:113)
at
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:151)
at
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:617)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:610)
at TestBug.main(TestBug.java:21)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira