add two new tests

This commit is contained in:
Gavin 2023-05-09 14:36:57 +02:00 committed by Gavin King
parent 3da745e62b
commit 2d345fc04b
1 changed files with 32 additions and 0 deletions

View File

@ -1881,4 +1881,36 @@ public class FunctionTests {
);
}
@Test
public void testMaxGreatest(SessionFactoryScope scope) {
scope.inTransaction(
session -> {
assertEquals(10L, session.createQuery("select greatest((select max(someLong) from SimpleEntity), (select max(someInteger) from SimpleEntity))", Long.class)
.getSingleResult());
}
);
}
@Test
@SkipForDialect(dialectClass = OracleDialect.class)
@SkipForDialect(dialectClass = MariaDBDialect.class)
public void testMaxOverUnion(SessionFactoryScope scope) {
scope.inTransaction(
session -> {
assertEquals(10L, session.createQuery("select max(val) from (select someLong as val from SimpleEntity union select someInteger as val from SimpleEntity)", Long.class)
.getSingleResult());
}
);
}
@Test
@SkipForDialect(dialectClass = DerbyDialect.class)
public void testBetweenDates(SessionFactoryScope scope) {
scope.inTransaction(
session -> {
session.createSelectionQuery("select theDate from EntityOfBasics where theDate between local date and local date + 7 day").getResultList();
}
);
}
}