From df72d7db3dac21ae12384513e1d44d73c3a1ea79 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Sat, 1 Jan 2022 22:27:29 +0100 Subject: [PATCH] reenable some LiteralTests --- .../orm/test/query/hql/LiteralTests.java | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/LiteralTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/LiteralTests.java index 03408be9f6..644dbb3c5d 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/LiteralTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/LiteralTests.java @@ -126,8 +126,6 @@ public class LiteralTests { session -> { session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00'}" ) .list(); -// session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime '2018-01-01 12:30:00'" ) -// .list(); session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00" ) .list(); } @@ -141,10 +139,6 @@ public class LiteralTests { session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00+05:00'}" ) .list(); // session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00+05'}" ) -// .list(); -// session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime '2018-01-01 12:30:00+05:00'" ) -// .list(); -// session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime '2018-01-01 12:30:00+05'" ) // .list(); session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00+05:00" ) .list(); @@ -153,8 +147,8 @@ public class LiteralTests { session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00 GMT'}" ) .list(); -// session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime '2018-01-01 12:30:00 GMT'" ) -// .list(); + session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00 GMT" ) + .list(); session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00 'GMT'" ) .list(); } @@ -167,8 +161,8 @@ public class LiteralTests { session -> { session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00 US/Pacific'}" ) .list(); -// session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime '2018-01-01 12:30:00 US/Pacific'" ) -// .list(); + session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00 US/Pacific" ) + .list(); session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00 'US/Pacific'" ) .list(); } @@ -180,7 +174,6 @@ public class LiteralTests { scope.inTransaction( session -> { session.createQuery( "from EntityOfBasics e1 where e1.theDate = {d '2018-01-01'}" ).list(); -// session.createQuery( "from EntityOfBasics e1 where e1.theDate = date '2018-01-01'" ).list(); session.createQuery( "from EntityOfBasics e1 where e1.theDate = date 2018-01-01" ).list(); } ); @@ -191,9 +184,6 @@ public class LiteralTests { scope.inTransaction( session -> { session.createQuery( "from EntityOfBasics e1 where e1.theTime = {t '12:30:00'}" ).list(); -// session.createQuery( "from EntityOfBasics e1 where e1.theTime = time '12:30'" ).list(); -// session.createQuery( "from EntityOfBasics e1 where e1.theTime = time '12:30:00'" ).list(); -// session.createQuery( "from EntityOfBasics e1 where e1.theTime = time '12:30:00.123'" ).list(); session.createQuery( "from EntityOfBasics e1 where e1.theTime = time 12:30" ).list(); session.createQuery( "from EntityOfBasics e1 where e1.theTime = time 12:30:00" ).list(); session.createQuery( "from EntityOfBasics e1 where e1.theTime = time 12:30:00.123" ).list(); @@ -232,7 +222,7 @@ public class LiteralTests { assertThat( session.createQuery( "select 10000000000000000bi" ) .getSingleResult(), is( BigInteger.valueOf(10000000000000000L) ) ); assertThat( session.createQuery( "select 9999999999999.9999bd" ) - .getSingleResult(), is( BigDecimal.valueOf(99999999999999999L, 4) ) );; + .getSingleResult(), is( BigDecimal.valueOf(99999999999999999L, 4) ) ); } ); }