Package org.hibernate.tuple.component
Class AbstractComponentTuplizer
- java.lang.Object
-
- org.hibernate.tuple.component.AbstractComponentTuplizer
-
- All Implemented Interfaces:
java.io.Serializable
,ComponentTuplizer
,Tuplizer
- Direct Known Subclasses:
DynamicMapComponentTuplizer
,PojoComponentTuplizer
public abstract class AbstractComponentTuplizer extends java.lang.Object implements ComponentTuplizer
Support for tuplizers relating to components.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Getter[]
getters
protected boolean
hasCustomAccessors
protected Instantiator
instantiator
protected int
propertySpan
protected Setter[]
setters
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractComponentTuplizer(Component component)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Getter
buildGetter(Component component, Property prop)
protected abstract Instantiator
buildInstantiator(Component component)
protected abstract Setter
buildSetter(Component component, Property prop)
Getter
getGetter(int i)
Retrieve the getter for the specified property.java.lang.Object
getParent(java.lang.Object component)
Retrieve the current value of the parent property.java.lang.Object
getPropertyValue(java.lang.Object component, int i)
Extract the value of a particular property from the given entity.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?java.lang.Object
instantiate()
This method does not populate the component parentboolean
isInstance(java.lang.Object object)
Is the given object considered an instance of the the entity (acconting for entity-mode) managed by this tuplizer.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.tuple.Tuplizer
getMappedClass
-
-
-
-
Field Detail
-
getters
protected final Getter[] getters
-
setters
protected final Setter[] setters
-
propertySpan
protected final int propertySpan
-
instantiator
protected final Instantiator instantiator
-
hasCustomAccessors
protected final boolean hasCustomAccessors
-
-
Constructor Detail
-
AbstractComponentTuplizer
protected AbstractComponentTuplizer(Component component)
-
-
Method Detail
-
buildInstantiator
protected abstract Instantiator buildInstantiator(Component component)
-
getPropertyValue
public java.lang.Object getPropertyValue(java.lang.Object component, int i) throws HibernateException
Description copied from interface:Tuplizer
Extract the value of a particular property from the given entity.- Specified by:
getPropertyValue
in interfaceTuplizer
- Parameters:
component
- The entity from which to extract the property value.i
- The index of the property for which to extract the value.- Returns:
- The current value of the given property on the given entity.
- Throws:
HibernateException
-
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
- Parameters:
component
- The entity from which to extract values.- Returns:
- The current property values.
- Throws:
HibernateException
-
isInstance
public boolean isInstance(java.lang.Object object)
Description copied from interface:Tuplizer
Is the given object considered an instance of the the entity (acconting for entity-mode) managed by this tuplizer.- Specified by:
isInstance
in interfaceTuplizer
- Parameters:
object
- The object to be checked.- Returns:
- True if the object is considered as an instance of this entity within the given mode.
-
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
- Parameters:
component
- The entity.values
- The values to be injected.- Throws:
HibernateException
-
instantiate
public java.lang.Object instantiate() throws HibernateException
This method does not populate the component parent- Specified by:
instantiate
in interfaceTuplizer
- Returns:
- The new, empty entity instance.
- 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
- 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
- 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
- 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
- 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.
-
getGetter
public Getter getGetter(int i)
Description copied from interface:Tuplizer
Retrieve the getter for the specified property.
-
setComponentClass
protected void setComponentClass(Component component)
-
-