java.lang.Object | ||
↳ | org.hibernate.type.AbstractType | |
↳ | org.hibernate.type.ComponentType |
Known Direct Subclasses |
Handles "component" mappings
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
propertySpan | |||||||||||
tuplizerMapping |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Reconstruct the object from its cached "disassembled" state.
| |||||||||||
Perform a
Comparator style comparison between values | |||||||||||
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.
| |||||||||||
Retrieve the cascade style of the indicated component property.
| |||||||||||
How many columns are used to persist this type.
| |||||||||||
Retrieve the fetch mode of the indicated component property.
| |||||||||||
Get a hash code, consistent with persistence "equality".
| |||||||||||
Get a hash code, consistent with persistence "equality".
| |||||||||||
Returns the abbreviated name of the type.
| |||||||||||
Get the names of the component properties
| |||||||||||
Retrieve the indicators regarding which component properties are nullable.
| |||||||||||
Extract a particular component property value indicated by index.
| |||||||||||
Extract the values of the component properties from the given component instance
| |||||||||||
Extract the values of the component properties from the given component instance without access to the
session.
| |||||||||||
The class returned by
nullSafeGet(ResultSet, String, SessionImplementor, Object) methods. | |||||||||||
Get the types of the component properties
| |||||||||||
Retrieve an instance of the mapped class, or the identifier of an entity or collection,
from a JDBC resultset.
| |||||||||||
This method does not populate the component parent
| |||||||||||
Return true if the implementation is castable to
CompositeType . | |||||||||||
Should the parent be considered dirty, given both the old and current value?
| |||||||||||
Should the parent be considered dirty, given both the old and current value?
| |||||||||||
Is this component embedded? "embedded" indicates that the component is "virtual", that its properties are
"flattened" onto its owner
| |||||||||||
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent
state).
| |||||||||||
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent
state).
| |||||||||||
Is the given method a member of this component's class?
| |||||||||||
Has the value been modified compared to the current database state? The difference between this
and the
isDirty(Object, Object, boolean[], SessionImplementor) methods is that here we need to account for "partially" built values. | |||||||||||
Are objects of this type mutable.
| |||||||||||
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent
state) taking a shortcut for entity references.
| |||||||||||
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.
| |||||||||||
Write an instance of the mapped class to a prepared statement, ignoring some columns.
| |||||||||||
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.
| |||||||||||
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.
| |||||||||||
Map identifiers to entities or collections.
| |||||||||||
Given a hydrated, but unresolved value, return a value that may be used to
reconstruct property-ref associations.
| |||||||||||
Inject property values onto the given component instance
An optional operation
| |||||||||||
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.
| |||||||||||
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.CompositeType
| |||||||||||
From interface
org.hibernate.type.Type
|
Reconstruct the object from its cached "disassembled" state.
object | the disassembled state from the cache |
---|---|
session | the session |
owner | the parent entity object |
HibernateException |
---|
Perform a Comparator
style comparison between values
x | The first value |
---|---|
y | The second value |
entityMode | The entity mode of the values. |
compare(T, T)
for a discussion.
Return a deep copy of the persistent state, stopping at entities and at collections.
component | 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 |
---|
Retrieve the cascade style of the indicated component property.
i | The property index, |
---|
How many columns are used to persist this type. Always the same as sqlTypes(mapping).length
mapping | The mapping object :/ |
---|
MappingException |
---|
Retrieve the fetch mode of the indicated component property.
i | The property index, |
---|
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. |
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. |
factory | The session factory |
Returns the abbreviated name of the type.
Get the names of the component properties
Retrieve the indicators regarding which component properties are nullable.
An optional operationHibernateException |
---|
Extract a particular component property value indicated by index.
component | The component instance |
---|---|
i | The index of the property whose value is to be extracted |
session | The session from which the request originates. |
HibernateException |
---|
Extract the values of the component properties from the given component instance
component | The component instance |
---|---|
session | The session from which the request originates |
HibernateException |
---|
Extract the values of the component properties from the given component instance without access to the session.
An optional operationcomponent | The component instance |
---|---|
entityMode | The entity mode |
HibernateException |
---|
The class returned by nullSafeGet(ResultSet, String, SessionImplementor, Object)
methods. This is used to establish the class of an array of
this type.
Get the types of the component properties
Retrieve an instance of the mapped class, or the identifier of an entity or collection, from a JDBC resultset. This is useful for 2-phase property initialization - the second phase is a call to resolveIdentifier().
names | the column names |
---|---|
session | the session |
owner | the parent entity |
HibernateException | |
---|---|
SQLException |
This method does not populate the component parent
HibernateException |
---|
Return true if the implementation is castable to CompositeType
. Essentially a polymorphic
version of (type instanceof CompositeType.class)
. A component type may own collections or
associations and hence must provide certain extra functionality.
CompositeType
implementor; false otherwise.
Should the parent be considered dirty, given both the old and current value?
x | the old value |
---|---|
y | 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 |
---|
Should the parent be considered dirty, given both the old and current value?
x | the old value |
---|---|
y | the current value |
session | The session from which the request originated. |
HibernateException |
---|
Is this component embedded? "embedded" indicates that the component is "virtual", that its properties are "flattened" onto its owner
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 |
---|
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. |
factory | The session factory |
HibernateException |
---|
Is the given method a member of this component's class?
method | The method to check |
---|
Has the value been modified compared to the current database state? The difference between this
and the isDirty(Object, Object, boolean[], SessionImplementor)
methods is that here we need to account for "partially" built values. This is really
only an issue with association types. For most type implementations it is enough to simply delegate to
isDirty(Object, Object, boolean[], SessionImplementor)
here/
old | the database state, in a "hydrated" form, with identifiers unresolved |
---|---|
current | the current state of the object |
checkable | which columns are actually updatable |
session | The session from which the request originated. |
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.)
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent state) taking a shortcut for entity references.
For most types this should equate to #equals check on the values. For associations the implication is a bit different. For most types it is conceivable to simply delegate toisEqual(Object, Object, EntityMode)
x | The first value |
---|---|
y | The second value |
entityMode | The entity mode of the values. |
HibernateException |
---|
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 |
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.
name | the column name |
---|---|
owner | the parent entity |
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 |
---|---|
begin | statement parameter index |
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 |
---|---|
begin | statement parameter index |
settable | an array indicating which columns to ignore |
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 |
---|
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 |
---|
Map identifiers to entities or collections. This is the second phase of 2-phase property initialization.
value | an identifier or value returned by hydrate() |
---|---|
session | the session |
owner | the parent entity |
HibernateException |
---|
Given a hydrated, but unresolved value, return a value that may be used to reconstruct property-ref associations.
HibernateException |
---|
Inject property values onto the given component instance
An optional operationcomponent | The component instance |
---|---|
values | The values to inject |
entityMode | The entity mode |
HibernateException |
---|
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.
mapping | The mapping object :/ |
---|
MappingException |
---|
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 |
---|