org.hibernate.usertype.UserType |
Known Indirect Subclasses |
This interface should be implemented by user-defined "types".
A "type" class is not the actual property type - it
is a class that knows how to serialize instances of another
class to and from JDBC.
This interface
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Reconstruct an object from the cacheable representation.
| |||||||||||
Return a deep copy of the persistent state, stopping at entities and at
collections.
| |||||||||||
Transform the object into its cacheable representation.
| |||||||||||
Compare two instances of the class mapped by this type for persistence "equality".
| |||||||||||
Get a hashcode for the instance, consistent with persistence "equality"
| |||||||||||
Are objects of this type mutable?
| |||||||||||
This method is deprecated.
SessionImplementor will be added as an argument in a future version (see HHH-5968)
| |||||||||||
This method is deprecated.
SessionImplementor will be added as an argument in a future version (see HHH-5968)
| |||||||||||
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.
| |||||||||||
The class returned by nullSafeGet().
| |||||||||||
Return the SQL type codes for the columns mapped by this type.
|
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)
cached | the object to be cached |
---|---|
owner | the owner of the cached object |
HibernateException |
---|
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.
value | the object to be cloned, which may be null |
---|
HibernateException |
---|
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)
value | the object to be cached |
---|
HibernateException |
---|
Compare two instances of the class mapped by this type for persistence "equality". Equality of the persistent state.
HibernateException |
---|
Get a hashcode for the instance, consistent with persistence "equality"
HibernateException |
---|
Are objects of this type mutable?
This method is deprecated.
SessionImplementor will be added as an argument in a future version (see HHH-5968)
Retrieve an instance of the mapped class from a JDBC resultset. Implementors should handle possibility of null values.
rs | a JDBC result set |
---|---|
names | the column names |
owner | the containing entity |
HibernateException | |
SQLException | |
HibernateException | |
SQLException |
This method is deprecated.
SessionImplementor will be added as an argument in a future version (see HHH-5968)
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 from index.
st | a JDBC prepared statement |
---|---|
value | the object to write |
index | statement parameter index |
HibernateException | |
SQLException | |
HibernateException | |
SQLException |
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.
original | the value from the detached entity being merged |
---|---|
target | the value in the managed entity |
HibernateException |
---|
Return the SQL type codes for the columns mapped by this type. The codes are defined on java.sql.Types.