org.springframework.orm.hibernate3.HibernateSystemException: not-null property references a null or transient value: org.hibernate.jiratest.CreditCard.contact.mi; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value: org.hibernate.jiratest.CreditCard.contact.mi org.hibernate.PropertyValueException: not-null property references a null or transient value: org.hibernate.jiratest.CreditCard.contact.mi

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Originally posted on the forums: http://forum.hibernate.org/viewtopic.php?t=955445 Created a "simple" test case. (Are dao tests ever really simple?) Have a simple CreditCard, has a Contact, which has an Address. contact first and lastname are @NotNull. contact.mi and address.address2 are both optional fields. TestDaoHibernateJira.java sets up the object chain with all properties populated. The validator runs and asserts no invalidValues. The test case then sets mi and address2 to null. The validator is run again, and asserts no invalidValues. hibernate's saveOrUpdate(creditCard) method is called via the dao. When run, first hibernate reads the next creditcard id from the sequence. Then we get: org.springframework.orm.hibernate3.HibernateSystemException: not-null property references a null or transient value: org.hibernate.jiratest.CreditCard.contact.mi; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value: org.hibernate.jiratest.CreditCard.contact.mi org.hibernate.PropertyValueException: not-null property references a null or transient value: org.hibernate.jiratest.CreditCard.contact.mi at org.hibernate.engine.Nullability.checkNullability(Nullability.java:84) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:265) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:114) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:98) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:529) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:521) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:517) at org.springframework.orm.hibernate3.HibernateTemplate$18.doInHibernate(HibernateTemplate.java:690) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:365) at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:687) at com.viz.web.persistence.hibernate.BaseDaoHibernate.save(BaseDaoHibernate.java:121) at org.hibernate.jiratest.TestDaoHibernateJira.testValidatorAndSave(TestDaoHibernateJira.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)
    via by Ted Bergeron,
    • org.springframework.orm.hibernate3.HibernateSystemException: not-null property references a null or transient value: org.hibernate.jiratest.CreditCard.contact.mi; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value: org.hibernate.jiratest.CreditCard.contact.mi org.hibernate.PropertyValueException: not-null property references a null or transient value: org.hibernate.jiratest.CreditCard.contact.mi at org.hibernate.engine.Nullability.checkNullability(Nullability.java:84) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:265) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:114) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:98) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:529) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:521) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:517) at org.springframework.orm.hibernate3.HibernateTemplate$18.doInHibernate(HibernateTemplate.java:690) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:365) at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:687) at com.viz.web.persistence.hibernate.BaseDaoHibernate.save(BaseDaoHibernate.java:121) at org.hibernate.jiratest.TestDaoHibernateJira.testValidatorAndSave(TestDaoHibernateJira.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)
    No Bugmate found.