org.hibernate.PropertyValueException: not-null property references a null or transient value : Child.component.parent

Hibernate JIRA | Koen Serneels | 2 years ago
  1. 0

    Hi. After upgrading from Hibernate 4.1.3 to 4.3.9 we are getting some weird nullability issues with bidirectional one-to-many associations in a component. For a working test case see attached ZIP. The problem seems to be introduced between 4.1.10.Final and 4.1.11.Final -> works with 4.1.10.Final and below but doesn't work as of 4.1.11.Final or above. Explanation: Parent has a bidirectional one-to-many to Child and Child has a second many-to-one to Parent. The bidirectional one-to-many is managed from the Parent side, the Child side is the inverse side. The unidirectional association to Parent is managed by Child. Parent: {code:xml} <bag name="children" cascade="all-delete-orphan"> <key column="parent_id" not-null="true" update="false" /> <one-to-many entity-name="Child" /> </bag> {code} Child: {code:xml} <component class="be.SomeComponent" name="component"> <many-to-one name="parent" column="parent_id" not-null="true" insert="false" update="false" lazy="false"/> <many-to-one name="nextParent" column="next_parent_id" not-null="true" update="false" lazy="false"/> </component> {code} When running the test case: {noformat} org.hibernate.PropertyValueException: not-null property references a null or transient value : Child.component.parent at org.hibernate.engine.internal.Nullability.checkNullability(Nullability.java:117) {noformat} At this stage no queries have been flushed to the database. When the component is removed and the associations mapped directly in Child: {code:xml} <many-to-one name="parent" column="parent_id" not-null="true" insert="false" update="false" lazy="false"/> <many-to-one name="nextParent" column="next_parent_id" not-null="true" update="false" lazy="false"/> {code} The test case works without any problem.

    Hibernate JIRA | 2 years ago | Koen Serneels
    org.hibernate.PropertyValueException: not-null property references a null or transient value : Child.component.parent
  2. 0

    Hi. After upgrading from Hibernate 4.1.3 to 4.3.9 we are getting some weird nullability issues with bidirectional one-to-many associations in a component. For a working test case see attached ZIP. The problem seems to be introduced between 4.1.10.Final and 4.1.11.Final -> works with 4.1.10.Final and below but doesn't work as of 4.1.11.Final or above. Explanation: Parent has a bidirectional one-to-many to Child and Child has a second many-to-one to Parent. The bidirectional one-to-many is managed from the Parent side, the Child side is the inverse side. The unidirectional association to Parent is managed by Child. Parent: {code:xml} <bag name="children" cascade="all-delete-orphan"> <key column="parent_id" not-null="true" update="false" /> <one-to-many entity-name="Child" /> </bag> {code} Child: {code:xml} <component class="be.SomeComponent" name="component"> <many-to-one name="parent" column="parent_id" not-null="true" insert="false" update="false" lazy="false"/> <many-to-one name="nextParent" column="next_parent_id" not-null="true" update="false" lazy="false"/> </component> {code} When running the test case: {noformat} org.hibernate.PropertyValueException: not-null property references a null or transient value : Child.component.parent at org.hibernate.engine.internal.Nullability.checkNullability(Nullability.java:117) {noformat} At this stage no queries have been flushed to the database. When the component is removed and the associations mapped directly in Child: {code:xml} <many-to-one name="parent" column="parent_id" not-null="true" insert="false" update="false" lazy="false"/> <many-to-one name="nextParent" column="next_parent_id" not-null="true" update="false" lazy="false"/> {code} The test case works without any problem.

    Hibernate JIRA | 2 years ago | Koen Serneels
    org.hibernate.PropertyValueException: not-null property references a null or transient value : Child.component.parent
  3. 0

    Exception in thread "main" org.hibernate.PropertyValueException: not-null property references a null or transient value

    Stack Overflow | 3 years ago | Tarun Bhatt
    org.hibernate.PropertyValueException: not-null property references a null or transient value : Address.user
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate exception org.hibernate.PropertyValueException: not-null property references a null or transient value

    Stack Overflow | 2 years ago
    org.hibernate.PropertyValueException: not-null property references a null or transient value : com.sample.Answer.question
  6. 0

    Hibernate常见错误 —核心网络

    netfoucs.com | 9 months ago
    org.hibernate.PropertyValueException: not-null property references a null or transient value: com.xxx.yyy.company

    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 : Child.component.parent

      at org.hibernate.engine.internal.Nullability.checkNullability()
    2. Hibernate
      Nullability.checkNullability
      1. org.hibernate.engine.internal.Nullability.checkNullability(Nullability.java:117)
      1 frame