|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EntityTuplizer
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)
Method Summary | |
---|---|
void |
afterInitialize(Object entity,
boolean lazyPropertiesAreUnfetched,
SessionImplementor session)
Called just after the entities properties have been initialized. |
Object |
createProxy(Serializable id,
SessionImplementor session)
Generates an appropriate proxy representation of this entity for this entity-mode. |
Class |
getConcreteProxyClass()
Returns the java class to which generated proxies will be typed. |
Serializable |
getIdentifier(Object entity)
Extract the identifier value from the given entity. |
Object |
getPropertyValue(Object entity,
String propertyName)
Extract the value of a particular property from the given entity. |
Object[] |
getPropertyValuesToInsert(Object entity,
Map mergeMap,
SessionImplementor session)
Extract the values of the insertable properties of the entity (including backrefs) |
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(Serializable id)
Create an entity instance initialized with the given identifier. |
boolean |
isInstrumented()
Is it an instrumented POJO? |
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. |
Methods inherited from interface org.hibernate.tuple.Tuplizer |
---|
getMappedClass, getPropertyValue, getPropertyValues, instantiate, isInstance, setPropertyValues |
Method Detail |
---|
Object instantiate(Serializable id) throws HibernateException
id
- The identifier value for the entity to be instantiated.
HibernateException
Serializable getIdentifier(Object entity) throws HibernateException
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.void setIdentifier(Object entity, Serializable id) throws HibernateException
entity
- The entity to inject with the identifier value.id
- The value to be injected as the identifier.
HibernateException
void resetIdentifier(Object entity, Serializable currentId, Object currentVersion)
currentId
- The identifier value to inject into the entity.currentVersion
- The version value to inject into the entity.Object getVersion(Object entity) throws HibernateException
entity
- The entity from which to extract the version value.
HibernateException
void setPropertyValue(Object entity, int i, Object value) throws HibernateException
entity
- The entity into which to inject the value.i
- The property's index.value
- The property value to inject.
HibernateException
void setPropertyValue(Object entity, String propertyName, Object value) throws HibernateException
entity
- The entity into which to inject the value.propertyName
- The name of the property.value
- The property value to inject.
HibernateException
Object[] getPropertyValuesToInsert(Object entity, Map mergeMap, SessionImplementor session) throws HibernateException
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
Object getPropertyValue(Object entity, String propertyName) throws HibernateException
entity
- The entity from which to extract the property value.propertyName
- The name of the property for which to extract the value.
HibernateException
void afterInitialize(Object entity, boolean lazyPropertiesAreUnfetched, SessionImplementor session)
entity
- The entity being initialized.lazyPropertiesAreUnfetched
- Are defined lazy properties currently unfecthedsession
- The session initializing this entity.boolean hasProxy()
Object createProxy(Serializable id, SessionImplementor session) throws HibernateException
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.boolean isLifecycleImplementor()
class
managed by this tuplizer implement
the Lifecycle
interface.
boolean isValidatableImplementor()
class
managed by this tuplizer implement
the Validatable
interface.
Class getConcreteProxyClass()
boolean hasUninitializedLazyProperties(Object entity)
entity
- The entity to be check for uninitialized lazy properties.
boolean isInstrumented()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |