org.hibernate.tuple
Class PojoTuplizer

java.lang.Object
  extended byorg.hibernate.tuple.AbstractTuplizer
      extended byorg.hibernate.tuple.PojoTuplizer
All Implemented Interfaces:
EntityTuplizer, Tuplizer

public class PojoTuplizer
extends AbstractTuplizer

POJO-based implementation of an EntityTuplizer.

Author:
Steve Ebersole

Field Summary
 
Fields inherited from class org.hibernate.tuple.AbstractTuplizer
getters, hasCustomAccessors, propertySpan, setters
 
Constructor Summary
PojoTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity)
           
 
Method Summary
 void afterInitialize(Object entity, boolean lazyPropertiesAreUnfetched, SessionImplementor session)
          Called just after the entities properties have been initialized.
protected  Instantiator buildInstantiator(PersistentClass persistentClass)
           
protected  Getter buildPropertyGetter(Property mappedProperty, PersistentClass mappedEntity)
           
protected  Setter buildPropertySetter(Property mappedProperty, PersistentClass mappedEntity)
           
protected  ProxyFactory buildProxyFactory(PersistentClass persistentClass, Getter idGetter, Setter idSetter)
           
 Class getConcreteProxyClass()
          Returns the java class to which generated proxies will be typed.
 EntityMode getEntityMode()
           
 Class getMappedClass()
          Return the pojo class managed by this tuplizer.
 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  Object[] getPropertyValuesWithOptimizer(Object object)
           
 boolean hasUninitializedLazyProperties(Object entity)
          Does the given entity instance have any currently uninitialized lazy properties?
 boolean isLazyPropertyLoadingAvailable()
           
 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 setPropertyValues(Object entity, Object[] values)
          Inject the given values into the given entity.
protected  void setPropertyValuesWithOptimizer(Object object, Object[] values)
           
 
Methods inherited from class org.hibernate.tuple.AbstractTuplizer
createProxy, getEntityMetamodel, getEntityName, getFactory, getIdentifier, getInstantiator, getPropertyValue, getPropertyValue, getProxyFactory, 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

PojoTuplizer

public PojoTuplizer(EntityMetamodel entityMetamodel,
                    PersistentClass mappedEntity)
Method Detail

getEntityMode

public EntityMode getEntityMode()
Specified by:
getEntityMode in class AbstractTuplizer

buildProxyFactory

protected ProxyFactory buildProxyFactory(PersistentClass persistentClass,
                                         Getter idGetter,
                                         Setter idSetter)
Specified by:
buildProxyFactory in class AbstractTuplizer

buildInstantiator

protected Instantiator buildInstantiator(PersistentClass persistentClass)
Specified by:
buildInstantiator in class AbstractTuplizer

setPropertyValues

public void setPropertyValues(Object entity,
                              Object[] values)
                       throws HibernateException
Description copied from interface: Tuplizer
Inject the given values into the given entity.

Specified by:
setPropertyValues in interface Tuplizer
Overrides:
setPropertyValues in class AbstractTuplizer
Throws:
HibernateException

getPropertyValues

public Object[] getPropertyValues(Object entity)
                           throws HibernateException
Description copied from interface: Tuplizer
Extract the current values contained on the given entity.

Specified by:
getPropertyValues in interface Tuplizer
Overrides:
getPropertyValues in class AbstractTuplizer
Throws:
HibernateException

getPropertyValuesToInsert

public Object[] getPropertyValuesToInsert(Object entity,
                                          SessionImplementor session)
                                   throws HibernateException
Description copied from interface: EntityTuplizer
Extract the values of the insertable properties of the entity (including backrefs)

Specified by:
getPropertyValuesToInsert in interface EntityTuplizer
Overrides:
getPropertyValuesToInsert in class AbstractTuplizer
Throws:
HibernateException

setPropertyValuesWithOptimizer

protected void setPropertyValuesWithOptimizer(Object object,
                                              Object[] values)

getPropertyValuesWithOptimizer

protected Object[] getPropertyValuesWithOptimizer(Object object)

getMappedClass

public Class getMappedClass()
Description copied from interface: Tuplizer
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...

Returns:
The persistent class.

isLifecycleImplementor

public boolean isLifecycleImplementor()
Description copied from interface: EntityTuplizer
Does the class managed by this tuplizer implement the Lifecycle interface.

Specified by:
isLifecycleImplementor in interface EntityTuplizer
Overrides:
isLifecycleImplementor in class AbstractTuplizer

isValidatableImplementor

public boolean isValidatableImplementor()
Description copied from interface: EntityTuplizer
Does the class managed by this tuplizer implement the Validatable interface.

Specified by:
isValidatableImplementor in interface EntityTuplizer
Overrides:
isValidatableImplementor in class AbstractTuplizer

buildPropertyGetter

protected Getter buildPropertyGetter(Property mappedProperty,
                                     PersistentClass mappedEntity)
Specified by:
buildPropertyGetter in class AbstractTuplizer

buildPropertySetter

protected Setter buildPropertySetter(Property mappedProperty,
                                     PersistentClass mappedEntity)
Specified by:
buildPropertySetter in class AbstractTuplizer

getConcreteProxyClass

public Class getConcreteProxyClass()
Description copied from interface: EntityTuplizer
Returns the java class to which generated proxies will be typed.

Returns:
The java class to which generated proxies will be typed

afterInitialize

public void afterInitialize(Object entity,
                            boolean lazyPropertiesAreUnfetched,
                            SessionImplementor session)
Description copied from interface: EntityTuplizer
Called just after the entities properties have been initialized.

Specified by:
afterInitialize in interface EntityTuplizer
Overrides:
afterInitialize in class AbstractTuplizer

hasUninitializedLazyProperties

public boolean hasUninitializedLazyProperties(Object entity)
Description copied from interface: EntityTuplizer
Does the given entity instance have any currently uninitialized lazy properties?

Specified by:
hasUninitializedLazyProperties in interface EntityTuplizer
Overrides:
hasUninitializedLazyProperties in class AbstractTuplizer

isLazyPropertyLoadingAvailable

public boolean isLazyPropertyLoadingAvailable()