org.hibernate.usertype.CompositeUserType |
A UserType that may be dereferenced in a query.
This interface allows a custom type to define "properties".
These need not necessarily correspond to physical JavaBeans
style properties.
A CompositeUserType may be used in almost every way
that a component may be used. It may even contain many-to-one
associations.
Implementors must be immutable and must declare a public
default constructor.
Unlike UserType, cacheability does not depend upon
serializability. Instead, assemble() and
disassemble provide conversion to/from a cacheable
representation.
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 the "property names" that may be used in a
query.
| |||||||||||
Get the corresponding "property types".
| |||||||||||
Get the value of a property.
| |||||||||||
Get a hashcode for the instance, consistent with persistence "equality"
| |||||||||||
Check if objects of this type mutable.
| |||||||||||
Retrieve an instance of the mapped class from a JDBC resultset.
| |||||||||||
Write an instance of the mapped class to a prepared statement.
| |||||||||||
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().
| |||||||||||
Set the value of a property.
|
Reconstruct an object from the cacheable representation. At the very least this method should perform a deep copy. (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.
value | generally a collection element or entity field |
---|
HibernateException |
---|
Transform the object into its cacheable representation. At the very least this method should perform a deep copy. 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 the "property names" that may be used in a query.
Get the corresponding "property types".
Get the value of a property.
component | an instance of class mapped by this "type" |
---|
HibernateException |
---|
Get a hashcode for the instance, consistent with persistence "equality"
HibernateException |
---|
Check if objects of this type mutable.
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 |
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 |
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. However, since composite user types often define component values, it might make sense to recursively replace component values in the target object.@return
HibernateException |
---|
Set the value of a property.
component | an instance of class mapped by this "type" |
---|---|
value | the value to set |
HibernateException |
---|