HHH-16966 Test reproducing the issue

This commit is contained in:
gtoison 2023-07-21 13:19:56 +02:00 committed by Andrea Boriero
parent bde1034aee
commit 87096e5a0a
1 changed files with 13 additions and 0 deletions

View File

@ -56,9 +56,11 @@ public class BatchEntityWithDisabledProxyTest {
cheese1.setBestCheese( cheese1 );
cheese2.setBestCheese( cheese1 );
cheese3.setBestCheese( cheese1 );
cheese1.setReplacement( cheese2 );
cheese2.setReplacement( cheese1 );
cheese3.setReplacement( cheese1 );
scope.inTransaction( s -> {
s.persist( cheese1 );
@ -95,6 +97,17 @@ public class BatchEntityWithDisabledProxyTest {
} );
}
@Test
@JiraKey("HHH-16966")
public void testGetReference(SessionFactoryScope scope) {
scope.inSession( s -> {
s.getSessionFactory().getCache().evictAllRegions();
Product product = s.getReference( Product.class, 3 );
assertTrue( Hibernate.isInitialized(product) );
} );
}
@Entity(name = "Order")
@Table(name = "ORDER_TABLE")
public static class Order {