Issues
- Nullability issues when having many-to-one associations inside a componentHHH-9778
- Cascading inserts are failing after upgradeHHH-9513
- Cascading inserts are failing after upgradeHHH-9325Resolved issue: HHH-9325Former user
- Preapred statement token (?) not gererated for JPA Criteria API when they are Longs or IntsHHH-8513Resolved issue: HHH-8513
- Schema update is broken when using multiple schemas with sequencesHHH-8348Resolved issue: HHH-8348
- ObjectNotFoundException on session.get()HHH-8274Resolved issue: HHH-8274
- Example works under Java 1.6 but under Java 1.7 JVM usually hangs while holding table metadata lockHHH-8202Resolved issue: HHH-8202
- Adding @NotNull to a @ManyToOne association with @JoinColumnsOrFormulas leads to ClassCastExceptionHHH-8167Resolved issue: HHH-8167Steve Ebersole
- A way for persisting revision data manually by calling AuditProcess.getCurrentRevisionData(session, persist)HHH-8165Resolved issue: HHH-8165
- Property with @Id and @GeneratedValue(strategy=IDENTITY) brokes @NaturalIdCacheHHH-8158Resolved issue: HHH-8158
- Class mismatch when reattaching object with natural-id in shared cacheHHH-8154Resolved issue: HHH-8154
- Envers delete doesn't insert a new row with revtype=2 for unidirectional manytomany collectionsHHH-8087Resolved issue: HHH-8087Lukasz Antoniak
Nullability issues when having many-to-one associations inside a component
Description
Attachments
Details
Assignee
UnassignedUnassignedReporter
Koen SerneelsKoen SerneelsLabels
Components
Priority
Major
Details
Details
Assignee
Reporter
Labels
Components
Priority
Activity
Koen SerneelsNovember 18, 2015 at 11:55 AM
Hi. This is still an issue with H5.0.3. I have bumped the libraries in the updated test case (see hibernate-nullability-H5.zip) nothing else changed. To summarize, when having a bi-directional one-to-many association, Hibernate complains when setting the inverse side (in this example the many side) to not-null. This problem only occurs when putting the relation it in a component. Without the component it works as expected, so this must be a bug.
Steve EbersoleOctober 28, 2015 at 3:25 AM
As part of verifying that this issue affects 5.0, please just set the "Affects version". Leave the "verify-affects-5.0" label and leave the issue in "Awaiting Response" status; these are critical for us to be able to track these verifications and triage them. Thanks.
Steve EbersoleOctober 27, 2015 at 7:17 PM
This bug report does not indicate that the reported issue affects version 5.x. Versions prior to 5.x are no longer maintained. It would be a great help to the Hibernate team and community for someone to verify that the reported issue still affects version 5.x. If so, please add the 5.x version that you verified with to the list of affected-versions and attach the (preferably SSCCE) test case you used to do the verification to the report; from there the issues will be looked at during our triage meetings.
For details, see http://in.relation.to/2015/10/27/great-jira-cleanup-2015/
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:
<bag name="children" cascade="all-delete-orphan"> <key column="parent_id" not-null="true" update="false" /> <one-to-many entity-name="Child" /> </bag>
Child:
<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>
When running the test case:
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)
At this stage no queries have been flushed to the database.
When the component is removed and the associations mapped directly in Child:
<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"/>
The test case works without any problem.