org.hibernate.tuple.component
Class PojoComponentTuplizer

java.lang.Object
  extended byorg.hibernate.tuple.component.AbstractComponentTuplizer
      extended byorg.hibernate.tuple.component.PojoComponentTuplizer
All Implemented Interfaces:
ComponentTuplizer, Serializable, Tuplizer

public class PojoComponentTuplizer
extends AbstractComponentTuplizer

A ComponentTuplizer specific to the pojo entity mode.

Author:
Gavin King, Steve Ebersole
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.hibernate.tuple.component.AbstractComponentTuplizer
getters, hasCustomAccessors, instantiator, propertySpan, setters
 
Constructor Summary
PojoComponentTuplizer(Component component)
           
 
Method Summary
protected  Getter buildGetter(Component component, Property prop)
           
protected  Instantiator buildInstantiator(Component component)
           
protected  Setter buildSetter(Component component, Property prop)
           
 Class getMappedClass()
          Return the pojo class managed by this tuplizer.
 Object getParent(Object component)
          Retreive the current value of the parent property.
 Object[] getPropertyValues(Object component)
          Extract the current values contained on the given entity.
 boolean hasParentProperty()
          Does the component managed by this tuuplizer contain a parent property?
 boolean isMethodOf(Method method)
          Is the given method available via the managed component as a property getter?
 void setParent(Object component, Object parent, SessionFactoryImplementor factory)
          Set the value of the parent property.
 void setPropertyValues(Object component, Object[] values)
          Inject the given values into the given entity.
 
Methods inherited from class org.hibernate.tuple.component.AbstractComponentTuplizer
getPropertyValue, instantiate, isInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PojoComponentTuplizer

public PojoComponentTuplizer(Component component)
Method Detail

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.

getPropertyValues

public Object[] getPropertyValues(Object component)
                           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 AbstractComponentTuplizer
Throws:
HibernateException

setPropertyValues

public void setPropertyValues(Object component,
                              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 AbstractComponentTuplizer
Throws:
HibernateException

getParent

public Object getParent(Object component)
Description copied from interface: ComponentTuplizer
Retreive the current value of the parent property.

Specified by:
getParent in interface ComponentTuplizer
Overrides:
getParent in class AbstractComponentTuplizer

hasParentProperty

public boolean hasParentProperty()
Description copied from interface: ComponentTuplizer
Does the component managed by this tuuplizer contain a parent property?

Specified by:
hasParentProperty in interface ComponentTuplizer
Overrides:
hasParentProperty in class AbstractComponentTuplizer

isMethodOf

public boolean isMethodOf(Method method)
Description copied from interface: ComponentTuplizer
Is the given method available via the managed component as a property getter?

Specified by:
isMethodOf in interface ComponentTuplizer
Overrides:
isMethodOf in class AbstractComponentTuplizer

setParent

public void setParent(Object component,
                      Object parent,
                      SessionFactoryImplementor factory)
Description copied from interface: ComponentTuplizer
Set the value of the parent property.

Specified by:
setParent in interface ComponentTuplizer
Overrides:
setParent in class AbstractComponentTuplizer

buildInstantiator

protected Instantiator buildInstantiator(Component component)
Specified by:
buildInstantiator in class AbstractComponentTuplizer

buildGetter

protected Getter buildGetter(Component component,
                             Property prop)
Specified by:
buildGetter in class AbstractComponentTuplizer

buildSetter

protected Setter buildSetter(Component component,
                             Property prop)
Specified by:
buildSetter in class AbstractComponentTuplizer