java.lang.Object | |
↳ | org.hibernate.type.AbstractType |
Known Direct Subclasses |
Known Indirect Subclasses |
Abstract superclass of the built in Type hierarchy.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Reconstruct the object from its cached "disassembled" state.
| |||||||||||
Called before assembling a query result set from the query cache, to allow batch fetching
of entities missing from the second-level cache.
| |||||||||||
Perform a
Comparator style comparison between values | |||||||||||
Return a cacheable "disassembled" representation of the object.
| |||||||||||
Get a hash code, consistent with persistence "equality".
| |||||||||||
Get a hash code, consistent with persistence "equality".
| |||||||||||
Get the type of a semi-resolved value.
| |||||||||||
Retrieve an instance of the mapped class, or the identifier of an entity or collection,
from a JDBC resultset.
| |||||||||||
Return true if the implementation is castable to
AnyType . | |||||||||||
Return true if the implementation is castable to
AssociationType . | |||||||||||
Return true if the implementation is castable to
CollectionType . | |||||||||||
Return true if the implementation is castable to
CompositeType . | |||||||||||
Should the parent be considered dirty, given both the old and current value?
| |||||||||||
Return true if the implementation is castable to
EntityType . | |||||||||||
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).
| |||||||||||
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. | |||||||||||
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent
state) taking a shortcut for entity references.
| |||||||||||
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.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.hibernate.type.Type
|
Reconstruct the object from its cached "disassembled" state.
cached | the disassembled state from the cache |
---|---|
session | the session |
owner | the parent entity object |
HibernateException |
---|
Called before assembling a query result set from the query cache, to allow batch fetching of entities missing from the second-level cache.
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 cacheable "disassembled" representation of the object.
value | the value to cache |
---|---|
session | the session |
owner | optional parent entity object (needed for collections) |
HibernateException |
---|
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 |
Get the type of a semi-resolved value.
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 |
Return true if the implementation is castable to AnyType
. Essentially a polymorphic
version of (type instanceof AnyType.class)
.
AnyType
is additionally an AssociationType
; so if this method returns true,
isAssociationType()
should also return true.AnyType
implementor; false otherwise.
Return true if the implementation is castable to AssociationType
. This does not necessarily imply that
the type actually represents an association. Essentially a polymorphic version of
(type instanceof AssociationType.class)
AssociationType
implementor; false otherwise.
Return true if the implementation is castable to CollectionType
. Essentially a polymorphic version of
(type instanceof CollectionType.class)
CollectionType
is additionally an AssociationType
; so if this method returns true,
isAssociationType()
should also return true.CollectionType
implementor; false otherwise.
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?
old | the old value |
---|---|
current | the current value |
session | The session from which the request originated. |
HibernateException |
---|
Return true if the implementation is castable to EntityType
. Essentially a polymorphic
version of (type instanceof EntityType.class)
.
EntityType
is additionally an AssociationType
; so if this method returns true,
isAssociationType()
should also return true.EntityType
implementor; false otherwise.
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. |
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 |
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 |
---|
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 |
---|
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 |
---|