test for adding duration to a LocalTime
Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
parent
37018d2570
commit
14216fc267
|
@ -1760,10 +1760,18 @@ public class FunctionTests {
|
|||
assertEquals( 10L*60,
|
||||
session.createQuery("select (datetime 1974-03-23 5:30:25 - datetime 1974-03-23 5:20:25) by second", Long.class)
|
||||
.getSingleResult() );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTimeDurationArithmeticWithLiterals(SessionFactoryScope scope) {
|
||||
scope.inTransaction(
|
||||
session -> {
|
||||
// timestampadd() might not work for time on at least some dbs:
|
||||
// assertEquals( LocalTime.of(5,30,25),
|
||||
// session.createQuery("select time 5:30:46 - 21 second")
|
||||
// .getSingleResult() );
|
||||
assertEquals( LocalTime.of(5,30,25),
|
||||
session.createQuery("select time 5:30:46 - 21 second")
|
||||
.getSingleResult() );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue