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

Hibernate JIRA | Koen Serneels | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  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

    error scanning filmography for will smith wiyh allocine - change status updated

    GitHub | 3 years ago | jluc2808
    org.springframework.dao.DataIntegrityViolationException: not-null property references a null or transient value: org.yamj.core.database.model.FilmParticipation.jobType; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value: org.yamj.core.database.model.FilmParticipation.jobType
  6. 0

    ERROR with filmography

    GitHub | 2 years ago | jluc2808
    org.springframework.dao.DataIntegrityViolationException: not-null property references a null or transient value: org.yamj.core.database.model.FilmParticipation.jobType; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value: org.yamj.core.database.model.FilmParticipation.jobType

    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