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
|
replicate(T from)
Replicate the given from object, recursively if necessary. |
| 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, 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
replicate
protected <T> T replicate(T from)
- Replicate the given from object, recursively if necessary.
Currently a property is replicated if it is an instance
of Collection, Map, Timestamp, Date, Blob, Hibernate entity,
JavaBean, or an array.
- Overrides:
replicate in class ReplicatorTemplate