public class GZipDataType
extends java.lang.Object
implements org.hibernate.usertype.UserType
Modifier and Type | Field and Description |
---|---|
static byte[] |
GZIP_PREFIX
For backward compatibility with non-zipped data, prefix the gzip stream with a magic sequence
|
static java.lang.Class |
RETURNED_CLASS |
static int[] |
SQL_TYPES |
Constructor and Description |
---|
GZipDataType() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
assemble(java.io.Serializable cached,
java.lang.Object owner)
Reconstruct an object from the cacheable representation
|
java.lang.Object |
deepCopy(java.lang.Object value)
Return a deep copy of the persistent state
|
java.io.Serializable |
disassemble(java.lang.Object value)
Transform the object into its cacheable representation
|
boolean |
equals(java.lang.Object x,
java.lang.Object y)
Compare two instances of the class mapped by this type for persistence "equality".
|
static byte[] |
gunzip(java.io.InputStream input)
Decompress (using gzip algorithm) a byte array.
|
static void |
gzip(byte[] content,
java.io.OutputStream out)
Compress (using gzip algorithm) a byte array into an output stream.
|
int |
hashCode(java.lang.Object x)
Get a hashcode for the instance, consistent with persistence "equality"
|
boolean |
isMutable()
Are objects of this type mutable?
|
java.lang.Object |
nullSafeGet(java.sql.ResultSet rs,
java.lang.String[] names,
org.hibernate.engine.spi.SessionImplementor sessionImplementor,
java.lang.Object owner)
Retrieve an instance of the mapped class from a JDBC resultset.
|
void |
nullSafeSet(java.sql.PreparedStatement st,
java.lang.Object value,
int index,
org.hibernate.engine.spi.SessionImplementor sessionImplementor)
Write an instance of the mapped class to a prepared statement.
|
java.lang.Object |
replace(java.lang.Object original,
java.lang.Object target,
java.lang.Object owner)
During merge, replace the existing (target) value in the entity we are
merging to with a new (original) value from the detached entity we are merging.
|
java.lang.Class |
returnedClass()
The class returned by nullSafeGet().
|
int[] |
sqlTypes()
Return the SQL type codes for the columns mapped by this type.
|
public static final int[] SQL_TYPES
public static final java.lang.Class RETURNED_CLASS
public static final byte[] GZIP_PREFIX
public java.lang.Object assemble(java.io.Serializable cached, java.lang.Object owner)
assemble
in interface org.hibernate.usertype.UserType
public java.io.Serializable disassemble(java.lang.Object value)
disassemble
in interface org.hibernate.usertype.UserType
public java.lang.Object deepCopy(java.lang.Object value)
deepCopy
in interface org.hibernate.usertype.UserType
public boolean equals(java.lang.Object x, java.lang.Object y)
equals
in interface org.hibernate.usertype.UserType
public int hashCode(java.lang.Object x)
hashCode
in interface org.hibernate.usertype.UserType
public boolean isMutable()
isMutable
in interface org.hibernate.usertype.UserType
public java.lang.Object nullSafeGet(java.sql.ResultSet rs, java.lang.String[] names, org.hibernate.engine.spi.SessionImplementor sessionImplementor, java.lang.Object owner) throws java.sql.SQLException
nullSafeGet
in interface org.hibernate.usertype.UserType
java.sql.SQLException
public void nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, org.hibernate.engine.spi.SessionImplementor sessionImplementor) throws java.sql.SQLException
nullSafeSet
in interface org.hibernate.usertype.UserType
java.sql.SQLException
public java.lang.Object replace(java.lang.Object original, java.lang.Object target, java.lang.Object owner)
replace
in interface org.hibernate.usertype.UserType
public java.lang.Class returnedClass()
returnedClass
in interface org.hibernate.usertype.UserType
public int[] sqlTypes()
sqlTypes
in interface org.hibernate.usertype.UserType
public static void gzip(byte[] content, java.io.OutputStream out)
public static byte[] gunzip(java.io.InputStream input)