net.sf.beanlib.hibernate3
Class Hibernate3BeanTransformer
java.lang.Object
net.sf.beanlib.provider.replicator.ReplicatorTemplate
net.sf.beanlib.provider.BeanTransformer
net.sf.beanlib.hibernate3.Hibernate3BeanTransformer
- All Implemented Interfaces:
- BeanPopulatorBaseSpi, BeanTransformerSpi, Transformable
public class Hibernate3BeanTransformer
- extends BeanTransformer
A Hibernate 3 Bean Transformer is simply a BeanTransformer
with the extended capabilities of handling Hibernate (v3.x) objects.
By default, the Hibernate proxies are replaced
with the actual instances, eagerly fetching from the database as necessary.
However, the exact behavior of the transformation process, including whether eager
fetching is enabled or not, can be controlled using the same SPI as BeanTransformer.
- Author:
- Joe D. Velopar
- See Also:
BeanTransformer
,
Hibernate3BeanReplicator
Method Summary |
protected
|
createToInstance(Object from,
Class<T> toClass)
Creates a target instance from either the class of the given "from" object or the given toClass,
giving priority to the one which is more specific whenever possible. |
protected
|
unenhanceObject(T from)
Returns an equivalent object un-enhanced from the given object. |
Methods inherited from class net.sf.beanlib.provider.BeanTransformer |
getArrayReplicatable, getBeanPopulationExceptionHandler, getBeanPopulatorBaseConfig, getBeanPopulatorSpiFactory, getBeanReplicatable, getBeanSourceHandler, getBlobReplicatable, getCalendarReplicatable, getClonedMap, getCollectionReplicatable, getCustomBeanTransformer, getDateReplicatable, getDetailedPropertyFilter, getImmutableReplicatable, getMapReplicatable, getPropertyFilter, getReaderMethodFinder, getSetterMethodCollector, initArrayReplicatableFactory, initBeanPopulationExceptionHandler, initBeanPopulatorBaseConfig, initBeanReplicatableFactory, initBeanSourceHandler, initBlobReplicatableFactory, initCalendarReplicatableFactory, initCollectionReplicatableFactory, initCustomTransformerFactory, initDateReplicatableFactory, initDebug, initDetailedPropertyFilter, initImmutableReplicatableFactory, initMapReplicatableFactory, initPropertyFilter, initReaderMethodFinder, initSetterMethodCollector, isDebug, reset, transform |
Methods inherited from class net.sf.beanlib.provider.replicator.ReplicatorTemplate |
chooseClass, containsTargetCloned, createToInstance, createToInstanceWithComparator, getCustomerBeanTransformer, getTargetCloned, newInstanceAsPrivileged, populateBean, putTargetCloned, replicate, replicate, replicateByBeanReplicatable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Hibernate3BeanTransformer
public Hibernate3BeanTransformer()
Hibernate3BeanTransformer
public Hibernate3BeanTransformer(BeanPopulatorSpi.Factory beanPopulatorFactory)
createToInstance
protected <T> T createToInstance(Object from,
Class<T> toClass)
throws InstantiationException,
IllegalAccessException,
SecurityException,
NoSuchMethodException
- Creates a target instance from either the class of the given "from" object or the given toClass,
giving priority to the one which is more specific whenever possible. Note the class of the given
from object is un-enhanced if it is found to be an enhanced object either via cglib or javassist.
- Overrides:
createToInstance
in class ReplicatorTemplate
- Throws:
InstantiationException
IllegalAccessException
SecurityException
NoSuchMethodException
unenhanceObject
protected final <T> T unenhanceObject(T from)
- Description copied from class:
ReplicatorTemplate
- Returns an equivalent object un-enhanced from the given object.
By default, the input object is returned.
Subclass must override this method to perform any such un-enhancement, if necessary.
- Overrides:
unenhanceObject
in class ReplicatorTemplate