public abstract class AbstractEntityTuplizer extends java.lang.Object implements EntityTuplizer
Modifier and Type | Field and Description |
---|---|
protected Getter[] |
getters |
protected boolean |
hasCustomAccessors |
protected int |
propertySpan |
protected Setter[] |
setters |
Constructor and Description |
---|
AbstractEntityTuplizer(EntityMetamodel entityMetamodel,
PersistentClass mappingInfo)
Constructs a new AbstractEntityTuplizer instance.
|
Modifier and Type | Method and Description |
---|---|
void |
afterInitialize(java.lang.Object entity,
SessionImplementor session)
Called just after the entities properties have been initialized.
|
protected abstract Instantiator |
buildInstantiator(EntityMetamodel entityMetamodel,
PersistentClass mappingInfo)
Build an appropriate Instantiator for the given mapped entity.
|
protected abstract Getter |
buildPropertyGetter(Property mappedProperty,
PersistentClass mappedEntity)
Build an appropriate Getter for the given property.
|
protected abstract Setter |
buildPropertySetter(Property mappedProperty,
PersistentClass mappedEntity)
Build an appropriate Setter for the given property.
|
protected abstract ProxyFactory |
buildProxyFactory(PersistentClass mappingInfo,
Getter idGetter,
Setter idSetter)
Build an appropriate ProxyFactory for the given mapped entity.
|
java.lang.Object |
createProxy(java.io.Serializable id,
SessionImplementor session)
Generates an appropriate proxy representation of this entity for this
entity-mode.
|
protected java.lang.Object |
getComponentValue(ComponentType type,
java.lang.Object component,
java.lang.String propertyPath)
Extract a component property value.
|
protected EntityMetamodel |
getEntityMetamodel() |
protected java.lang.String |
getEntityName()
Retrieves the defined entity-name for the tuplized entity.
|
protected SessionFactoryImplementor |
getFactory() |
Getter |
getGetter(int i)
Retrieve the getter for the specified property.
|
java.io.Serializable |
getIdentifier(java.lang.Object entity)
Extract the identifier value from the given entity.
|
java.io.Serializable |
getIdentifier(java.lang.Object entity,
SessionImplementor session)
Extract the identifier value from the given entity.
|
Getter |
getIdentifierGetter()
Retrieve the getter for the identifier property.
|
Type |
getIdentifierMapperType() |
protected Instantiator |
getInstantiator() |
java.lang.Object |
getPropertyValue(java.lang.Object entity,
int i)
Extract the value of a particular property from the given entity.
|
java.lang.Object |
getPropertyValue(java.lang.Object entity,
java.lang.String propertyPath)
Extract the value of a particular property from the given entity.
|
java.lang.Object[] |
getPropertyValues(java.lang.Object entity)
Extract the current values contained on the given entity.
|
java.lang.Object[] |
getPropertyValuesToInsert(java.lang.Object entity,
java.util.Map mergeMap,
SessionImplementor session)
Extract the values of the insertable properties of the entity (including backrefs)
|
protected ProxyFactory |
getProxyFactory() |
protected java.util.Set |
getSubclassEntityNames()
Retrieves the defined entity-names for any subclasses defined for this
entity.
|
java.lang.Object |
getVersion(java.lang.Object entity)
Extract the value of the version property from the given entity.
|
Getter |
getVersionGetter()
Retrieve the getter for the version property.
|
boolean |
hasProxy()
Does this entity, for this mode, present a possibility for proxying?
|
java.lang.Object |
instantiate()
Generate a new, empty entity.
|
java.lang.Object |
instantiate(java.io.Serializable id)
Create an entity instance initialized with the given identifier.
|
java.lang.Object |
instantiate(java.io.Serializable id,
SessionImplementor session)
Create an entity instance initialized with the given identifier.
|
boolean |
isInstance(java.lang.Object object)
Is the given object considered an instance of the the entity (acconting
for entity-mode) managed by this tuplizer.
|
boolean |
isLifecycleImplementor()
|
void |
resetIdentifier(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.
|
void |
resetIdentifier(java.lang.Object entity,
java.io.Serializable currentId,
java.lang.Object currentVersion,
SessionImplementor session)
Inject the given identifier and version into the entity, in order to
"roll back" to their original values.
|
void |
setIdentifier(java.lang.Object entity,
java.io.Serializable id)
Inject the identifier value into the given entity.
|
void |
setIdentifier(java.lang.Object entity,
java.io.Serializable id,
SessionImplementor session)
Inject the identifier value into the given entity.
|
void |
setPropertyValue(java.lang.Object entity,
int i,
java.lang.Object value)
Inject the value of a particular property.
|
void |
setPropertyValue(java.lang.Object entity,
java.lang.String propertyName,
java.lang.Object value)
Inject the value of a particular property.
|
void |
setPropertyValues(java.lang.Object entity,
java.lang.Object[] values)
Inject the given values into the given entity.
|
protected boolean |
shouldGetAllProperties(java.lang.Object entity) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
determineConcreteSubclassEntityName, getConcreteProxyClass, getEntityMode, getEntityNameResolvers
getMappedClass
protected final Getter[] getters
protected final Setter[] setters
protected final int propertySpan
protected final boolean hasCustomAccessors
public AbstractEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappingInfo)
entityMetamodel
- The "interpreted" information relating to the mapped entity.mappingInfo
- The parsed "raw" mapping data relating to the given entity.public Type getIdentifierMapperType()
protected abstract Getter buildPropertyGetter(Property mappedProperty, PersistentClass mappedEntity)
mappedProperty
- The property to be accessed via the built Getter.mappedEntity
- The entity information regarding the mapped entity owning this property.protected abstract Setter buildPropertySetter(Property mappedProperty, PersistentClass mappedEntity)
mappedProperty
- The property to be accessed via the built Setter.mappedEntity
- The entity information regarding the mapped entity owning this property.protected abstract Instantiator buildInstantiator(EntityMetamodel entityMetamodel, PersistentClass mappingInfo)
mappingInfo
- The mapping information regarding the mapped entity.protected abstract ProxyFactory buildProxyFactory(PersistentClass mappingInfo, Getter idGetter, Setter idSetter)
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.protected java.lang.String getEntityName()
protected java.util.Set getSubclassEntityNames()
public java.io.Serializable getIdentifier(java.lang.Object entity) throws HibernateException
EntityTuplizer
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 occurs accessing its value.public java.io.Serializable getIdentifier(java.lang.Object entity, SessionImplementor session)
EntityTuplizer
getIdentifier
in interface EntityTuplizer
entity
- The entity from which to extract the identifier value.session
- The session from which is requests originatespublic void setIdentifier(java.lang.Object entity, java.io.Serializable id) throws HibernateException
EntityTuplizer
setIdentifier
in interface EntityTuplizer
entity
- The entity to inject with the identifier value.id
- The value to be injected as the identifier.HibernateException
public void setIdentifier(java.lang.Object entity, java.io.Serializable id, SessionImplementor session)
EntityTuplizer
setIdentifier
in interface EntityTuplizer
entity
- The entity to inject with the identifier value.id
- The value to be injected as the identifier.session
- The session from which is requests originatespublic void resetIdentifier(java.lang.Object entity, java.io.Serializable currentId, java.lang.Object currentVersion)
EntityTuplizer
resetIdentifier
in interface EntityTuplizer
entity
- The entity for which to reset the id/version valuescurrentId
- The identifier value to inject into the entity.currentVersion
- The version value to inject into the entity.public void resetIdentifier(java.lang.Object entity, java.io.Serializable currentId, java.lang.Object currentVersion, SessionImplementor session)
EntityTuplizer
resetIdentifier
in interface EntityTuplizer
entity
- The entity for which to reset the id/version valuescurrentId
- The identifier value to inject into the entity.currentVersion
- The version value to inject into the entity.session
- The session from which the request originatedpublic java.lang.Object getVersion(java.lang.Object entity) throws HibernateException
EntityTuplizer
getVersion
in interface EntityTuplizer
entity
- The entity from which to extract the version value.HibernateException
- Indicates a problem accessing the version propertyprotected boolean shouldGetAllProperties(java.lang.Object entity)
public java.lang.Object[] getPropertyValues(java.lang.Object entity) throws HibernateException
Tuplizer
getPropertyValues
in interface Tuplizer
entity
- The entity from which to extract values.HibernateException
public java.lang.Object[] getPropertyValuesToInsert(java.lang.Object entity, java.util.Map mergeMap, SessionImplementor session) throws HibernateException
EntityTuplizer
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.HibernateException
- Indicates a problem access the propertiespublic java.lang.Object getPropertyValue(java.lang.Object entity, int i) throws HibernateException
Tuplizer
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.HibernateException
public java.lang.Object getPropertyValue(java.lang.Object entity, java.lang.String propertyPath) throws HibernateException
EntityTuplizer
getPropertyValue
in interface EntityTuplizer
entity
- The entity from which to extract the property value.propertyPath
- The name of the property for which to extract the value.HibernateException
- Indicates a problem access the propertyprotected java.lang.Object getComponentValue(ComponentType type, java.lang.Object component, java.lang.String propertyPath)
type
- The component property types.component
- The component instance itself.propertyPath
- The property path for the property to be extracted.public void setPropertyValues(java.lang.Object entity, java.lang.Object[] values) throws HibernateException
Tuplizer
setPropertyValues
in interface Tuplizer
entity
- The entity.values
- The values to be injected.HibernateException
public void setPropertyValue(java.lang.Object entity, int i, java.lang.Object value) throws HibernateException
EntityTuplizer
setPropertyValue
in interface EntityTuplizer
entity
- The entity into which to inject the value.i
- The property's index.value
- The property value to inject.HibernateException
- Indicates a problem access the propertypublic void setPropertyValue(java.lang.Object entity, java.lang.String propertyName, java.lang.Object value) throws HibernateException
EntityTuplizer
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.HibernateException
- Indicates a problem access the propertypublic final java.lang.Object instantiate(java.io.Serializable id) throws HibernateException
EntityTuplizer
instantiate
in interface EntityTuplizer
id
- The identifier value for the entity to be instantiated.HibernateException
public final java.lang.Object instantiate(java.io.Serializable id, SessionImplementor session)
EntityTuplizer
instantiate
in interface EntityTuplizer
id
- The identifier value for the entity to be instantiated.session
- The session from which is requests originatespublic final java.lang.Object instantiate() throws HibernateException
Tuplizer
instantiate
in interface Tuplizer
HibernateException
public void afterInitialize(java.lang.Object entity, SessionImplementor session)
EntityTuplizer
afterInitialize
in interface EntityTuplizer
entity
- The entity being initialized.session
- The session initializing this entity.public final boolean isInstance(java.lang.Object object)
Tuplizer
isInstance
in interface Tuplizer
object
- The object to be checked.public boolean hasProxy()
EntityTuplizer
hasProxy
in interface EntityTuplizer
public final java.lang.Object createProxy(java.io.Serializable id, SessionImplementor session) throws HibernateException
EntityTuplizer
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.HibernateException
- Indicates an error generating the proxy.public boolean isLifecycleImplementor()
EntityTuplizer
isLifecycleImplementor
in interface EntityTuplizer
protected final EntityMetamodel getEntityMetamodel()
protected final SessionFactoryImplementor getFactory()
protected final Instantiator getInstantiator()
protected final ProxyFactory getProxyFactory()
public java.lang.String toString()
toString
in class java.lang.Object
public Getter getIdentifierGetter()
EntityTuplizer
getIdentifierGetter
in interface EntityTuplizer
public Getter getVersionGetter()
EntityTuplizer
getVersionGetter
in interface EntityTuplizer
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.