remove a workaround for a bug on derby that was fixed ages ago

This commit is contained in:
Gavin King 2022-01-06 14:11:10 +01:00
parent aef951f279
commit 01600b48e5
1 changed files with 8 additions and 21 deletions

View File

@ -23,31 +23,18 @@ import org.junit.jupiter.api.Test;
@DomainModel( annotatedClasses = CastFunctionTest.MyEntity.class )
@SessionFactory
public class CastFunctionTest {
@Test
public void testStringCasting(SessionFactoryScope scope) {
scope.inTransaction(
(session) -> {
final Dialect dialect = session.getFactory().getJdbcServices().getDialect();
if ( DerbyDialect.class.isInstance( dialect ) ) {
// the conversion from DOUBLE to VARCHAR is not supported by Derby,
// using the short name
session.createQuery( "select cast(char(e.theLostNumber) as string) from MyEntity e" ).list();
// using the java class name
session.createQuery( "select cast(char(e.theLostNumber) as java.lang.String) from MyEntity e" ).list();
// using the fqn Hibernate Type name
session.createQuery( "select cast(char(e.theLostNumber) as org.hibernate.type.StringType) from MyEntity e" )
.list();
}
else {
// using the short name
session.createQuery( "select cast(e.theLostNumber as string) from MyEntity e" ).list();
// using the java class name
session.createQuery( "select cast(e.theLostNumber as java.lang.String) from MyEntity e" ).list();
// using the fqn Hibernate Type name
session.createQuery( "select cast(e.theLostNumber as org.hibernate.type.StringType) from MyEntity e" )
.list();
}
// using the short name
session.createQuery( "select cast(e.theLostNumber as string) from MyEntity e" ).list();
// using the java class name
session.createQuery( "select cast(e.theLostNumber as java.lang.String) from MyEntity e" ).list();
// using the fqn Hibernate Type name
session.createQuery( "select cast(e.theLostNumber as org.hibernate.type.StringType) from MyEntity e" )
.list();
}
);
}