Top Description Inners Fields Constructors Methods
org.hibernate.tuple.entity

public abstract Class AbstractEntityTuplizer

extends Object
implements EntityTuplizer
Class Inheritance
All Implemented Interfaces
org.hibernate.tuple.entity.EntityTuplizer, org.hibernate.tuple.Tuplizer
Known Direct Subclasses
org.hibernate.tuple.entity.Dom4jEntityTuplizer, org.hibernate.tuple.entity.DynamicMapEntityTuplizer, org.hibernate.tuple.entity.PojoEntityTuplizer
Imports
java.io.Serializable, java.util.Iterator, .Map, .Set, org.slf4j.Logger, .LoggerFactory, org.hibernate.EntityMode, .HibernateException, .MappingException, org.hibernate.engine.EntityEntry, .EntityKey, .SessionFactoryImplementor, .SessionImplementor, org.hibernate.event.EventSource, .PersistEvent, org.hibernate.id.Assigned, org.hibernate.intercept.LazyPropertyInitializer, org.hibernate.mapping.Component, .PersistentClass, .Property, org.hibernate.property.Getter, .Setter, org.hibernate.proxy.HibernateProxy, .ProxyFactory, org.hibernate.tuple.Instantiator, .StandardProperty, .VersionProperty, org.hibernate.type.ComponentType, .CompositeType, .EntityType, .Type

Support for tuplizers relating to entities.
Authors
Steve Ebersole, Gavin King

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static interface
private static class

Field Summary

Modifier and TypeField and Description
private final EntityMetamodel
protected final Getter[]
protected final boolean
private final CompositeType
private final Getter
private final Setter
private final Instantiator
private static final Logger
private final AbstractEntityTuplizer.MappedIdentifierValueMarshaller
protected final int
private final ProxyFactory
protected final Setter[]

Constructor Summary

AccessConstructor and Description
public
AbstractEntityTuplizer(EntityMetamodel
The "interpreted" information relating to the mapped entity.
entityMetamodel
,
PersistentClass
The parsed "raw" mapping data relating to the given entity.
mappingInfo
)

Constructs a new AbstractEntityTuplizer instance.

Method Summary

Modifier and TypeMethod and Description
public void
afterInitialize(Object
The entity being initialized.
entity
,
boolean
Are defined lazy properties currently unfecthed
lazyPropertiesAreUnfetched
,
SessionImplementor
The session initializing this entity.
session
)

Implements org.hibernate.tuple.entity.EntityTuplizer.afterInitialize.

Called just after the entities properties have been initialized.
protected abstract Instantiator

Returns:

An appropriate Instantiator instance.
buildInstantiator
(PersistentClass
The mapping information regarding the mapped entity.
mappingInfo
)

Build an appropriate Instantiator for the given mapped entity.

private static AbstractEntityTuplizer.MappedIdentifierValueMarshaller
buildMappedIdentifierValueMarshaller(ComponentType mappedIdClassComponentType, ComponentType virtualIdComponent)

protected abstract Getter

Returns:

An appropriate Getter instance.
buildPropertyGetter
(Property
The property to be accessed via the built Getter.
mappedProperty
,
PersistentClass
The entity information regarding the mapped entity owning this property.
mappedEntity
)

Build an appropriate Getter for the given property.

protected abstract Setter

Returns:

An appropriate Setter instance.
buildPropertySetter
(Property
The property to be accessed via the built Setter.
mappedProperty
,
PersistentClass
The entity information regarding the mapped entity owning this property.
mappedEntity
)

Build an appropriate Setter for the given property.

protected abstract ProxyFactory

Returns:

An appropriate ProxyFactory instance.
buildProxyFactory
(PersistentClass
The mapping information regarding the mapped entity.
mappingInfo
,
Getter
The constructed Getter relating to the entity's id property.
idGetter
,
Setter
The constructed Setter relating to the entity's id property.
idSetter
)

Build an appropriate ProxyFactory for the given mapped entity.

public final Object
createProxy(Serializable
The id of the instance for which to generate a proxy.
id
,
SessionImplementor
The session to which the proxy should be bound.
session
)

Implements org.hibernate.tuple.entity.EntityTuplizer.createProxy.

Generates an appropriate proxy representation of this entity for this entity-mode.
private int
findSubPropertyIndex(ComponentType type, String subPropertyName)

protected Object

Returns:

The property value extracted.
getComponentValue
(ComponentType
The component property types.
type
,
Object
The component instance itself.
component
,
String
The property path for the property to be extracted.
propertyPath
)

Extract a component property value.

protected final EntityMetamodel
protected String

Returns:

The entity-name.
getEntityName
()

Retreives the defined entity-name for the tuplized entity.

protected final SessionFactoryImplementor
public Getter
getGetter(int
The property index.
i
)

Implements org.hibernate.tuple.Tuplizer.getGetter.

Retrieve the getter for the specified property.
public Serializable
getIdentifier(Object
The entity from which to extract the identifier value.
entity
)

Implements org.hibernate.tuple.entity.EntityTuplizer.getIdentifier.

Extract the identifier value from the given entity.
public Serializable
getIdentifier(Object
The entity from which to extract the identifier value.
entity
,
SessionImplementor
The session from which is requests originates
session
)

Implements org.hibernate.tuple.entity.EntityTuplizer.getIdentifier.

