HHH-18859 add a test for string slice operator
This commit is contained in:
parent
cfc4b0a644
commit
dd80b3e2a5
|
@ -2526,6 +2526,23 @@ public class FunctionTests {
|
|||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSlice(SessionFactoryScope scope) {
|
||||
scope.inTransaction(
|
||||
session -> {
|
||||
assertEquals("ring",
|
||||
session.createSelectionQuery("select theString[3:6] from EntityOfBasics", String.class)
|
||||
.getSingleResult());
|
||||
assertEquals('s',
|
||||
session.createSelectionQuery("select theString[1] from EntityOfBasics", Character.class)
|
||||
.getSingleResult());
|
||||
assertEquals('y',
|
||||
session.createSelectionQuery("select theString[7] from EntityOfBasics", Character.class)
|
||||
.getSingleResult());
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SkipForDialect(dialectClass = H2Dialect.class)
|
||||
@SkipForDialect(dialectClass = DerbyDialect.class)
|
||||
|
|
Loading…
Reference in New Issue