Skip to content

Commit 061fb1e

Browse files
mbelladebeikov
authored andcommitted
HHH-15850 Add test for issue
1 parent ce2dc47 commit 061fb1e

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/polymorphic/PolymorphicQueriesTest2.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
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+
*/
17
package org.hibernate.orm.test.polymorphic;
28

39
import org.hibernate.query.spi.QueryImplementor;
@@ -13,14 +19,14 @@
1319
import jakarta.persistence.GeneratedValue;
1420
import jakarta.persistence.Id;
1521

22+
import static org.junit.jupiter.api.Assertions.assertEquals;
23+
1624
@DomainModel(
1725
annotatedClasses = PolymorphicQueriesTest2.Human.class
1826
)
1927
@SessionFactory
20-
@TestForIssue( jiraKey = "HHH-15744")
2128
public class PolymorphicQueriesTest2 {
2229

23-
2430
@BeforeAll
2531
public void setUp(SessionFactoryScope scope) {
2632
scope.inTransaction(
@@ -31,6 +37,7 @@ public void setUp(SessionFactoryScope scope) {
3137
}
3238

3339
@Test
40+
@TestForIssue( jiraKey = "HHH-15744")
3441
public void testQuery(SessionFactoryScope scope) {
3542
scope.inTransaction(
3643
session -> {
@@ -44,6 +51,17 @@ public void testQuery(SessionFactoryScope scope) {
4451
);
4552
}
4653

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+
4765
public interface Animal {
4866
String getName();
4967
}

0 commit comments

Comments
 (0)