Top Description Inners Fields Constructors Methods
org.hibernate.tuple.component

public Class PojoComponentTuplizer

extends AbstractComponentTuplizer
Class Inheritance
Imports
java.io.Serializable, java.lang.reflect.Method, org.hibernate.AssertionFailure, .HibernateException, org.hibernate.bytecode.BasicProxyFactory, .ReflectionOptimizer, org.hibernate.cfg.Environment, org.hibernate.engine.SessionFactoryImplementor, org.hibernate.mapping.Component, .Property, org.hibernate.property.BackrefPropertyAccessor, .Getter, .PropertyAccessor, .PropertyAccessorFactory, .Setter, org.hibernate.tuple.Instantiator, .PojoInstantiator, org.hibernate.util.ReflectHelper

A ComponentTuplizer specific to the pojo entity mode.
Authors
Gavin King, Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final Class<T>
private ReflectionOptimizer
private final Getter
private final Setter
Inherited from org.hibernate.tuple.component.AbstractComponentTuplizer:
gettershasCustomAccessorsinstantiatorpropertySpansetters

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Getter
protected Instantiator
protected Setter
public Class<T>
getMappedClass()

Implements org.hibernate.tuple.Tuplizer.getMappedClass.

Return the pojo class managed by this tuplizer.
public Object
getParent(Object
The component instance from which to extract the parent property value.
component
)

Overrides org.hibernate.tuple.component.AbstractComponentTuplizer.getParent.

Implements org.hibernate.tuple.component.ComponentTuplizer.getParent.

Retreive the current value of the parent property.
public Object[]
getPropertyValues(Object
The entity from which to extract values.
component
)

Overrides org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValues.

Implements org.hibernate.tuple.Tuplizer.getPropertyValues.

Extract the current values contained on the given entity.
public boolean
public boolean
isMethodOf(Method
The method which to check against the managed component.
method
)

Overrides org.hibernate.tuple.component.AbstractComponentTuplizer.isMethodOf.

Implements org.hibernate.tuple.component.ComponentTuplizer.isMethodOf.

Is the given method available via the managed component as a property getter?
public void
setParent(Object
The component instance on which to set the parent.
component
,
Object
The parent to be set on the comonent.
parent
,
SessionFactoryImplementor
The current session factory.
factory
)

Overrides org.hibernate.tuple.component.AbstractComponentTuplizer.setParent.

Implements org.hibernate.tuple.component.ComponentTuplizer.setParent.

Set the value of the parent property.
public void
setPropertyValues(Object
The entity.
component
,
Object[]
The values to be injected.
values
)

Overrides org.hibernate.tuple.component.AbstractComponentTuplizer.setPropertyValues.

Implements org.hibernate.tuple.Tuplizer.setPropertyValues.

Inject the given values into the given entity.
Inherited from org.hibernate.tuple.component.AbstractComponentTuplizer:
getGettergetPropertyValueinstantiateisInstance

Field Detail

componentClassback to summary
private final Class<T> componentClass
optimizerback to summary
private ReflectionOptimizer optimizer
parentGetterback to summary
private final Getter parentGetter
parentSetterback to summary
private final Setter parentSetter

Constructor Detail

PojoComponentTuplizerback to summary
public PojoComponentTuplizer(Component component)

Method Detail

buildGetterback to summary
protected Getter buildGetter(Component component, Property prop)

Implements abstract org.hibernate.tuple.component.AbstractComponentTuplizer.buildGetter.

buildInstantiatorback to summary
protected Instantiator buildInstantiator(Component component)

Implements abstract org.hibernate.tuple.component.AbstractComponentTuplizer.buildInstantiator.

buildSetterback to summary
protected Setter buildSetter(Component component, Property prop)

Implements abstract org.hibernate.tuple.component.AbstractComponentTuplizer.buildSetter.

getMappedClassback to summary
public Class<T> getMappedClass()

Implements org.hibernate.tuple.Tuplizer.getMappedClass.

Doc from org.hibernate.tuple.Tuplizer.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...
Returns:Class<T>

The persistent class.

getParentback to summary
public Object getParent(Object component)

Overrides org.hibernate.tuple.component.AbstractComponentTuplizer.getParent.

Implements org.hibernate.tuple.component.ComponentTuplizer.getParent.

Doc from org.hibernate.tuple.component.ComponentTuplizer.getParent.

Retreive the current value of the parent property.

Parameters
component:Object

The component instance from which to extract the parent property value.

Returns:Object

The current value of the parent property.

getPropertyValuesback to summary
public Object[] getPropertyValues(Object component) throws HibernateException

