java.lang.Object | ||
↳ | org.hibernate.type.AbstractType | |
↳ | org.hibernate.type.EntityType |
Known Direct Subclasses |
Known Indirect Subclasses |
Base for types which map associations to persistent entities.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
isEmbeddedInXML | |||||||||||
uniqueKeyPropertyName |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs the requested entity type mapping.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Perform a
Comparator style comparison between values
| |||||||||||
Return a deep copy of the persistent state, stopping at entities and at
collections.
| |||||||||||
Parse the XML representation of an instance.
| |||||||||||
The name of the associated entity.
| |||||||||||
The name of the associated entity.
| |||||||||||
Retrieves the
Joinable defining the associated entity. | |||||||||||
Get a hash code, consistent with persistence "equality".
| |||||||||||
The name of the property on the associated entity to which our FK
refers
| |||||||||||
Determine the type of either (1) the identifier if we reference the
associated entity's PK or (2) the unique key to which we refer (i.e.
| |||||||||||
Get the name of a property in the owning entity
that provides the join key (null if the identifier)
| |||||||||||
For entity types, the name correlates to the associated entity name.
| |||||||||||
Get the "filtering" SQL fragment that is applied in the
SQL on clause, in addition to the usual join condition
| |||||||||||
The name of a unique property of the associated entity
that provides the join key (null if the identifier of
an entity, or key of a collection)
| |||||||||||
This returns the wrong class for an entity with a proxy, or for a named
entity.
| |||||||||||
Get the type of a semi-resolved value.
| |||||||||||
An entity type is a type of association type
| |||||||||||
Explicitly, an entity type is an entity type ;)
| |||||||||||
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent
state).
| |||||||||||
Is the association modeled here a 1-1 according to the logical moidel?
| |||||||||||
Are objects of this type mutable.
| |||||||||||
Is the association modeled here defined as a 1-1 in the database (physical model)?
| |||||||||||
Does this association foreign key reference the primary key of the other table?
Otherwise, it references a property-ref.
| |||||||||||
Two entities are considered the same when their instances are the same.
| |||||||||||
Load an instance by a unique key that is not the primary key.
| |||||||||||
Retrieve an instance of the mapped class from a JDBC resultset.
| |||||||||||
Retrieve an instance of the mapped class from a JDBC resultset.
| |||||||||||
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.
| |||||||||||
Resolve an identifier or unique key value
| |||||||||||
A representation of the value to be embedded in an XML element.
| |||||||||||
Generate a loggable representation of an instance of the value mapped by this type.
| |||||||||||
Generates a string representation of this type.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Resolve an identifier via a load.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.hibernate.type.AbstractType
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.hibernate.type.AssociationType
| |||||||||||
From interface
org.hibernate.type.Type
|
Constructs the requested entity type mapping.
scope | The type scope |
---|---|
entityName | The name of the associated entity. |
uniqueKeyPropertyName | The property-ref name, or null if we reference the PK of the associated entity. |
eager | Is eager fetching enabled. |
isEmbeddedInXML | Should values of this mapping be embedded in XML modes? |
unwrapProxy | Is unwrapping of proxies allowed for this association; unwrapping says to return the "implementation target" of lazy prooxies; typically only possible with lazy="no-proxy". |
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.
value | generally a collection element or entity field |
---|
Parse the XML representation of an instance.
HibernateException |
---|
The name of the associated entity.
The name of the associated entity.
factory | The session factory, for resolution. |
---|
Retrieves the Joinable
defining the associated entity.
factory | The session factory. |
---|
MappingException | Generally indicates an invalid entity name. |
---|
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 |
The name of the property on the associated entity to which our FK refers
factory | The mappings... |
---|
MappingException | Generally, if unable to resolve the associated entity name |
---|
Determine the type of either (1) the identifier if we reference the associated entity's PK or (2) the unique key to which we refer (i.e. the property-ref).
factory | The mappings... |
---|
MappingException | Generally, if unable to resolve the associated entity name or unique key property name. |
---|
Get the name of a property in the owning entity that provides the join key (null if the identifier)
For entity types, the name correlates to the associated entity name.
Get the "filtering" SQL fragment that is applied in the SQL on clause, in addition to the usual join condition
MappingException |
---|
The name of a unique property of the associated entity that provides the join key (null if the identifier of an entity, or key of a collection)
This returns the wrong class for an entity with a proxy, or for a named entity. Theoretically it should return the proxy class, but it doesn't.
The problem here is that we do not necessarily have a ref to the associated entity persister (nor to the session factory, to look it up) which is really needed to "do the right thing" here...Get the type of a semi-resolved value.
An entity type is a type of association type
Explicitly, an entity type is an entity type ;)
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 |
Is the association modeled here a 1-1 according to the logical moidel?
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.)
Is the association modeled here defined as a 1-1 in the database (physical model)?
Does this association foreign key reference the primary key of the other table? Otherwise, it references a property-ref.
Two entities are considered the same when their instances are the same.
x | One entity instance |
---|---|
y | Another entity instance |
entityMode | The entity mode. |
Load an instance by a unique key that is not the primary key.
entityName | The name of the entity to load |
---|---|
uniqueKeyPropertyName | The name of the property defining the uniqie key. |
key | The unique key property value. |
session | The originating session. |
HibernateException | generally indicates problems performing the load. |
---|
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 |
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 |
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 |
---|
Resolve an identifier or unique key value
value | an identifier or value returned by hydrate() |
---|---|
session | the session |
owner | the parent entity |
HibernateException |
---|
A representation of the value to be embedded in an XML element.
HibernateException |
---|
Generate a loggable representation of an instance of the value mapped by this type.
value | The instance to be logged. |
---|---|
factory | The session factory. |
HibernateException | Generally some form of resolution problem. |
---|
HibernateException |
---|
Resolve an identifier via a load.
id | The entity id to resolve |
---|---|
session | The orginating session. |
HibernateException | Indicates problems performing the load. |
---|