mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-19 17:45:10 +00:00
HHH-18215, HHH-2744 test
Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
parent
6435137800
commit
18ec7f178e
@ -23,7 +23,7 @@
|
|||||||
annotatedClasses = { NativeQuerySchemaPlaceholderTest.TestEntity.class }
|
annotatedClasses = { NativeQuerySchemaPlaceholderTest.TestEntity.class }
|
||||||
)
|
)
|
||||||
@SessionFactory
|
@SessionFactory
|
||||||
@TestForIssue(jiraKey = "HHH-15269")
|
@TestForIssue(jiraKey = {"HHH-15269", "HHH-18215"})
|
||||||
public class NativeQuerySchemaPlaceholderTest {
|
public class NativeQuerySchemaPlaceholderTest {
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
@ -55,7 +55,6 @@ public void testUpdate(SessionFactoryScope scope) {
|
|||||||
nativeQuery.executeUpdate();
|
nativeQuery.executeUpdate();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
scope.inTransaction(
|
scope.inTransaction(
|
||||||
session -> {
|
session -> {
|
||||||
List<TestEntity> testEntities = session.createQuery( "from TestEntity", TestEntity.class )
|
List<TestEntity> testEntities = session.createQuery( "from TestEntity", TestEntity.class )
|
||||||
@ -64,6 +63,23 @@ public void testUpdate(SessionFactoryScope scope) {
|
|||||||
assertThat( testEntity.name, is( "updated_test" ) );
|
assertThat( testEntity.name, is( "updated_test" ) );
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
scope.inTransaction(
|
||||||
|
session -> {
|
||||||
|
NativeQueryImplementor<Tuple> nativeQuery = session.createNativeQuery(
|
||||||
|
"UPDATE {h-schema}TestEntity SET name = '{updated_test'"
|
||||||
|
);
|
||||||
|
nativeQuery.executeUpdate();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
scope.inTransaction(
|
||||||
|
session -> {
|
||||||
|
List<TestEntity> testEntities = session.createQuery( "from TestEntity", TestEntity.class )
|
||||||
|
.list();
|
||||||
|
TestEntity testEntity = testEntities.get( 0 );
|
||||||
|
assertThat( testEntity.name, is( "{updated_test" ) );
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user