|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.hibernate.tuple.AbstractTuplizer
Support base class for EntityTuplizer implementations.
| Field Summary | |
protected Getter[] |
getters
|
protected boolean |
hasCustomAccessors
|
protected int |
propertySpan
|
protected Setter[] |
setters
|
| Constructor Summary | |
AbstractTuplizer(EntityMetamodel entityMetamodel,
PersistentClass mappedEntity)
|
|
| Method Summary | |
void |
afterInitialize(Object entity,
boolean lazyPropertiesAreUnfetched,
SessionImplementor session)
Called just after the entities properties have been initialized. |
protected abstract Instantiator |
buildInstantiator(PersistentClass mappingInfo)
|
protected abstract Getter |
buildPropertyGetter(Property mappedProperty,
PersistentClass mappedEntity)
|
protected abstract Setter |
buildPropertySetter(Property mappedProperty,
PersistentClass mappedEntity)
|
protected abstract ProxyFactory |
buildProxyFactory(PersistentClass mappingInfo,
Getter idGetter,
Setter idSetter)
|
Object |
createProxy(Serializable id,
SessionImplementor session)
Generates an appropriate proxy representation of this entity for this entity-mode. |
protected EntityMetamodel |
getEntityMetamodel()
|
protected abstract EntityMode |
getEntityMode()
|
String |
getEntityName()
|
protected SessionFactoryImplementor |
getFactory()
|
Serializable |
getIdentifier(Object entity)
Extract the identifier value from the given entity. |
protected Instantiator |
getInstantiator()
|
Object |
getPropertyValue(Object entity,
int i)
Extract the value of a particular property from the given entity. |
Object |
getPropertyValue(Object entity,
String propertyName)
Extract the value of a particular property from the given entity. |
Object[] |
getPropertyValues(Object entity)
Extract the current values contained on the given entity. |
Object[] |
getPropertyValuesToInsert(Object entity,
SessionImplementor session)
Extract the values of the insertable properties of the entity (including backrefs) |
protected ProxyFactory |
getProxyFactory()
|
Object |
getVersion(Object entity)
Extract the value of the version property from the given entity. |
boolean |
hasProxy()
Does this entity, for this mode, present a possibility for proxying? |
boolean |
hasUninitializedLazyProperties(Object entity)
Does the given entity instance have any currently uninitialized lazy properties? |
Object |
instantiate()
|
Object |
instantiate(Serializable id)
Create an entity instance initialized with the given identifier. |
boolean |
isInstance(Object object)
Is the given object considered an instance of the the entity (acconting for entity-mode) managed by this tuplizer. |
boolean |
isLifecycleImplementor()
Does the class managed by this tuplizer implement
the Lifecycle interface. |
boolean |
isValidatableImplementor()
Does the class managed by this tuplizer implement
the Validatable interface. |
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. |
void |
setIdentifier(Object entity,
Serializable id)
Inject the identifier value into the given entity. |
void |
setPropertyValue(Object entity,
int i,
Object value)
Inject the value of a particular property. |
void |
setPropertyValue(Object entity,
String propertyName,
Object value)
Inject the value of a particular property. |
void |
setPropertyValues(Object entity,
Object[] values)
Inject the given values into the given entity. |
protected boolean |
shouldGetAllProperties(Object entity)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.hibernate.tuple.EntityTuplizer |
getConcreteProxyClass, isLazyPropertyLoadingAvailable |
| Methods inherited from interface org.hibernate.tuple.Tuplizer |
getMappedClass |
| Field Detail |
protected final Getter[] getters
protected final Setter[] setters
protected final int propertySpan
protected final boolean hasCustomAccessors
| Constructor Detail |
public AbstractTuplizer(EntityMetamodel entityMetamodel,
PersistentClass mappedEntity)
| Method Detail |
protected abstract EntityMode getEntityMode()
protected abstract Getter buildPropertyGetter(Property mappedProperty,
PersistentClass mappedEntity)
protected abstract Setter buildPropertySetter(Property mappedProperty,
PersistentClass mappedEntity)
protected abstract Instantiator buildInstantiator(PersistentClass mappingInfo)
protected abstract ProxyFactory buildProxyFactory(PersistentClass mappingInfo,
Getter idGetter,
Setter idSetter)
public String getEntityName()
public Serializable getIdentifier(Object entity)
throws HibernateException
EntityTuplizer
getIdentifier in interface EntityTuplizerentity - 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.
public void setIdentifier(Object entity,
Serializable id)
throws HibernateException
EntityTuplizer
setIdentifier in interface EntityTuplizerentity - The entity to inject with the identifier value.id - The value to be injected as the identifier.
HibernateException
public void resetIdentifier(Object entity,
Serializable currentId,
Object currentVersion)
EntityTuplizer
resetIdentifier in interface EntityTuplizercurrentId - The identifier value to inject into the entity.currentVersion - The version value to inject into the entity.
public Object getVersion(Object entity)
throws HibernateException
EntityTuplizer
getVersion in interface EntityTuplizerentity - The entity from which to extract the version value.
HibernateExceptionprotected boolean shouldGetAllProperties(Object entity)
public Object[] getPropertyValues(Object entity)
throws HibernateException
Tuplizer
getPropertyValues in interface Tuplizerentity - The entity from which to extract values.
HibernateException
public Object[] getPropertyValuesToInsert(Object entity,
SessionImplementor session)
throws HibernateException
EntityTuplizer
getPropertyValuesToInsert in interface EntityTuplizerentity - The entity from which to extract.session - The session in which the resuest is being made.
HibernateException
public Object getPropertyValue(Object entity,
int i)
throws HibernateException
Tuplizer
getPropertyValue in interface Tuplizerentity - The entity from which to extract the property value.i - The index of the property for which to extract the value.
HibernateException
public Object getPropertyValue(Object entity,
String propertyName)
throws HibernateException
EntityTuplizer
getPropertyValue in interface EntityTuplizerentity - The entity from which to extract the property value.propertyName - The name of the property for which to extract the value.
HibernateException
public void setPropertyValues(Object entity,
Object[] values)
throws HibernateException
Tuplizer
setPropertyValues in interface Tuplizerentity - The entity.values - The values to be injected.
HibernateException
public void setPropertyValue(Object entity,
int i,
Object value)
throws HibernateException
EntityTuplizer
setPropertyValue in interface EntityTuplizerentity - The entity into which to inject the value.i - The property's index.value - The property value to inject.
HibernateException
public void setPropertyValue(Object entity,
String propertyName,
Object value)
throws HibernateException
EntityTuplizer
setPropertyValue in interface EntityTuplizerentity - The entity into which to inject the value.propertyName - The name of the property.value - The property value to inject.
HibernateException
public final Object instantiate(Serializable id)
throws HibernateException
EntityTuplizer
instantiate in interface EntityTuplizerid - The identifier value for the entity to be instantiated.
HibernateException
public final Object instantiate()
throws HibernateException
instantiate in interface TuplizerHibernateException
public void afterInitialize(Object entity,
boolean lazyPropertiesAreUnfetched,
SessionImplementor session)
EntityTuplizer
afterInitialize in interface EntityTuplizerentity - The entity being initialized.lazyPropertiesAreUnfetched - Are defined lazy properties currently unfecthedsession - The session initializing this entity.public boolean hasUninitializedLazyProperties(Object entity)
EntityTuplizer
hasUninitializedLazyProperties in interface EntityTuplizerentity - The entity to be check for uninitialized lazy properties.
public final boolean isInstance(Object object)
Tuplizer
isInstance in interface Tuplizerobject - The object to be checked.
public boolean hasProxy()
EntityTuplizer
hasProxy in interface EntityTuplizer
public Object createProxy(Serializable id,
SessionImplementor session)
throws HibernateException
EntityTuplizer
createProxy in interface EntityTuplizerid - 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()
EntityTuplizerclass managed by this tuplizer implement
the Lifecycle interface.
isLifecycleImplementor in interface EntityTuplizerpublic boolean isValidatableImplementor()
EntityTuplizerclass managed by this tuplizer implement
the Validatable interface.
isValidatableImplementor in interface EntityTuplizerprotected final EntityMetamodel getEntityMetamodel()
protected final SessionFactoryImplementor getFactory()
protected final Instantiator getInstantiator()
protected final ProxyFactory getProxyFactory()
public String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||