fix a test which was failing on h2 version 1.x

This commit is contained in:
Gavin King 2023-07-13 18:17:09 +02:00
parent e125a818e3
commit 5a07e2b61d
1 changed files with 5 additions and 1 deletions

View File

@ -60,8 +60,12 @@ public class StringArrayContributorTests {
@Test
public void testAsQueryParameter(SessionFactoryScope scope) {
scope.getSessionFactory().getQueryEngine()
.getSqmFunctionRegistry()
.registerNamed("array_contains",
scope.getSessionFactory().getTypeConfiguration().standardBasicTypeForJavaType(Boolean.class));
scope.inTransaction( (session) -> {
session.createQuery( "select p from Post p where array_contains(:arr, p.title) = true" )
session.createQuery( "select p from Post p where array_contains(:arr, p.title) = true" )
.setParameter( "arr", Arrays.array( "a", "b" ) )
.list();
} );