1
+ /*
2
+ * Hibernate, Relational Persistence for Idiomatic Java
3
+ *
4
+ * License: GNU Lesser General Public License (LGPL), version 2.1 or later
5
+ * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
6
+ */
1
7
package org .hibernate .orm .test .polymorphic ;
2
8
3
9
import org .hibernate .query .spi .QueryImplementor ;
13
19
import jakarta .persistence .GeneratedValue ;
14
20
import jakarta .persistence .Id ;
15
21
22
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
23
+
16
24
@ DomainModel (
17
25
annotatedClasses = PolymorphicQueriesTest2 .Human .class
18
26
)
19
27
@ SessionFactory
20
- @ TestForIssue ( jiraKey = "HHH-15744" )
21
28
public class PolymorphicQueriesTest2 {
22
29
23
-
24
30
@ BeforeAll
25
31
public void setUp (SessionFactoryScope scope ) {
26
32
scope .inTransaction (
@@ -31,6 +37,7 @@ public void setUp(SessionFactoryScope scope) {
31
37
}
32
38
33
39
@ Test
40
+ @ TestForIssue ( jiraKey = "HHH-15744" )
34
41
public void testQuery (SessionFactoryScope scope ) {
35
42
scope .inTransaction (
36
43
session -> {
@@ -44,6 +51,17 @@ public void testQuery(SessionFactoryScope scope) {
44
51
);
45
52
}
46
53
54
+ @ Test
55
+ @ TestForIssue (jiraKey = "HHH-15850" )
56
+ public void testQueryLike (SessionFactoryScope scope ) {
57
+ scope .inTransaction ( session -> {
58
+ assertEquals ( "Fab" , session .createQuery (
59
+ "from org.hibernate.orm.test.polymorphic.PolymorphicQueriesTest2$Animal u where (u.name like ?1)" ,
60
+ Animal .class
61
+ ).setParameter ( 1 , "F%" ).getSingleResult ().getName () );
62
+ } );
63
+ }
64
+
47
65
public interface Animal {
48
66
String getName ();
49
67
}
0 commit comments