HHH-7066 More code taking advantage from the Clob extraction
This commit is contained in:
parent
98082feb11
commit
f9ab0eb6ae
|
@ -103,12 +103,7 @@ public class CharacterArrayTypeDescriptor extends AbstractTypeDescriptor<Charact
|
|||
return wrapChars( ( (String) value ).toCharArray() );
|
||||
}
|
||||
if ( Clob.class.isInstance( value ) ) {
|
||||
try {
|
||||
return wrapChars( DataHelper.extractString( ( (Clob) value ).getCharacterStream() ).toCharArray() );
|
||||
}
|
||||
catch ( SQLException e ) {
|
||||
throw new HibernateException( "Unable to access lob stream", e );
|
||||
}
|
||||
return wrapChars( DataHelper.extractString( ( (Clob) value ) ).toCharArray() );
|
||||
}
|
||||
if ( Reader.class.isInstance( value ) ) {
|
||||
return wrapChars( DataHelper.extractString( (Reader) value ).toCharArray() );
|
||||
|
|
|
@ -70,12 +70,7 @@ public class ClobTypeDescriptor extends AbstractTypeDescriptor<Clob> {
|
|||
}
|
||||
|
||||
public String toString(Clob value) {
|
||||
try {
|
||||
return DataHelper.extractString( value.getCharacterStream() );
|
||||
}
|
||||
catch ( SQLException e ) {
|
||||
throw new HibernateException( "Unable to access clob stream", e );
|
||||
}
|
||||
return DataHelper.extractString( value );
|
||||
}
|
||||
|
||||
public Clob fromString(String string) {
|
||||
|
@ -109,12 +104,7 @@ public class ClobTypeDescriptor extends AbstractTypeDescriptor<Clob> {
|
|||
}
|
||||
|
||||
if ( CharacterStream.class.isAssignableFrom( type ) ) {
|
||||
try {
|
||||
return (X) new CharacterStreamImpl( DataHelper.extractString( value.getCharacterStream() ) );
|
||||
}
|
||||
catch ( SQLException e ) {
|
||||
throw new HibernateException( "Unable to access lob stream", e );
|
||||
}
|
||||
return (X) new CharacterStreamImpl( DataHelper.extractString( value ) );
|
||||
}
|
||||
|
||||
final Clob clob = WrappedClob.class.isInstance( value )
|
||||
|
|
|
@ -103,12 +103,7 @@ public class PrimitiveCharacterArrayTypeDescriptor extends AbstractTypeDescripto
|
|||
return ( (String) value ).toCharArray();
|
||||
}
|
||||
if ( Clob.class.isInstance( value ) ) {
|
||||
try {
|
||||
return DataHelper.extractString( ( (Clob) value ).getCharacterStream() ).toCharArray();
|
||||
}
|
||||
catch ( SQLException e ) {
|
||||
throw new HibernateException( "Unable to access lob stream", e );
|
||||
}
|
||||
return DataHelper.extractString( ( (Clob) value ) ).toCharArray();
|
||||
}
|
||||
if ( Reader.class.isInstance( value ) ) {
|
||||
return DataHelper.extractString( ( (Reader) value ) ).toCharArray();
|
||||
|
|
Loading…
Reference in New Issue