HHH-17859, HHH-17858 redisable cast to UUID
but leave a comment
This commit is contained in:
parent
c60dab34d0
commit
ba442f5d18
|
@ -347,13 +347,16 @@ public class TypeConfiguration implements SessionFactoryObserver, Serializable {
|
|||
case "duration": return getBasicTypeForJavaType( Duration.class );
|
||||
case "instant": return getBasicTypeForJavaType( Instant.class );
|
||||
case "binary": return getBasicTypeForJavaType( byte[].class );
|
||||
case "uuid": return getBasicTypeForJavaType( UUID.class );
|
||||
//this one is very fragile ... works well for BIT or BOOLEAN columns only
|
||||
//works OK, I suppose, for integer columns, but not at all for char columns
|
||||
case "boolean": return getBasicTypeForJavaType( Boolean.class );
|
||||
case "truefalse": return basicTypeRegistry.getRegisteredType( StandardBasicTypes.TRUE_FALSE.getName() );
|
||||
case "yesno": return basicTypeRegistry.getRegisteredType( StandardBasicTypes.YES_NO.getName() );
|
||||
case "numericboolean": return basicTypeRegistry.getRegisteredType( StandardBasicTypes.NUMERIC_BOOLEAN.getName() );
|
||||
//really not sure about this one - it works well for casting from binary
|
||||
//to UUID, but people will want to use it to cast from varchar, and that
|
||||
//won't work at all without some special casing in the Dialects
|
||||
// case "uuid": return getBasicTypeForJavaType( UUID.class );
|
||||
default: {
|
||||
final BasicType<?> registeredBasicType = basicTypeRegistry.getRegisteredType( name );
|
||||
if ( registeredBasicType != null ) {
|
||||
|
|
|
@ -2293,8 +2293,8 @@ public class FunctionTests {
|
|||
scope.inTransaction(s -> {
|
||||
byte[] bytes = s.createSelectionQuery("select column(e.theuuid as binary) from EntityOfBasics e", byte[].class)
|
||||
.getSingleResultOrNull();
|
||||
UUID uuid = s.createSelectionQuery("select column(e.theuuid as UUID) from EntityOfBasics e", UUID.class)
|
||||
.getSingleResultOrNull();
|
||||
// UUID uuid = s.createSelectionQuery("select column(e.theuuid as UUID) from EntityOfBasics e", UUID.class)
|
||||
// .getSingleResultOrNull();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue