From cb51b1e83800558ab781f0908785d19231cef578 Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Fri, 9 Aug 2019 17:28:42 -0700 Subject: [PATCH] HH-13550 : Fix Oracle failure for test added by HHH-13424 --- ...ableNullNonOptionalSecondaryTableTest.java | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/secondarytable/SingleTableNullNonOptionalSecondaryTableTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/secondarytable/SingleTableNullNonOptionalSecondaryTableTest.java index 8b3d73cc1c..13bceb4535 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/secondarytable/SingleTableNullNonOptionalSecondaryTableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/secondarytable/SingleTableNullNonOptionalSecondaryTableTest.java @@ -47,12 +47,10 @@ public class SingleTableNullNonOptionalSecondaryTableTest 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() - ); + final Number id = (Number) entityManager.createNativeQuery( + "select id from Details where aDetail is null" + ).getSingleResult(); + assertEquals( 1, id.intValue() ); } ); } @@ -71,18 +69,15 @@ public class SingleTableNullNonOptionalSecondaryTableTest 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() ); } ); }