From cc164e4dec9c1e1131e8c00efba70ac76b4f2751 Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Thu, 8 Aug 2019 22:34:09 -0700 Subject: [PATCH] HHH-13550 : Fix Oracle failure for test added by HHH-13424 (cherry picked from commit 6510c34e93204ef84e85a6963856fbb9e7b62e1d) --- ...ableNullNonOptionalSecondaryTableTest.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/secondarytable/JoinedTableNullNonOptionalSecondaryTableTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/secondarytable/JoinedTableNullNonOptionalSecondaryTableTest.java index c7adb703e7..5dbb0e75a5 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/secondarytable/JoinedTableNullNonOptionalSecondaryTableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/secondarytable/JoinedTableNullNonOptionalSecondaryTableTest.java @@ -49,11 +49,12 @@ public class JoinedTableNullNonOptionalSecondaryTableTest extends AbstractNonOpt assertNotNull( anEntity ); assertNull( anEntity.aDetail ); // assert that a row was inserted into Details when its property is null + final Number id = (Number) entityManager.createNativeQuery( + "select id from Details where aDetail is null" + ).getSingleResult(); assertEquals( 1, - entityManager.createNativeQuery( - "select id from Details where aDetail is null" - ).getSingleResult() + id.intValue() ); } ); @@ -73,18 +74,16 @@ public class JoinedTableNullNonOptionalSecondaryTableTest extends AbstractNonOpt assertNotNull( anEntity ); assertNull( anEntity.aDetail ); // assert that a row was inserted into Details when its property is null - assertEquals( - 1, - entityManager.createNativeQuery( - "select id from Details where aDetail is null" - ).getSingleResult() - ); + Number id = (Number) entityManager.createNativeQuery( + "select id from Details where aDetail is null" + ).getSingleResult(); + + assertEquals( 1, id.intValue() ); // assert that a row was inserted into MoreDetails when its property is null - assertEquals( 1, - entityManager.createNativeQuery( - "select id from MoreDetails where anotherDetail is null" - ).getSingleResult() - ); + id = (Number) entityManager.createNativeQuery( + "select id from MoreDetails where anotherDetail is null" + ).getSingleResult(); + assertEquals( 1,id.intValue() ); } ); }