HHH-15745 Add test for issue
This commit is contained in:
parent
c105c34976
commit
1109dfbb1c
|
@ -2,6 +2,7 @@ package org.hibernate.orm.test.query.hql;
|
|||
|
||||
import org.hibernate.query.SemanticException;
|
||||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.orm.junit.DomainModel;
|
||||
import org.hibernate.testing.orm.junit.SessionFactory;
|
||||
import org.hibernate.testing.orm.junit.SessionFactoryScope;
|
||||
|
@ -53,6 +54,24 @@ public class LikeEscapeParameterTest {
|
|||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue(jiraKey = "HHH-15745")
|
||||
public void testStringLiteralInSubQuery(SessionFactoryScope scope) {
|
||||
scope.inTransaction(
|
||||
session -> {
|
||||
session.createQuery(
|
||||
"select s from TestEntity s where s.name like ?1 escape '\\'" +
|
||||
" or s in (" +
|
||||
" select distinct t.id from TestEntity t where t.name like ?2 escape '\\'" +
|
||||
" )",
|
||||
TestEntity.class
|
||||
)
|
||||
.setParameter( 1, "%Foo" )
|
||||
.setParameter( 2, "Bar%" );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidStringLiteral(SessionFactoryScope scope) {
|
||||
scope.inTransaction(
|
||||
|
|
Loading…
Reference in New Issue