org.hibernate.PropertyValueException: not-null property references a null or transient value: com.j2fe.workflow.definition.Transition.target

Hibernate JIRA | Michael Kopp | 1 decade ago
  1. 0

    The attached Mappings worked perfectly in HB 3.0.5, in 3.1 the save throws org.hibernate.PropertyValueException org.hibernate.PropertyValueException: not-null property references a null or transient value: com.j2fe.workflow.definition.Transition.target I even debugged it and the enity given to org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate (a transition object) contains an object in the 'target'. I have to add that the object in 'target' already contains a generated ID, which means it was already saved. The values array given to the org.hibernate.engine.Nullability.checkNullability does not contain it, which is the cause of the exception, the question is why it was nulled!! the Transition bascically contains a 'source' and a 'target' Node. and a Node contains sets of Target Transitions and Source Transitions. This is a network of objects!! Please Remember that these mappings worked in 3.0.5, I only have this problem after switching to 3.1. I even tried to set cascade to all on every single relation i have in the model and it still produced that error. org.hibernate.PropertyValueException: not-null property references a null or transient value: com.j2fe.workflow.definition.Transition.target at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72) 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:531) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:523) at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:134) I will attach the full stacktrace in a file as it is rather big.

    Hibernate JIRA | 1 decade ago | Michael Kopp
    org.hibernate.PropertyValueException: not-null property references a null or transient value: com.j2fe.workflow.definition.Transition.target
  2. 0

    The attached Mappings worked perfectly in HB 3.0.5, in 3.1 the save throws org.hibernate.PropertyValueException org.hibernate.PropertyValueException: not-null property references a null or transient value: com.j2fe.workflow.definition.Transition.target I even debugged it and the enity given to org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate (a transition object) contains an object in the 'target'. I have to add that the object in 'target' already contains a generated ID, which means it was already saved. The values array given to the org.hibernate.engine.Nullability.checkNullability does not contain it, which is the cause of the exception, the question is why it was nulled!! the Transition bascically contains a 'source' and a 'target' Node. and a Node contains sets of Target Transitions and Source Transitions. This is a network of objects!! Please Remember that these mappings worked in 3.0.5, I only have this problem after switching to 3.1. I even tried to set cascade to all on every single relation i have in the model and it still produced that error. org.hibernate.PropertyValueException: not-null property references a null or transient value: com.j2fe.workflow.definition.Transition.target at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72) 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:531) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:523) at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:134) I will attach the full stacktrace in a file as it is rather big.

    Hibernate JIRA | 1 decade ago | Michael Kopp
    org.hibernate.PropertyValueException: not-null property references a null or transient value: com.j2fe.workflow.definition.Transition.target
  3. 0

    Problem with bi-directional @OneToOne

    Stack Overflow | 6 years ago | Subhendu Mahanta
    org.hibernate.PropertyValueException: not-null property references a null or transient value: com.hibernaterecipes.chapter5.Address.customer
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate One To Many Problem

    Stack Overflow | 6 years ago | Noor
    org.hibernate.PropertyValueException: not-null property references a null or transient value: com.BiddingSystem.domain.Phone.student
  6. 0

    Expecting database exceptions with JUnit, Spring and HIbernate

    Stack Overflow | 3 years ago | makcro
    java.lang.Exception: Unexpected exception, expected<org.springframework.dao.DataIntegrityViolationException> but was<org.hibernate.PropertyValueException>

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.PropertyValueException

      not-null property references a null or transient value: com.j2fe.workflow.definition.Transition.target

      at org.hibernate.engine.Nullability.checkNullability()
    2. Hibernate
      Nullability.checkNullability
      1. org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)
      1 frame
    3. Hibernate
      SessionImpl.saveOrUpdate
      1. org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:265)
      2. org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
      3. org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:114)
      4. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
      5. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
      6. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:98)
      7. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
      8. org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:531)
      9. org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:523)
      9 frames
    4. Hibernate
      CascadingAction$1.cascade
      1. org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:134)
      1 frame