FileDocCategorySizeDatePackage
EntityTuplizer.javaAPI DocHibernate 3.2.56762Thu Jul 13 19:09:20 BST 2006org.hibernate.tuple.entity

EntityTuplizer

public interface EntityTuplizer implements org.hibernate.tuple.Tuplizer
Defines further responsibilities reagarding tuplization based on a mapped entity.

EntityTuplizer implementations should have the following constructor signature: (org.hibernate.tuple.entity.EntityMetamodel, org.hibernate.mapping.PersistentClass)

author
Gavin King
author
Steve Ebersole

Fields Summary
Constructors Summary
Methods Summary
public voidafterInitialize(java.lang.Object entity, boolean lazyPropertiesAreUnfetched, org.hibernate.engine.SessionImplementor session)
Called just after the entities properties have been initialized.

param
entity The entity being initialized.
param
lazyPropertiesAreUnfetched Are defined lazy properties currently unfecthed
param
session The session initializing this entity.

public java.lang.ObjectcreateProxy(java.io.Serializable id, org.hibernate.engine.SessionImplementor session)
Generates an appropriate proxy representation of this entity for this entity-mode.

param
id The id of the instance for which to generate a proxy.
param
session The session to which the proxy should be bound.
return
The generate proxies.
throws
HibernateException Indicates an error generating the proxy.

public java.lang.ClassgetConcreteProxyClass()
Returns the java class to which generated proxies will be typed.

return
The java class to which generated proxies will be typed

public java.io.SerializablegetIdentifier(java.lang.Object entity)
Extract the identifier value from the given entity.

param
entity The entity from which to extract the identifier value.
return
The identifier value.
throws
HibernateException If the entity does not define an identifier property, or an error occurrs accessing its value.

public java.lang.ObjectgetPropertyValue(java.lang.Object entity, java.lang.String propertyName)
Extract the value of a particular property from the given entity.

param
entity The entity from which to extract the property value.
param
propertyName The name of the property for which to extract the value.
return
The current value of the given property on the given entity.
throws
HibernateException

public java.lang.Object[]getPropertyValuesToInsert(java.lang.Object entity, java.util.Map mergeMap, org.hibernate.engine.SessionImplementor session)
Extract the values of the insertable properties of the entity (including backrefs)

param
entity The entity from which to extract.
param
mergeMap a map of instances being merged to merged instances
param
session The session in which the resuest is being made.
return
The insertable property values.
throws
HibernateException

public java.lang.ObjectgetVersion(java.lang.Object entity)
Extract the value of the version property from the given entity.

param
entity The entity from which to extract the version value.
return
The value of the version property, or null if not versioned.
throws
HibernateException

public booleanhasProxy()
Does this entity, for this mode, present a possibility for proxying?

return
True if this tuplizer can generate proxies for this entity.

public booleanhasUninitializedLazyProperties(java.lang.Object entity)
Does the given entity instance have any currently uninitialized lazy properties?

param
entity The entity to be check for uninitialized lazy properties.
return
True if uninitialized lazy properties were found; false otherwise.

public java.lang.Objectinstantiate(java.io.Serializable id)
Create an entity instance initialized with the given identifier.

param
id The identifier value for the entity to be instantiated.
return
The instantiated entity.
throws
HibernateException

public booleanisInstrumented()
Is it an instrumented POJO?

public booleanisLifecycleImplementor()
Does the {@link #getMappedClass() class} managed by this tuplizer implement the {@link org.hibernate.classic.Lifecycle} interface.

return
True if the Lifecycle interface is implemented; false otherwise.

public booleanisValidatableImplementor()
Does the {@link #getMappedClass() class} managed by this tuplizer implement the {@link org.hibernate.classic.Validatable} interface.

return
True if the Validatable interface is implemented; false otherwise.

public voidresetIdentifier(java.lang.Object entity, java.io.Serializable currentId, java.lang.Object currentVersion)
Inject the given identifier and version into the entity, in order to "roll back" to their original values.

param
currentId The identifier value to inject into the entity.
param
currentVersion The version value to inject into the entity.

public voidsetIdentifier(java.lang.Object entity, java.io.Serializable id)
Inject the identifier value into the given entity.

Has no effect if the entity does not define an identifier property

param
entity The entity to inject with the identifier value.
param
id The value to be injected as the identifier.
throws
HibernateException

public voidsetPropertyValue(java.lang.Object entity, int i, java.lang.Object value)
Inject the value of a particular property.

param
entity The entity into which to inject the value.
param
i The property's index.
param
value The property value to inject.
throws
HibernateException

public voidsetPropertyValue(java.lang.Object entity, java.lang.String propertyName, java.lang.Object value)
Inject the value of a particular property.

param
entity The entity into which to inject the value.
param
propertyName The name of the property.
param
value The property value to inject.
throws
HibernateException