Skip to content

Commit f63f15b

Browse files
cigalybeikov
authored andcommitted
HHH-18218 - Added test case not using explicit constructor new ConstructorDto(...)
1 parent 742fc4c commit f63f15b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/instantiation/InstantiationWithGenericsTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ public void testConstructor(SessionFactoryScope scope) {
4545
.containsExactly( 1L, "entity_1" ) );
4646
}
4747

48+
@Test
49+
public void testImplicitConstructor(SessionFactoryScope scope) {
50+
scope.inTransaction( session -> assertThat( session.createQuery(
51+
"select e.id, e.data from ConcreteEntity e",
52+
ConstructorDto.class
53+
).getSingleResult() ).extracting( ConstructorDto::getId, ConstructorDto::getData )
54+
.containsExactly( 1L, "entity_1" ) );
55+
}
56+
4857
@Test
4958
public void testInjection(SessionFactoryScope scope) {
5059
scope.inTransaction( session -> assertThat( session.createQuery(

0 commit comments

Comments
 (0)