Package org.hibernate.tuple.component
Class PojoComponentTuplizer
- java.lang.Object
-
- org.hibernate.tuple.component.AbstractComponentTuplizer
-
- org.hibernate.tuple.component.PojoComponentTuplizer
-
- All Implemented Interfaces:
java.io.Serializable
,ComponentTuplizer
,Tuplizer
public class PojoComponentTuplizer extends AbstractComponentTuplizer
AComponentTuplizer
specific to the pojo entity mode.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.hibernate.tuple.component.AbstractComponentTuplizer
getters, hasCustomAccessors, instantiator, propertySpan, setters
-
-
Constructor Summary
Constructors Constructor Description PojoComponentTuplizer(Component component)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Getter
buildGetter(Component component, Property prop)
protected Instantiator
buildInstantiator(Component component)
protected Setter
buildSetter(Component component, Property prop)
java.lang.Class
getMappedClass()
Return the pojo class managed by this tuplizer.java.lang.Object
getParent(java.lang.Object component)
Retrieve the current value of the parent property.java.lang.Object[]
getPropertyValues(java.lang.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(java.lang.reflect.Method method)
Is the given method available via the managed component as a property getter?protected void
setComponentClass(Component component)
void
setParent(java.lang.Object component, java.lang.Object parent, SessionFactoryImplementor factory)
Set the value of the parent property.void
setPropertyValues(java.lang.Object component, java.lang.Object[] values)
Inject the given values into the given entity.-
Methods inherited from class org.hibernate.tuple.component.AbstractComponentTuplizer
getGetter, getPropertyValue, instantiate, isInstance
-
-
-
-
Constructor Detail
-
PojoComponentTuplizer
public PojoComponentTuplizer(Component component)
-
-
Method Detail
-
getMappedClass
public java.lang.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 java.lang.Object[] getPropertyValues(java.lang.Object component) throws HibernateException
Description copied from interface:Tuplizer
Extract the current values contained on the given entity.- Specified by:
getPropertyValues
in interfaceTuplizer
- Overrides:
getPropertyValues
in classAbstractComponentTuplizer
- Parameters:
component
- The entity from which to extract values.- Returns:
- The current property values.
- Throws:
HibernateException
-
setPropertyValues
public void setPropertyValues(java.lang.Object component, java.lang.Object[] values) throws HibernateException
Description copied from interface:Tuplizer
Inject the given values into the given entity.- Specified by:
setPropertyValues
in interfaceTuplizer
- Overrides:
setPropertyValues
in classAbstractComponentTuplizer
- Parameters:
component
- The entity.values
- The values to be injected.- Throws:
HibernateException
-
getParent
public java.lang.Object getParent(java.lang.Object component)
Description copied from interface:ComponentTuplizer
Retrieve the current value of the parent property.- Specified by:
getParent
in interfaceComponentTuplizer
- Overrides:
getParent
in classAbstractComponentTuplizer
- Parameters:
component
- The component instance from which to extract the parent property value.- Returns:
- The current value of the parent property.
-
hasParentProperty
public boolean hasParentProperty()
Description copied from interface:ComponentTuplizer
Does the component managed by this tuuplizer contain a parent property?- Specified by:
hasParentProperty
in interfaceComponentTuplizer
- Overrides:
hasParentProperty
in classAbstractComponentTuplizer
- Returns:
- True if the component does contain a parent property; false otherwise.
-
isMethodOf
public boolean isMethodOf(java.lang.reflect.Method method)
Description copied from interface:ComponentTuplizer
Is the given method available via the managed component as a property getter?- Specified by:
isMethodOf
in interfaceComponentTuplizer
- Overrides:
isMethodOf
in classAbstractComponentTuplizer
- Parameters:
method
- The method which to check against the managed component.- Returns:
- True if the managed component is available from the managed component; else false.
-
setParent
public void setParent(java.lang.Object component, java.lang.Object parent, SessionFactoryImplementor factory)
Description copied from interface:ComponentTuplizer
Set the value of the parent property.- Specified by:
setParent
in interfaceComponentTuplizer
- Overrides:
setParent
in classAbstractComponentTuplizer
- Parameters:
component
- The component instance on which to set the parent.parent
- The parent to be set on the comonent.factory
- The current session factory.
-
buildInstantiator
protected Instantiator buildInstantiator(Component component)
- Specified by:
buildInstantiator
in classAbstractComponentTuplizer
-
buildGetter
protected Getter buildGetter(Component component, Property prop)
- Specified by:
buildGetter
in classAbstractComponentTuplizer
-
buildSetter
protected Setter buildSetter(Component component, Property prop)
- Specified by:
buildSetter
in classAbstractComponentTuplizer
-
setComponentClass
protected void setComponentClass(Component component)
- Overrides:
setComponentClass
in classAbstractComponentTuplizer
-
-