afterInitialize
public void afterInitialize(Object entity,
boolean lazyPropertiesAreUnfetched,
SessionImplementor session)
Called just after the entities properties have been initialized.
- afterInitialize in interface EntityTuplizer
entity
- The entity being initialized.lazyPropertiesAreUnfetched
- Are defined lazy properties currently unfecthedsession
- The session initializing this entity.
buildInstantiator
protected abstract Instantiator buildInstantiator(PersistentClass mappingInfo)
Build an appropriate Instantiator for the given mapped entity.
mappingInfo
- The mapping information regarding the mapped entity.
- An appropriate Instantiator instance.
buildPropertyGetter
protected abstract Getter buildPropertyGetter(Property mappedProperty,
PersistentClass mappedEntity)
Build an appropriate Getter for the given property.
mappedProperty
- The property to be accessed via the built Getter.mappedEntity
- The entity information regarding the mapped entity owning this property.
- An appropriate Getter instance.
buildPropertySetter
protected abstract Setter buildPropertySetter(Property mappedProperty,
PersistentClass mappedEntity)
Build an appropriate Setter for the given property.
mappedProperty
- The property to be accessed via the built Setter.mappedEntity
- The entity information regarding the mapped entity owning this property.
- An appropriate Setter instance.
buildProxyFactory
protected abstract ProxyFactory buildProxyFactory(PersistentClass mappingInfo,
Getter idGetter,
Setter idSetter)
Build an appropriate ProxyFactory for the given mapped entity.
mappingInfo
- The mapping information regarding the mapped entity.idGetter
- The constructed Getter relating to the entity's id property.idSetter
- The constructed Setter relating to the entity's id property.
- An appropriate ProxyFactory instance.
createProxy
public final Object createProxy(Serializable id,
SessionImplementor session)
throws HibernateException
Generates an appropriate proxy representation of this entity for this
entity-mode.
- createProxy in interface EntityTuplizer
id
- The id of the instance for which to generate a proxy.session
- The session to which the proxy should be bound.
getComponentValue
protected Object getComponentValue(ComponentType type,
Object component,
String propertyPath)
Extract a component property value.
type
- The component property types.component
- The component instance itself.propertyPath
- The property path for the property to be extracted.
- The property value extracted.
getEntityMode
protected abstract EntityMode getEntityMode()
Return the entity-mode handled by this tuplizer instance.
getEntityName
protected String getEntityName()
Retreives the defined entity-name for the tuplized entity.
getIdentifier
public Serializable getIdentifier(Object entity)
throws HibernateException
Extract the identifier value from the given entity.
- getIdentifier in interface EntityTuplizer
entity
- The entity from which to extract the identifier value.
HibernateException
- If the entity does not define an identifier property, or an
error occurrs accessing its value.
getInstantiator
protected final Instantiator getInstantiator()
getPropertyValue
public Object getPropertyValue(Object entity,
String propertyPath)
throws HibernateException
Extract the value of a particular property from the given entity.
- getPropertyValue in interface EntityTuplizer
entity
- The entity from which to extract the property value.
- The current value of the given property on the given entity.
getPropertyValue
public Object getPropertyValue(Object entity,
int i)
throws HibernateException
Extract the value of a particular property from the given entity.
- getPropertyValue in interface Tuplizer
entity
- The entity from which to extract the property value.i
- The index of the property for which to extract the value.
- The current value of the given property on the given entity.
getPropertyValues
public Object[] getPropertyValues(Object entity)
throws HibernateException
Extract the current values contained on the given entity.
- getPropertyValues in interface Tuplizer
entity
- The entity from which to extract values.
- The current property values.
getPropertyValuesToInsert
public Object[] getPropertyValuesToInsert(Object entity,
Map mergeMap,
SessionImplementor session)
throws HibernateException
Extract the values of the insertable properties of the entity (including backrefs)
- getPropertyValuesToInsert in interface EntityTuplizer
entity
- The entity from which to extract.mergeMap
- a map of instances being merged to merged instancessession
- The session in which the resuest is being made.
- The insertable property values.
getProxyFactory
protected final ProxyFactory getProxyFactory()
getSubclassEntityNames
protected Set getSubclassEntityNames()
Retreives the defined entity-names for any subclasses defined for this
entity.
- Any subclass entity-names.
getVersion
public Object getVersion(Object entity)
throws HibernateException
Extract the value of the version property from the given entity.
- getVersion in interface EntityTuplizer
entity
- The entity from which to extract the version value.
- The value of the version property, or null if not versioned.
hasProxy
public boolean hasProxy()
Does this entity, for this mode, present a possibility for proxying?
- hasProxy in interface EntityTuplizer
- True if this tuplizer can generate proxies for this entity.
hasUninitializedLazyProperties
public boolean hasUninitializedLazyProperties(Object entity)
Does the given entity instance have any currently uninitialized lazy properties?
- hasUninitializedLazyProperties in interface EntityTuplizer
entity
- The entity to be check for uninitialized lazy properties.
- True if uninitialized lazy properties were found; false otherwise.
instantiate
public final Object instantiate(Serializable id)
throws HibernateException
Create an entity instance initialized with the given identifier.
- instantiate in interface EntityTuplizer
id
- The identifier value for the entity to be instantiated.
isInstance
public final boolean isInstance(Object object)
Is the given object considered an instance of the the entity (acconting
for entity-mode) managed by this tuplizer.
- isInstance in interface Tuplizer
object
- The object to be checked.
- True if the object is considered as an instance of this entity
within the given mode.
isLifecycleImplementor
public boolean isLifecycleImplementor()
Does the
class
managed by this tuplizer implement
the
Lifecycle
interface.
- isLifecycleImplementor in interface EntityTuplizer
- True if the Lifecycle interface is implemented; false otherwise.
isValidatableImplementor
public boolean isValidatableImplementor()
Does the
class
managed by this tuplizer implement
the
Validatable
interface.
- isValidatableImplementor in interface EntityTuplizer
- True if the Validatable interface is implemented; false otherwise.
resetIdentifier
public void resetIdentifier(Object entity,
Serializable currentId,
Object currentVersion)
Inject the given identifier and version into the entity, in order to
"roll back" to their original values.
- resetIdentifier in interface EntityTuplizer
currentId
- The identifier value to inject into the entity.currentVersion
- The version value to inject into the entity.
setIdentifier
public void setIdentifier(Object entity,
Serializable id)
throws HibernateException
Inject the identifier value into the given entity.
Has no effect if the entity does not define an identifier property
- setIdentifier in interface EntityTuplizer
entity
- The entity to inject with the identifier value.id
- The value to be injected as the identifier.
setPropertyValue
public void setPropertyValue(Object entity,
String propertyName,
Object value)
throws HibernateException
Inject the value of a particular property.
- setPropertyValue in interface EntityTuplizer
entity
- The entity into which to inject the value.propertyName
- The name of the property.value
- The property value to inject.
setPropertyValue
public void setPropertyValue(Object entity,
int i,
Object value)
throws HibernateException
Inject the value of a particular property.
- setPropertyValue in interface EntityTuplizer
entity
- The entity into which to inject the value.i
- The property's index.value
- The property value to inject.
setPropertyValues
public void setPropertyValues(Object entity,
Object[] values)
throws HibernateException
Inject the given values into the given entity.
- setPropertyValues in interface Tuplizer
entity
- The entity.values
- The values to be injected.
shouldGetAllProperties
protected boolean shouldGetAllProperties(Object entity)
toString
public String toString()