Overrides org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValues.

Implements org.hibernate.tuple.Tuplizer.getPropertyValues.

Doc from org.hibernate.tuple.Tuplizer.getPropertyValues.

Extract the current values contained on the given entity.

Parameters
component:Object

The entity from which to extract values.

Returns:Object[]

The current property values.

hasParentPropertyback to summary
public boolean hasParentProperty()

Overrides org.hibernate.tuple.component.AbstractComponentTuplizer.hasParentProperty.

Implements org.hibernate.tuple.component.ComponentTuplizer.hasParentProperty.

Doc from org.hibernate.tuple.component.ComponentTuplizer.hasParentProperty.

Does the component managed by this tuuplizer contain a parent property?

Returns:boolean

True if the component does contain a parent property; false otherwise.

isMethodOfback to summary
public boolean isMethodOf(Method method)

Overrides org.hibernate.tuple.component.AbstractComponentTuplizer.isMethodOf.

Implements org.hibernate.tuple.component.ComponentTuplizer.isMethodOf.

Doc from org.hibernate.tuple.component.ComponentTuplizer.isMethodOf.

Is the given method available via the managed component as a property getter?

Parameters
method:Method

The method which to check against the managed component.

Returns:boolean

True if the managed component is available from the managed component; else false.

setParentback to summary
public void setParent(Object component, Object parent, SessionFactoryImplementor factory)

Overrides org.hibernate.tuple.component.AbstractComponentTuplizer.setParent.

Implements org.hibernate.tuple.component.ComponentTuplizer.setParent.

Doc from org.hibernate.tuple.component.ComponentTuplizer.setParent.

Set the value of the parent property.

Parameters
component:Object

The component instance on which to set the parent.

parent:Object

The parent to be set on the comonent.

factory:SessionFactoryImplementor

The current session factory.

setPropertyValuesback to summary
public void setPropertyValues(Object component, Object[] values) throws HibernateException

Overrides org.hibernate.tuple.component.AbstractComponentTuplizer.setPropertyValues.

Implements org.hibernate.tuple.Tuplizer.setPropertyValues.

Doc from org.hibernate.tuple.Tuplizer.setPropertyValues.

Inject the given values into the given entity.

Parameters
component:Object

The entity.

values:Object[]

The values to be injected.

org.hibernate.tuple.component back to summary

private Class PojoComponentTuplizer.ProxiedInstantiator

extends Object
implements Instantiator
Class Inheritance
  • java.lang.Object
  • org.hibernate.tuple.component.PojoComponentTuplizer.ProxiedInstantiator
All Implemented Interfaces
org.hibernate.tuple.Instantiator, java.io.Serializable

Field Summary

Modifier and TypeField and Description
private final BasicProxyFactory
private final Class<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
instantiate(Serializable
The id of the entity to be instantiated.
id
)

Implements org.hibernate.tuple.Instantiator.instantiate.

Perform the requested entity instantiation.
public Object
instantiate()

Implements org.hibernate.tuple.Instantiator.instantiate.

Perform the requested instantiation.
public boolean
isInstance(Object
The object to be checked.
object
)

Implements org.hibernate.tuple.Instantiator.isInstance.

Performs check to see if the given object is an instance of the entity or component which this Instantiator instantiates.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

factoryback to summary
private final BasicProxyFactory factory
proxiedClassback to summary
private final Class<T> proxiedClass

Constructor Detail

ProxiedInstantiatorback to summary
public ProxiedInstantiator(Component component)

Method Detail

instantiateback to summary
public Object instantiate(Serializable id)

Implements org.hibernate.tuple.Instantiator.instantiate.

Doc from org.hibernate.tuple.Instantiator.instantiate.

Perform the requested entity instantiation.

This form is never called for component instantiation, only entity instantiation.

Parameters
id:Serializable

The id of the entity to be instantiated.

Returns:Object

An appropriately instantiated entity.

instantiateback to summary
public Object instantiate()

Implements org.hibernate.tuple.Instantiator.instantiate.

Doc from org.hibernate.tuple.Instantiator.instantiate.

Perform the requested instantiation.

Returns:Object

The instantiated data structure.

isInstanceback to summary
public boolean isInstance(Object object)

Implements org.hibernate.tuple.Instantiator.isInstance.

Doc from org.hibernate.tuple.Instantiator.isInstance.

Performs check to see if the given object is an instance of the entity or component which this Instantiator instantiates.

Parameters
object:Object

The object to be checked.

Returns:boolean

True is the object does represent an instance of the underlying entity/component.