Class RevisionTypeType
- java.lang.Object
-
- org.hibernate.envers.internal.entities.RevisionTypeType
-
- All Implemented Interfaces:
Serializable
,UserType<RevisionType>
public class RevisionTypeType extends Object implements UserType<RevisionType>, Serializable
A hibernate type for theRevisionType
enum.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RevisionTypeType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RevisionType
assemble(Serializable cached, Object owner)
Reconstruct an object from the cacheable representation.RevisionType
deepCopy(RevisionType value)
Return a deep copy of the persistent state, stopping at entities and at collections.Serializable
disassemble(RevisionType value)
Transform the object into its cacheable representation.boolean
equals(RevisionType x, RevisionType y)
Compare two instances of the class mapped by this type for persistence "equality".int
getSqlType()
Return the SQL type code for the column mapped by this type.int
hashCode(RevisionType x)
Get a hashcode for the instance, consistent with persistence "equality"boolean
isMutable()
Are objects of this type mutable?RevisionType
nullSafeGet(ResultSet rs, int position, SharedSessionContractImplementor session, Object owner)
Retrieve an instance of the mapped class from a JDBC resultset.void
nullSafeSet(PreparedStatement preparedStatement, RevisionType value, int index, SharedSessionContractImplementor session)
Write an instance of the mapped class to a prepared statement.RevisionType
replace(RevisionType original, RevisionType target, 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.Class<RevisionType>
returnedClass()
The class returned bynullSafeGet()
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.usertype.UserType
getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlScale, getJdbcType, getValueConverter
-
-
-
-
Method Detail
-
getSqlType
public int getSqlType()
Description copied from interface:UserType
Return the SQL type code for the column mapped by this type. The codes are generally defined onorg.hibernate.type.SqlTypes
, but could be database-specific codes- Specified by:
getSqlType
in interfaceUserType<RevisionType>
- See Also:
SqlTypes
-
returnedClass
public Class<RevisionType> returnedClass()
Description copied from interface:UserType
The class returned bynullSafeGet()
.- Specified by:
returnedClass
in interfaceUserType<RevisionType>
- Returns:
- Class
-
nullSafeGet
public RevisionType nullSafeGet(ResultSet rs, int position, SharedSessionContractImplementor session, Object owner) throws SQLException
Description copied from interface:UserType
Retrieve an instance of the mapped class from a JDBC resultset. Implementors should handle possibility of null values.- Specified by:
nullSafeGet
in interfaceUserType<RevisionType>
- Throws:
SQLException
-
nullSafeSet
public void nullSafeSet(PreparedStatement preparedStatement, RevisionType value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException
Description copied from interface:UserType
Write an instance of the mapped class to a prepared statement. Implementors should handle possibility of null values. A multi-column type should be written to parameters starting fromindex
.- Specified by:
nullSafeSet
in interfaceUserType<RevisionType>
- Throws:
HibernateException
SQLException
-
deepCopy
public RevisionType deepCopy(RevisionType value) throws HibernateException
Description copied from interface:UserType
Return a deep copy of the persistent state, stopping at entities and at collections. It is not necessary to copy immutable objects, or null values, in which case it is safe to simply return the argument.- Specified by:
deepCopy
in interfaceUserType<RevisionType>
- Parameters:
value
- the object to be cloned, which may be null- Returns:
- Object a copy
- Throws:
HibernateException
-
isMutable
public boolean isMutable()
Description copied from interface:UserType
Are objects of this type mutable?- Specified by:
isMutable
in interfaceUserType<RevisionType>
- Returns:
- boolean
-
assemble
public RevisionType assemble(Serializable cached, Object owner) throws HibernateException
Description copied from interface:UserType
Reconstruct an object from the cacheable representation. At the very least this method should perform a deep copy if the type is mutable. (optional operation)- Specified by:
assemble
in interfaceUserType<RevisionType>
- Parameters:
cached
- the object to be cachedowner
- the owner of the cached object- Returns:
- a reconstructed object from the cacheable representation
- Throws:
HibernateException
-
disassemble
public Serializable disassemble(RevisionType value) throws HibernateException
Description copied from interface:UserType
Transform the object into its cacheable representation. At the very least this method should perform a deep copy if the type is mutable. That may not be enough for some implementations, however; for example, associations must be cached as identifier values. (optional operation)- Specified by:
disassemble
in interfaceUserType<RevisionType>
- Parameters:
value
- the object to be cached- Returns:
- a cacheable representation of the object
- Throws:
HibernateException
-
replace
public RevisionType replace(RevisionType original, RevisionType target, Object owner) throws HibernateException
Description copied from interface:UserType
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. For immutable objects, or null values, it is safe to simply return the first parameter. For mutable objects, it is safe to return a copy of the first parameter. For objects with component values, it might make sense to recursively replace component values.- Specified by:
replace
in interfaceUserType<RevisionType>
- Parameters:
original
- the value from the detached entity being mergedtarget
- the value in the managed entity- Returns:
- the value to be merged
- Throws:
HibernateException
-
hashCode
public int hashCode(RevisionType x) throws HibernateException
Description copied from interface:UserType
Get a hashcode for the instance, consistent with persistence "equality"- Specified by:
hashCode
in interfaceUserType<RevisionType>
- Throws:
HibernateException
-
equals
public boolean equals(RevisionType x, RevisionType y) throws HibernateException
Description copied from interface:UserType
Compare two instances of the class mapped by this type for persistence "equality". Equality of the persistent state.- Specified by:
equals
in interfaceUserType<RevisionType>
- Throws:
HibernateException
-
-