java.lang.Object | ||
↳ | org.hibernate.type.AbstractType | |
↳ | org.hibernate.type.CustomType |
Adapts UserType
to the generic Type
interface, in order
to isolate user code from changes in the internal Type contracts.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Reconstruct the object from its cached "disassembled" state.
| |||||||||||
Return a deep copy of the persistent state, stopping at entities and at
collections.
| |||||||||||
Return a cacheable "disassembled" representation of the object.
| |||||||||||
Parse the XML representation of an instance.
| |||||||||||
How many columns are used to persist this type.
| |||||||||||
Get a comparator for version values.
| |||||||||||
Get a hash code, consistent with persistence "equality".
| |||||||||||
Returns the abbreviated name of the type.
| |||||||||||
Get the names under which this type should be registered in the type registry.
| |||||||||||
The class returned by
nullSafeGet(ResultSet, String, SessionImplementor, Object) methods. | |||||||||||
Should the parent be considered dirty, given both the old and current value?
| |||||||||||
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent
state).
| |||||||||||
Are objects of this type mutable.
| |||||||||||
Retrieve an instance of the mapped class from a JDBC resultset.
| |||||||||||
Retrieve an instance of the mapped class from a JDBC resultset.
| |||||||||||
Write an instance of the mapped class to a prepared statement, ignoring some columns.
| |||||||||||
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.
| |||||||||||
Generate an initial version.
| |||||||||||
A representation of the value to be embedded in an XML element.
| |||||||||||
Return the JDBC types codes (per java.sql.Types) for the columns mapped by this type.
| |||||||||||
Convert the value from the mapping file to a Java object.
| |||||||||||
Given an instance of the type, return an array of boolean, indicating
which mapped columns would be null.
| |||||||||||
A representation of the value to be embedded in a log file.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.hibernate.type.AbstractType
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.hibernate.type.BasicType
| |||||||||||
From interface
org.hibernate.type.IdentifierType
| |||||||||||
From interface
org.hibernate.type.LiteralType
| |||||||||||
From interface
org.hibernate.type.Type
| |||||||||||
From interface
org.hibernate.type.VersionType
|
Reconstruct the object from its cached "disassembled" state.
cached | the disassembled state from the cache |
---|---|
session | the session |
owner | the parent entity 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 |
---|
Return a cacheable "disassembled" representation of the object.
value | the value to cache |
---|---|
session | the session |
owner | optional parent entity object (needed for collections) |
HibernateException |
---|
Parse the XML representation of an instance.
HibernateException |
---|
How many columns are used to persist this type. Always the same as sqlTypes(mapping).length
session | The mapping object :/ |
---|
Get a comparator for version values.
Get a hash code, consistent with persistence "equality". Again for most types the normal usage is to delegate to the value's #hashCode.
x | The value for which to retrieve a hash code |
---|---|
entityMode | The entity mode of the value. |
Returns the abbreviated name of the type.
Get the names under which this type should be registered in the type registry.
The class returned by nullSafeGet(ResultSet, String, SessionImplementor, Object)
methods. This is used to establish the class of an array of
this type.
Should the parent be considered dirty, given both the old and current value?
old | the old value |
---|---|
current | the current value |
checkable | An array of booleans indicating which columns making up the value are actually checkable |
session | The session from which the request originated. |
HibernateException |
---|
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent state).
This should always equate to some form of comparison of the value's internal state. As an example, for something like a date the comparison should be based on its internal "time" state based on the specific portion it is meant to represent (timestamp, date, time).x | The first value |
---|---|
y | The second value |
entityMode | The entity mode of the values. |
HibernateException |
---|
Are objects of this type mutable. (With respect to the referencing object ... entities and collections are considered immutable because they manage their own internal state.)
Retrieve an instance of the mapped class from a JDBC resultset. Implementations should handle possibility of null values. This method might be called if the type is known to be a single-column type.
columnName | the column name |
---|---|
owner | the parent entity |
HibernateException | |
---|---|
SQLException |
Retrieve an instance of the mapped class from a JDBC resultset. Implementors should handle possibility of null values.
names | the column names |
---|---|
owner | the parent entity |
HibernateException | |
---|---|
SQLException |
Write an instance of the mapped class to a prepared statement, ignoring some columns. Implementors should handle possibility of null values. A multi-column type should be written to parameters starting from index.
value | the object to write |
---|---|
index | statement parameter index |
settable | an array indicating which columns to ignore |
HibernateException | |
---|---|
SQLException |
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.
value | the object to write |
---|---|
index | statement parameter index |
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 |
---|
Generate an initial version.
session | The session from which this request originates. |
---|
A representation of the value to be embedded in an XML element.
HibernateException |
---|
Return the JDBC types codes (per java.sql.Types) for the columns mapped by this type.
pi | The mapping object :/ |
---|
Convert the value from the mapping file to a Java object.
xml | the value of discriminator-value or unsaved-value attribute |
---|
Given an instance of the type, return an array of boolean, indicating which mapped columns would be null.
value | an instance of the type |
---|
A representation of the value to be embedded in a log file.
HibernateException |
---|