HHH-11818 : ClassCastException when binding a MaterializedNClobType as NClob
This commit is contained in:
parent
515e45e382
commit
3f2c36ab69
|
@ -48,12 +48,15 @@ public class StringTypeDescriptor extends AbstractTypeDescriptor<String> {
|
|||
if ( CharacterStream.class.isAssignableFrom( type ) ) {
|
||||
return (X) new CharacterStreamImpl( value );
|
||||
}
|
||||
if ( Clob.class.isAssignableFrom( type ) ) {
|
||||
return (X) options.getLobCreator().createClob( value );
|
||||
}
|
||||
// Since NClob extends Clob, we need to check if type is an NClob
|
||||
// before checking if type is a Clob. That will ensure that
|
||||
// the correct type is returned.
|
||||
if ( DataHelper.isNClob( type ) ) {
|
||||
return (X) options.getLobCreator().createNClob( value );
|
||||
}
|
||||
if ( Clob.class.isAssignableFrom( type ) ) {
|
||||
return (X) options.getLobCreator().createClob( value );
|
||||
}
|
||||
|
||||
throw unknownUnwrap( type );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue