HHH-16966 Test reproducing the issue
This commit is contained in:
parent
7d9621c8d9
commit
8805f8e933
|
@ -56,9 +56,11 @@ public class BatchEntityWithDisabledProxyTest {
|
||||||
|
|
||||||
cheese1.setBestCheese( cheese1 );
|
cheese1.setBestCheese( cheese1 );
|
||||||
cheese2.setBestCheese( cheese1 );
|
cheese2.setBestCheese( cheese1 );
|
||||||
|
cheese3.setBestCheese( cheese1 );
|
||||||
|
|
||||||
cheese1.setReplacement( cheese2 );
|
cheese1.setReplacement( cheese2 );
|
||||||
cheese2.setReplacement( cheese1 );
|
cheese2.setReplacement( cheese1 );
|
||||||
|
cheese3.setReplacement( cheese1 );
|
||||||
|
|
||||||
scope.inTransaction( s -> {
|
scope.inTransaction( s -> {
|
||||||
s.persist( cheese1 );
|
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")
|
@Entity(name = "Order")
|
||||||
@Table(name = "ORDER_TABLE")
|
@Table(name = "ORDER_TABLE")
|
||||||
public static class Order {
|
public static class Order {
|
||||||
|
|
Loading…
Reference in New Issue