From 2f293ed46cdf350b32dcf5f722abefa6c91b37aa Mon Sep 17 00:00:00 2001 From: Brett Meyer Date: Tue, 4 Mar 2014 17:19:03 -0500 Subject: [PATCH] HHH-7072 correcting test failure --- .../embeddables/withcustomenumdef/TestBasicOps.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/embeddables/withcustomenumdef/TestBasicOps.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/embeddables/withcustomenumdef/TestBasicOps.java index b7733dc261..a34112cc1a 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/embeddables/withcustomenumdef/TestBasicOps.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/embeddables/withcustomenumdef/TestBasicOps.java @@ -45,13 +45,14 @@ public class TestBasicOps extends BaseCoreFunctionalTestCase { public void testLoadAndStore() { Session s = openSession(); s.beginTransaction(); - s.save( new Query( new Location( "first", Location.Type.COUNTY ) ) ); + Query q = new Query( new Location( "first", Location.Type.COUNTY ) ); + s.save( q ); s.getTransaction().commit(); s.close(); s = openSession(); s.beginTransaction(); - Query q = (Query) s.get( Query.class, 1L ); + q = (Query) s.get( Query.class, q.getId() ); assertEquals( 1, q.getIncludedLocations().size() ); Location l = q.getIncludedLocations().iterator().next(); assertEquals( Location.Type.COUNTY, l.getType() ); @@ -93,6 +94,7 @@ public class TestBasicOps extends BaseCoreFunctionalTestCase { s.beginTransaction(); q = (Query) s.get( Query.class, q.getId() ); assertEquals( 1, q.getIncludedLocations().size() ); + s.delete( q ); s.getTransaction().commit(); s.close(); }