net.sf.beanlib.hibernate3
Class Hibernate3DtoCopier

java.lang.Object
  extended by net.sf.beanlib.hibernate3.Hibernate3DtoCopier

public class Hibernate3DtoCopier
extends java.lang.Object

Convenient class for converting application specific Hibernate 3 persistence object to DTO.

Author:
Joe D. Velopar

Nested Class Summary
static class Hibernate3DtoCopier.Factory
          Factory for Hibernate3DtoCopier.
 
Method Summary
protected  Hibernate3BeanReplicator createHibernateBeanReplicator()
           
<E> java.util.List<E>
hibernate2dto(java.lang.Class<E> targetEntityType, java.util.Collection hibernateBeans, java.lang.Class[] interestedEntityTypes, net.sf.beanlib.CollectionPropertyName[] collectionPropertyNameArray)
          Returns a list of DTO's by cloning portion of the object graph of the given collection of Hibernate beans.
<E,T> E
hibernate2dto(java.lang.Class<E> targetEntityType, T entityBean)
           
<E,T> E
hibernate2dto(java.lang.Class<E> targetEntityType, T entityBean, java.lang.Class[] interestedEntityTypes, net.sf.beanlib.CollectionPropertyName[] collectionPropertyNames)
           
 java.util.List<?> hibernate2dto(java.util.Collection<?> hibernateBeans)
          Returns a list of DTO's by cloning portion of the object graph of the given collection of Hibernate beans.
<T> T
hibernate2dto(java.lang.Object entityBean)
          Returns a DTO by cloning portion of the object graph of the given Hibernate bean.
<T> T
hibernate2dto(T entityBean, java.lang.Class[] interestedEntityTypes, net.sf.beanlib.CollectionPropertyName[] collectionPropertyNames)
          Returns a DTO by cloning portion of the object graph of the given Hibernate bean.
 java.util.List hibernate2dtoFully(java.util.Collection hibernateBeans)
          Returns a list of DTO's by deep cloning the given collection of Hibernate beans.
<T> T
hibernate2dtoFully(java.lang.Object entityBean)
          Returns a DTO by deep cloning the given Hibernate bean.
protected  Hibernate3DtoCopier init(java.lang.String applicationPackagePrefix, java.lang.Class applicationSampleClass)
          Used to specify the application package prefix, with a sample application class for verification purposes.
 boolean isApplicationClass(java.lang.Class c)
          Returns true iff c is a application class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createHibernateBeanReplicator

protected Hibernate3BeanReplicator createHibernateBeanReplicator()

init

protected Hibernate3DtoCopier init(java.lang.String applicationPackagePrefix,
                                   java.lang.Class applicationSampleClass)
Used to specify the application package prefix, with a sample application class for verification purposes.


hibernate2dtoFully

public <T> T hibernate2dtoFully(java.lang.Object entityBean)
Returns a DTO by deep cloning the given Hibernate bean.


hibernate2dtoFully

public java.util.List hibernate2dtoFully(java.util.Collection hibernateBeans)
Returns a list of DTO's by deep cloning the given collection of Hibernate beans.


hibernate2dto

public <T> T hibernate2dto(java.lang.Object entityBean)
Returns a DTO by cloning portion of the object graph of the given Hibernate bean.

Parameters:
entityBean - given Hibernate Bean

hibernate2dto

public <E,T> E hibernate2dto(java.lang.Class<E> targetEntityType,
                             T entityBean)

hibernate2dto

public <T> T hibernate2dto(T entityBean,
                           java.lang.Class[] interestedEntityTypes,
                           net.sf.beanlib.CollectionPropertyName[] collectionPropertyNames)
Returns a DTO by cloning portion of the object graph of the given Hibernate bean.

Parameters:
entityBean - given Hibernate Bean
collectionPropertyNames - set properties to be included in the object graph

hibernate2dto

public <E,T> E hibernate2dto(java.lang.Class<E> targetEntityType,
                             T entityBean,
                             java.lang.Class[] interestedEntityTypes,
                             net.sf.beanlib.CollectionPropertyName[] collectionPropertyNames)

hibernate2dto

public java.util.List<?> hibernate2dto(java.util.Collection<?> hibernateBeans)
Returns a list of DTO's by cloning portion of the object graph of the given collection of Hibernate beans.

Parameters:
hibernateBeans - given collection of Hibernate Beans.

hibernate2dto

public <E> java.util.List<E> hibernate2dto(java.lang.Class<E> targetEntityType,
                                           java.util.Collection hibernateBeans,
                                           java.lang.Class[] interestedEntityTypes,
                                           net.sf.beanlib.CollectionPropertyName[] collectionPropertyNameArray)
Returns a list of DTO's by cloning portion of the object graph of the given collection of Hibernate beans.

Parameters:
hibernateBeans - given collection of Hibernate Beans.

isApplicationClass

public boolean isApplicationClass(java.lang.Class c)
Returns true iff c is a application class.



Copyright © 2010. All Rights Reserved.