reenable some LiteralTests

This commit is contained in:
Gavin King 2022-01-01 22:27:29 +01:00
parent f9afab5492
commit df72d7db3d
1 changed files with 5 additions and 15 deletions

View File

@ -126,8 +126,6 @@ public class LiteralTests {
session -> { session -> {
session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00'}" ) session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00'}" )
.list(); .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" ) session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00" )
.list(); .list();
} }
@ -141,10 +139,6 @@ public class LiteralTests {
session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00+05:00'}" ) session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00+05:00'}" )
.list(); .list();
// session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00+05'}" ) // 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(); // .list();
session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00+05:00" ) session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00+05:00" )
.list(); .list();
@ -153,8 +147,8 @@ public class LiteralTests {
session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00 GMT'}" ) session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00 GMT'}" )
.list(); .list();
// session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime '2018-01-01 12:30:00 GMT'" ) session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00 GMT" )
// .list(); .list();
session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00 'GMT'" ) session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00 'GMT'" )
.list(); .list();
} }
@ -167,8 +161,8 @@ public class LiteralTests {
session -> { session -> {
session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00 US/Pacific'}" ) session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = {ts '2018-01-01T12:30:00 US/Pacific'}" )
.list(); .list();
// session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime '2018-01-01 12:30:00 US/Pacific'" ) session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00 US/Pacific" )
// .list(); .list();
session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00 'US/Pacific'" ) session.createQuery( "from EntityOfBasics e1 where e1.theTimestamp = datetime 2018-01-01 12:30:00 'US/Pacific'" )
.list(); .list();
} }
@ -180,7 +174,6 @@ public class LiteralTests {
scope.inTransaction( scope.inTransaction(
session -> { session -> {
session.createQuery( "from EntityOfBasics e1 where e1.theDate = {d '2018-01-01'}" ).list(); 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(); session.createQuery( "from EntityOfBasics e1 where e1.theDate = date 2018-01-01" ).list();
} }
); );
@ -191,9 +184,6 @@ public class LiteralTests {
scope.inTransaction( scope.inTransaction(
session -> { session -> {
session.createQuery( "from EntityOfBasics e1 where e1.theTime = {t '12:30:00'}" ).list(); 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" ).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" ).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:00.123" ).list();
@ -232,7 +222,7 @@ public class LiteralTests {
assertThat( session.createQuery( "select 10000000000000000bi" ) assertThat( session.createQuery( "select 10000000000000000bi" )
.getSingleResult(), is( BigInteger.valueOf(10000000000000000L) ) ); .getSingleResult(), is( BigInteger.valueOf(10000000000000000L) ) );
assertThat( session.createQuery( "select 9999999999999.9999bd" ) assertThat( session.createQuery( "select 9999999999999.9999bd" )
.getSingleResult(), is( BigDecimal.valueOf(99999999999999999L, 4) ) );; .getSingleResult(), is( BigDecimal.valueOf(99999999999999999L, 4) ) );
} }
); );
} }