org.formaria.dto
Class DtoFactory

java.lang.Object
  extended by org.formaria.dto.DtoFactory

public class DtoFactory
extends java.lang.Object

The factory class that creates a Transfer Object for a given domain object. The class stores information about the object and can create a transfer object based upon the Dto annotations.

Copyright (c) Formaria Ltd., 2008, see license.txt for license information


Method Summary
 java.io.Serializable createTransferObject(java.lang.Object domainObject, boolean deepCopy)
          Create a Transfer Object for the given object.
 void saveTransferObject(java.lang.Object domainObject, java.lang.Object transferObject, boolean deepCopy)
          Read the data from the transfer object and save it to the original domain object
 void setBuildPath(java.lang.String buildPath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setBuildPath

public void setBuildPath(java.lang.String buildPath)

createTransferObject

public java.io.Serializable createTransferObject(java.lang.Object domainObject,
                                                 boolean deepCopy)
Create a Transfer Object for the given object. The given object must be an EJB Implementation and have a superclass that acts as the class for the entity's Transfer Object. Only the fields defined in this superclass are copied in to the Transfer Object.

Parameters:
deepCopy - get a deep copy of the DTO, including DTO versions of the nested objects

saveTransferObject

public void saveTransferObject(java.lang.Object domainObject,
                               java.lang.Object transferObject,
                               boolean deepCopy)
Read the data from the transfer object and save it to the original domain object

Parameters:
domainObject -
transferObject -
deepCopy - get a deep copy of the DTO, including DTO versions of the nested objects