Methods Summary |
---|
public java.lang.Object | assemble(java.io.Serializable cached, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)
return (cached==null) ? null : fromBytes( (byte[]) cached );
|
public java.lang.Object | deepCopyNotNull(java.lang.Object value)
return fromBytes( toBytes(value) );
|
public java.io.Serializable | disassemble(java.lang.Object value, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)
return (value==null) ? null : toBytes(value);
|
private static java.lang.Object | fromBytes(byte[] bytes)
return SerializationHelper.deserialize(bytes);
|
public java.lang.Object | fromStringValue(java.lang.String xml)
return fromBytes( (byte[]) Hibernate.BINARY.fromStringValue(xml) );
|
public java.lang.Object | get(java.sql.ResultSet rs, java.lang.String name)
byte[] bytes = (byte[]) Hibernate.BINARY.get(rs, name);
// Some JDBC drivers erroneously return an empty array here for a null DB value :/
if ( bytes == null || bytes.length == 0 ) {
return null;
}
else {
return fromBytes(bytes);
}
|
public int | getHashCode(java.lang.Object x, org.hibernate.EntityMode entityMode)
return Hibernate.BINARY.getHashCode( toBytes(x), entityMode );
|
public java.lang.String | getName()
return (serializableClass==Serializable.class) ? "serializable" : serializableClass.getName();
|
public java.lang.Class | getReturnedClass()
return serializableClass;
|
public boolean | isEqual(java.lang.Object x, java.lang.Object y)
if ( x == y ) {
return true;
}
if ( x == null || y == null ) {
return false;
}
return x.equals( y ) || Hibernate.BINARY.isEqual( toBytes( x ), toBytes( y ) );
|
public void | set(java.sql.PreparedStatement st, java.lang.Object value, int index)
Hibernate.BINARY.set(st, toBytes(value), index);
|
public int | sqlType()
return Hibernate.BINARY.sqlType();
|
private static byte[] | toBytes(java.lang.Object object)
return SerializationHelper.serialize( (Serializable) object );
|
public java.lang.String | toString(java.lang.Object value)
return Hibernate.BINARY.toString( toBytes(value) );
|