From a08716b67b5b0cc5533bd35c84e2ece9c28583e1 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Fri, 23 Sep 2022 11:21:08 +0200 Subject: [PATCH] HHH-15045 + HHH-15235 onFlushDirty() invoked on parent entity in a @OneToOne relationship when no table columns are changed - PropertyAccessException on merging Bidirectional OneToOne with EmbeddedId - Reverted HHH-14216 --- .../src/main/java/org/hibernate/type/OneToOneType.java | 2 +- .../hibernate/orm/test/annotations/onetoone/EmbeddedIdTest.java | 1 - .../org/hibernate/orm/test/onetoone/flush/DirtyFlushTest.java | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/type/OneToOneType.java b/hibernate-core/src/main/java/org/hibernate/type/OneToOneType.java index d67390a72b..ade60bda4b 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/OneToOneType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/OneToOneType.java @@ -142,7 +142,7 @@ public class OneToOneType extends EntityType { @Override public Object assemble(Serializable oid, SharedSessionContractImplementor session, Object owner) throws HibernateException { //this should be a call to resolve(), not resolveIdentifier(), - //'cos it might be a property-ref, and we did not cache the + //because it might be a property-ref, and we did not cache the //referenced value return resolve( session.getContextEntityIdentifier(owner), session, owner ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/onetoone/EmbeddedIdTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/onetoone/EmbeddedIdTest.java index 247d9a88ca..89f1e03bad 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/onetoone/EmbeddedIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/onetoone/EmbeddedIdTest.java @@ -48,7 +48,6 @@ public class EmbeddedIdTest { foo.bar = bar; bar.foo = foo; session.merge( foo ); - session.flush(); } ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/onetoone/flush/DirtyFlushTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/onetoone/flush/DirtyFlushTest.java index 9ab5193978..2bb5698f6e 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/onetoone/flush/DirtyFlushTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/onetoone/flush/DirtyFlushTest.java @@ -59,7 +59,6 @@ public class DirtyFlushTest { user.profile = profile; em.persist( profile ); - em.flush(); } ); scope.inTransaction( em -> {