Improve test for function parameter binding

This commit is contained in:
gavinking 2020-02-01 12:26:06 +01:00
parent c41c6aaf7d
commit 558e757a33
1 changed files with 11 additions and 2 deletions

View File

@ -268,11 +268,20 @@ public class FunctionTests extends SessionFactoryBasedFunctionalTest {
public void testOverlayFunctionParameters(SessionFactoryScope scope) {
scope.inTransaction(
session -> {
session.createQuery("select overlay(?2 placing ?1 from 3) from EntityOfBasics")
session.createQuery("select overlay(?1 placing 'yy' from 3)")
.setParameter(1, "xxxxxx")
.list();
session.createQuery("select overlay('xxxxxx' placing ?1 from 3)")
.setParameter(1, "yy")
.list();
session.createQuery("select overlay('xxxxxx' placing 'yy' from ?1)")
.setParameter(1, 3)
.list();
session.createQuery("select overlay(?2 placing ?1 from 3)")
.setParameter(1, "yy")
.setParameter(2, "xxxxxx")
.list();
session.createQuery("select overlay(:text placing :rep from 3) from EntityOfBasics")
session.createQuery("select overlay(:text placing :rep from 3)")
.setParameter("rep", "yy")
.setParameter("text", "xxxxxx")
.list();