Extract the identifier value from the given entity.
public Getter
getIdentifierGetter()

Implements org.hibernate.tuple.entity.EntityTuplizer.getIdentifierGetter.

Retrieve the getter for the identifier property.
public Type
protected final Instantiator
public Object
getPropertyValue(Object
The entity from which to extract the property value.
entity
,
int
The index of the property for which to extract the value.
i
)

Implements org.hibernate.tuple.Tuplizer.getPropertyValue.

Extract the value of a particular property from the given entity.
public Object
getPropertyValue(Object
The entity from which to extract the property value.
entity
,
String
The name of the property for which to extract the value.
propertyPath
)

Implements org.hibernate.tuple.entity.EntityTuplizer.getPropertyValue.

Extract the value of a particular property from the given entity.
public Object[]
getPropertyValues(Object
The entity from which to extract values.
entity
)

Implements org.hibernate.tuple.Tuplizer.getPropertyValues.

Extract the current values contained on the given entity.
public Object[]
getPropertyValuesToInsert(Object
The entity from which to extract.
entity
,
Map<K, V>
a map of instances being merged to merged instances
mergeMap
,
SessionImplementor
The session in which the resuest is being made.
session
)

Implements org.hibernate.tuple.entity.EntityTuplizer.getPropertyValuesToInsert.

Extract the values of the insertable properties of the entity (including backrefs)
protected final ProxyFactory
protected Set<E>

Returns:

Any subclass entity-names.
getSubclassEntityNames
()

Retrieves the defined entity-names for any subclasses defined for this entity.

public Object
getVersion(Object
The entity from which to extract the version value.
entity
)

Implements org.hibernate.tuple.entity.EntityTuplizer.getVersion.

Extract the value of the version property from the given entity.
public Getter
getVersionGetter()

Implements org.hibernate.tuple.entity.EntityTuplizer.getVersionGetter.

Retrieve the getter for the version property.
public boolean
hasProxy()

Implements org.hibernate.tuple.entity.EntityTuplizer.hasProxy.

Does this entity, for this mode, present a possibility for proxying?
public boolean
hasUninitializedLazyProperties(Object
The entity to be check for uninitialized lazy properties.
entity
)

Implements org.hibernate.tuple.entity.EntityTuplizer.hasUninitializedLazyProperties.

Does the given entity instance have any currently uninitialized lazy properties?
public final Object
instantiate(Serializable
The identifier value for the entity to be instantiated.
id
)

Implements org.hibernate.tuple.entity.EntityTuplizer.instantiate.

Create an entity instance initialized with the given identifier.
public final Object
instantiate(Serializable
The identifier value for the entity to be instantiated.
id
,
SessionImplementor
The session from which is requests originates
session
)

Implements org.hibernate.tuple.entity.EntityTuplizer.instantiate.

Create an entity instance initialized with the given identifier.
public final Object
instantiate()

Implements org.hibernate.tuple.Tuplizer.instantiate.

Generate a new, empty entity.
public final boolean
isInstance(Object
The object to be checked.
object
)

Implements org.hibernate.tuple.Tuplizer.isInstance.

Is the given object considered an instance of the the entity (acconting for entity-mode) managed by this tuplizer.
public boolean
public boolean
public void
resetIdentifier(Object
The entity for which to reset the id/version values
entity
,
Serializable
The identifier value to inject into the entity.
currentId
,
Object
The version value to inject into the entity.
currentVersion
)

Implements org.hibernate.tuple.entity.EntityTuplizer.resetIdentifier.

Inject the given identifier and version into the entity, in order to "roll back" to their original values.
public void
resetIdentifier(Object
The entity for which to reset the id/version values
entity
,
Serializable
The identifier value to inject into the entity.
currentId
,
Object
The version value to inject into the entity.
currentVersion
,
SessionImplementor
The session from which the request originated
session
)

Implements org.hibernate.tuple.entity.EntityTuplizer.resetIdentifier.

Inject the given identifier and version into the entity, in order to "roll back" to their original values.
public void
setIdentifier(Object
The entity to inject with the identifier value.
entity
,
Serializable
The value to be injected as the identifier.
id
)

Implements org.hibernate.tuple.entity.EntityTuplizer.setIdentifier.

Inject the identifier value into the given entity.
public void
setIdentifier(Object
The entity to inject with the identifier value.
entity
,
Serializable
The value to be injected as the identifier.
id
,
SessionImplementor
The session from which is requests originates
session
)

Implements org.hibernate.tuple.entity.EntityTuplizer.setIdentifier.

Inject the identifier value into the given entity.
public void
setPropertyValue(Object
The entity into which to inject the value.
entity
,
int
The property's index.
i
,
Object
The property value to inject.
value
)

Implements org.hibernate.tuple.entity.EntityTuplizer.setPropertyValue.

Inject the value of a particular property.
public void
setPropertyValue(Object
The entity into which to inject the value.
entity
,
String
The name of the property.
propertyName
,
Object
The property value to inject.
value
)

Implements org.hibernate.tuple.entity.EntityTuplizer.setPropertyValue.

Inject the value of a particular property.
public void
setPropertyValues(Object
The entity.
entity
,
Object[]
The values to be injected.
values
)

Implements org.hibernate.tuple.Tuplizer.setPropertyValues.

Inject the given values into the given entity.
protected boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait