|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hibernate.tuple.entity.AbstractEntityTuplizer
org.hibernate.tuple.entity.PojoEntityTuplizer
An EntityTuplizer
specific to the pojo entity mode.
Field Summary |
Fields inherited from class org.hibernate.tuple.entity.AbstractEntityTuplizer |
getters, hasCustomAccessors, propertySpan, setters |
Constructor Summary | |
PojoEntityTuplizer(EntityMetamodel entityMetamodel,
PersistentClass mappedEntity)
|
Method Summary | |
void |
afterInitialize(Object entity,
boolean lazyPropertiesAreUnfetched,
SessionImplementor session)
|
protected Instantiator |
buildInstantiator(PersistentClass persistentClass)
Build an appropriate Instantiator for the given mapped entity. |
protected Getter |
buildPropertyGetter(Property mappedProperty,
PersistentClass mappedEntity)
Build an appropriate Getter for the given property. |
protected Setter |
buildPropertySetter(Property mappedProperty,
PersistentClass mappedEntity)
Build an appropriate Setter for the given property. |
protected ProxyFactory |
buildProxyFactory(PersistentClass persistentClass,
Getter idGetter,
Setter idSetter)
Build an appropriate ProxyFactory for the given mapped entity. |
protected ProxyFactory |
buildProxyFactoryInternal(PersistentClass persistentClass,
Getter idGetter,
Setter idSetter)
|
String |
determineConcreteSubclassEntityName(Object entityInstance,
SessionFactoryImplementor factory)
Given an entity instance, determine the most appropriate (most targeted) entity-name which represents it. This is called in situations where we already know an entity name for the given entityInstance; we are being asked to determine if there is a more appropriate entity-name to use, specifically within an inheritence hierarchy. For example, consider a case where a user calls session.update( "Animal", cat );. Here, the user has explicitly provided Animal as the entity-name. However, they have passed in an instance of Cat which is a subclass of Animal. In this case, we would return Cat as the entity-name. null may be returned from calls to this method. The meaining of null in that case is assumed to be that we should use whatever explicit entity-name the user provided (Animal rather than Cat in the example above). |
Class |
getConcreteProxyClass()
Returns the java class to which generated proxies will be typed. todo : look at fully encapsulating PersistenceContext.narrowProxy(java.lang.Object, org.hibernate.persister.entity.EntityPersister, org.hibernate.engine.EntityKey, java.lang.Object) here,
since that is the only external use of this method |
EntityMode |
getEntityMode()
Return the entity-mode handled by this tuplizer instance. |
EntityNameResolver[] |
getEntityNameResolvers()
Get any EntityNameResolvers associated with this Tuplizer . |
Class |
getMappedClass()
Return the pojo class managed by this tuplizer. Need to determine how to best handle this for the Tuplizers for EntityModes other than POJO. todo : be really nice to not have this here since it is essentially pojo specific... |
Object[] |
getPropertyValues(Object entity)
|
Object[] |
getPropertyValuesToInsert(Object entity,
Map mergeMap,
SessionImplementor session)
|
protected Object[] |
getPropertyValuesWithOptimizer(Object object)
|
boolean |
hasUninitializedLazyProperties(Object entity)
|
boolean |
isInstrumented()
Is it an instrumented POJO? |
boolean |
isLifecycleImplementor()
|
boolean |
isValidatableImplementor()
|
void |
setPropertyValues(Object entity,
Object[] values)
|
protected void |
setPropertyValuesWithOptimizer(Object object,
Object[] values)
|
Methods inherited from class org.hibernate.tuple.entity.AbstractEntityTuplizer |
createProxy, getComponentValue, getEntityMetamodel, getEntityName, getFactory, getIdentifier, getInstantiator, getPropertyValue, getPropertyValue, getProxyFactory, getSubclassEntityNames, getVersion, hasProxy, instantiate, instantiate, isInstance, resetIdentifier, setIdentifier, setPropertyValue, setPropertyValue, shouldGetAllProperties, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PojoEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity)
Method Detail |
protected ProxyFactory buildProxyFactory(PersistentClass persistentClass, Getter idGetter, Setter idSetter)
buildProxyFactory
in class AbstractEntityTuplizer
persistentClass
- 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 ProxyFactory buildProxyFactoryInternal(PersistentClass persistentClass, Getter idGetter, Setter idSetter)
protected Instantiator buildInstantiator(PersistentClass persistentClass)
buildInstantiator
in class AbstractEntityTuplizer
persistentClass
- The mapping information regarding the mapped entity.
public void setPropertyValues(Object entity, Object[] values) throws HibernateException
setPropertyValues
in interface Tuplizer
setPropertyValues
in class AbstractEntityTuplizer
HibernateException
public Object[] getPropertyValues(Object entity) throws HibernateException
getPropertyValues
in interface Tuplizer
getPropertyValues
in class AbstractEntityTuplizer
HibernateException
public Object[] getPropertyValuesToInsert(Object entity, Map mergeMap, SessionImplementor session) throws HibernateException
getPropertyValuesToInsert
in interface EntityTuplizer
getPropertyValuesToInsert
in class AbstractEntityTuplizer
HibernateException
protected void setPropertyValuesWithOptimizer(Object object, Object[] values)
protected Object[] getPropertyValuesWithOptimizer(Object object)
public EntityMode getEntityMode()
public Class getMappedClass()
public boolean isLifecycleImplementor()
isLifecycleImplementor
in interface EntityTuplizer
isLifecycleImplementor
in class AbstractEntityTuplizer
public boolean isValidatableImplementor()
isValidatableImplementor
in interface EntityTuplizer
isValidatableImplementor
in class AbstractEntityTuplizer
protected Getter buildPropertyGetter(Property mappedProperty, PersistentClass mappedEntity)
buildPropertyGetter
in class AbstractEntityTuplizer
mappedProperty
- The property to be accessed via the built Getter.mappedEntity
- The entity information regarding the mapped entity owning this property.
protected Setter buildPropertySetter(Property mappedProperty, PersistentClass mappedEntity)
buildPropertySetter
in class AbstractEntityTuplizer
mappedProperty
- The property to be accessed via the built Setter.mappedEntity
- The entity information regarding the mapped entity owning this property.
public Class getConcreteProxyClass()
PersistenceContext.narrowProxy(java.lang.Object, org.hibernate.persister.entity.EntityPersister, org.hibernate.engine.EntityKey, java.lang.Object)
here,
since that is the only external use of this method
public void afterInitialize(Object entity, boolean lazyPropertiesAreUnfetched, SessionImplementor session)
afterInitialize
in interface EntityTuplizer
afterInitialize
in class AbstractEntityTuplizer
public boolean hasUninitializedLazyProperties(Object entity)
hasUninitializedLazyProperties
in interface EntityTuplizer
hasUninitializedLazyProperties
in class AbstractEntityTuplizer
public boolean isInstrumented()
public String determineConcreteSubclassEntityName(Object entityInstance, SessionFactoryImplementor factory)
entityInstance
- The entity instance.factory
- Reference to the SessionFactory.
public EntityNameResolver[] getEntityNameResolvers()
EntityNameResolvers
associated with this Tuplizer
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |