[Hibernate-JIRA] Created: (HHH-2326) NullPointerException from merge on composite id
by Greg Adams (JIRA)
NullPointerException from merge on composite id
-----------------------------------------------
Key: HHH-2326
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2326
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.1
Environment: Hibernate 3.2.1ga, tested against Oracle 10g and Derby
Reporter: Greg Adams
Priority: Critical
Attachments: HibernateMergeBug.zip
Merge is throwing an NPE from the bowels of Hibernate when I have a class mapped with a composite ID.
Stacktrace:
[junit] java.lang.NullPointerException
[junit] at org.hibernate.type.AbstractType.getHashCode(AbstractType.java:112)
[junit] at org.hibernate.type.AbstractType.getHashCode(AbstractType.java:120)
[junit] at org.hibernate.type.EntityType.getHashCode(EntityType.java:279)
[junit] at org.hibernate.type.ComponentType.getHashCode(ComponentType.java:189)
[junit] at org.hibernate.engine.EntityKey.generateHashCode(EntityKey.java:104)
[junit] at org.hibernate.engine.EntityKey.<init>(EntityKey.java:48)
[junit] at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:100)
[junit] at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:687)
[junit] at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:669)
[junit] at org.hibernate.engine.CascadingAction$6.cascade(CascadingAction.java:245)
[junit] at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
[junit] at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
[junit] at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
[junit] at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
[junit] at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
[junit] at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
[junit] at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
[junit] at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
[junit] at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:437)
[junit] at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:194)
[junit] at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:123)
[junit] at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:53)
[junit] at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:677)
[junit] at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:661)
[junit] at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:665)
[junit] at com.foo.test.HibernateTest.doMerge(Unknown Source)
[junit] at com.foo.test.HibernateTest.testInsert(Unknown Source)
[junit] at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
[junit] at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
[junit] at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
[junit] at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
[junit] at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
[junit] at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
[junit] at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
[junit] at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
[junit] at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
[junit] at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
[junit] at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:32)
I've attached a zipped-up project that reproduces the error. Just extract and run ant.
--
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
15 years, 2 months