Class RevisionTypeType
- All Implemented Interfaces:
Serializable,UserType<RevisionType>
RevisionType enum.- Author:
- Adam Warski (adam at warski dot org)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassemble(Serializable cached, Object owner) Reconstruct a value from its destructured representation, during the process of reading the properties of an entity from the second-level cache.deepCopy(RevisionType value) Return a clone of the given instance of the Java class mapped by this custom type.disassemble(RevisionType value) Transform the given value into a destructured representation, suitable for storage in the second-level cache.booleanequals(RevisionType x, RevisionType y) Compare two instances of the Java class mapped by this custom type for persistence "equality", that is, equality of their persistent state.intThe JDBC/SQL type code for the database column mapped by this custom type.intGet a hash code for the given instance of the Java class mapped by this custom type, consistent with the definition of persistence "equality" for this custom type.booleanAre instances of the Java class mapped by this custom type mutable or immutable?nullSafeGet(ResultSet rs, int position, SharedSessionContractImplementor session, Object owner) Read an instance of the Java class mapped by this custom type from the given JDBCResultSet.voidnullSafeSet(PreparedStatement preparedStatement, RevisionType value, int index, SharedSessionContractImplementor session) Write an instance of the Java class mapped by this custom type to the given JDBCPreparedStatement.replace(RevisionType original, RevisionType target, Object owner) During merge, replace the existing (target) value in the managed entity we are merging to with a new (original) value from the detached entity we are merging.The class returned bynullSafeGet().Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.usertype.UserType
getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlScale, getJdbcType, getValueConverter
-
Constructor Details
-
RevisionTypeType
public RevisionTypeType()
-
-
Method Details
-
getSqlType
public int getSqlType()Description copied from interface:UserTypeThe JDBC/SQL type code for the database column mapped by this custom type.The type code is usually one of the standard type codes declared by
SqlTypes, but it could be a database-specific code.- Specified by:
getSqlTypein interfaceUserType<RevisionType>- See Also:
-
returnedClass
Description copied from interface:UserTypeThe class returned bynullSafeGet().- Specified by:
returnedClassin interfaceUserType<RevisionType>- Returns:
- Class
-
deepCopy
Description copied from interface:UserTypeReturn a clone of the given instance of the Java class mapped by this custom type.- It's not necessary to clone immutable objects. If the Java class mapped by this custom type is an immutable class, this method may safely just return its argument.
- For mutable objects, it's necessary to deep copy persistent state, stopping at associations to other entities, and at persistent collections.
- If the argument is a reference to an entity, just return the argument.
- Finally, if the argument is null, just return null.
- Specified by:
deepCopyin interfaceUserType<RevisionType>- Parameters:
value- the object to be cloned, which may be null- Returns:
- a clone
- Throws:
HibernateException
-
isMutable
public boolean isMutable()Description copied from interface:UserTypeAre instances of the Java class mapped by this custom type mutable or immutable?- Specified by:
isMutablein interfaceUserType<RevisionType>- Returns:
trueif instances are mutable
-
assemble
Description copied from interface:UserTypeReconstruct a value from its destructured representation, during the process of reading the properties of an entity from the second-level cache.If the value is mutable then, at the very least, this method should perform a deep copy. That may not be enough for some types, however. For example, associations must be cached as identifier values.
This is an optional operation, but, if left unimplemented, this type will not be cacheable in the second-level cache.
- Specified by:
assemblein 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- See Also:
-
disassemble
Description copied from interface:UserTypeTransform the given value into a destructured representation, suitable for storage in the second-level cache. This method is called only during the process of writing the properties of an entity to the second-level cache.If the value is mutable then, at the very least, this method should perform a deep copy. That may not be enough for some types, however. For example, associations must be cached as identifier values.
This is an optional operation, but, if left unimplemented, this type will not be cacheable in the second-level cache.
- Specified by:
disassemblein interfaceUserType<RevisionType>- Parameters:
value- the object to be cached- Returns:
- a cacheable representation of the object
- Throws:
HibernateException- See Also:
-
replace
public RevisionType replace(RevisionType original, RevisionType target, Object owner) throws HibernateException Description copied from interface:UserTypeDuring merge, replace the existing (target) value in the managed entity we are merging to with a new (original) value from the detached entity we are merging.- For immutable objects, or null values, it's safe to simply return the first argument.
- For mutable objects, it's enough to return a copy of the first argument.
- For objects with component values, it might make sense to recursively replace component values.
- Specified by:
replacein 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- See Also:
-
hashCode
Description copied from interface:UserTypeGet a hash code for the given instance of the Java class mapped by this custom type, consistent with the definition of persistence "equality" for this custom type.- Specified by:
hashCodein interfaceUserType<RevisionType>- Throws:
HibernateException
-
equals
Description copied from interface:UserTypeCompare two instances of the Java class mapped by this custom type for persistence "equality", that is, equality of their persistent state.- Specified by:
equalsin interfaceUserType<RevisionType>- Throws:
HibernateException
-