File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
hibernate-core/src/test/java/org/hibernate/orm/test/query/hql Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1354,6 +1354,26 @@ public void testIntervalScaleExpressions(SessionFactoryScope scope) {
13541354 );
13551355 }
13561356
1357+ @ Test
1358+ public void testAddDurationWithParameter (SessionFactoryScope scope ) {
1359+ scope .inTransaction (
1360+ session -> {
1361+ session .createQuery ("select 2 * cast(?1 as BigDecimal)" )
1362+ .setParameter (1 , BigDecimal .valueOf (123.446 ))
1363+ .getSingleResult ();
1364+ session .createQuery ("select 2 * cast(?1 as BigDecimal(7,4))" )
1365+ .setParameter (1 , BigDecimal .valueOf (123.446 ))
1366+ .getSingleResult ();
1367+ session .createQuery ("select cast(2 as BigDecimal) * ?1" )
1368+ .setParameter (1 , BigDecimal .valueOf (123.446 ))
1369+ .getSingleResult ();
1370+ session .createQuery ("select cast(:dt as LocalDateTime) + 1 day" )
1371+ .setParameter ("dt" , LocalDateTime .now ())
1372+ .getSingleResult ();
1373+ }
1374+ );
1375+ }
1376+
13571377 @ Test
13581378 public void testInstantCast (SessionFactoryScope scope ) {
13591379 scope .inTransaction (
You can’t perform that action at this time.
0 commit comments