HHH-18218 - Added test case not using explicit constructor new ConstructorDto(...)
This commit is contained in:
parent
c2d0763b64
commit
9e13bd0c48
|
@ -45,6 +45,15 @@ public class InstantiationWithGenericsTest {
|
||||||
.containsExactly( 1L, "entity_1" ) );
|
.containsExactly( 1L, "entity_1" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testImplicitConstructor(SessionFactoryScope scope) {
|
||||||
|
scope.inTransaction( session -> assertThat( session.createQuery(
|
||||||
|
"select e.id, e.data from ConcreteEntity e",
|
||||||
|
ConstructorDto.class
|
||||||
|
).getSingleResult() ).extracting( ConstructorDto::getId, ConstructorDto::getData )
|
||||||
|
.containsExactly( 1L, "entity_1" ) );
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInjection(SessionFactoryScope scope) {
|
public void testInjection(SessionFactoryScope scope) {
|
||||||
scope.inTransaction( session -> assertThat( session.createQuery(
|
scope.inTransaction( session -> assertThat( session.createQuery(
|
||||||
|
|
Loading…
Reference in New Issue