public class DataObjectFactory
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
DataObjectFactory.DtoInvocationHandler
The handler which delegates the calls unimplemented method in a DTO abstract class to a DMO instance
it receives as parameter.
|
| Modifier and Type | Field and Description |
|---|---|
private static CentralLogger |
LOG
Logger
|
private Session |
session |
| Constructor and Description |
|---|
DataObjectFactory() |
| Modifier and Type | Method and Description |
|---|---|
<T extends DataModelObject> |
createDMO(java.lang.Class<T> clazz)
Creates a new instance of a DMO.
|
<T extends DataModelObject> |
createDMO(java.lang.Class<T> clazz,
boolean init,
boolean defs,
java.lang.Long pk)
Creates a new instance of a DMO.
|
<T extends DataModelObject> |
createDMO(java.lang.Class<T> clazz,
java.lang.Long pk)
Creates a new instance of a DMO.
|
static <T> T |
createDTO(java.lang.Class<T> clazz,
java.lang.Object dmo)
Creates a new instance of a DTO which implements a DMO interface in order to reuse the code of its
implementation.
|
static <T> T |
createDTO(java.lang.Class<T> clazz,
java.lang.Object dmo,
java.lang.Class<?>[] markerInterfaces)
Creates a new instance of a DTO which implements a DMO interface in order to reuse the code of its
implementation.
|
static DataObjectFactory |
getInstance(Session session) |
private static final CentralLogger LOG
private Session session
public static DataObjectFactory getInstance(Session session)
public <T extends DataModelObject> T createDMO(java.lang.Class<T> clazz)
T - The generic type of the object to be created. Inferred from clazz parameter.clazz - The interface of the DMO object to be created.public <T extends DataModelObject> T createDMO(java.lang.Class<T> clazz, java.lang.Long pk)
T - The generic type of the object to be created. Inferred from clazz parameter.clazz - The interface of the DMO object to be created.pk - If not null, the value is used as private key for the newly created record.public <T extends DataModelObject> T createDMO(java.lang.Class<T> clazz, boolean init, boolean defs, java.lang.Long pk)
T - The generic type of the object to be created. Inferred from clazz parameter.clazz - The interface of the DMO object to be created.init - If true, the returned object is initialized (registered with the session,
a change set and internal state are prepared) for complex usage of the object. defs - Valid only if init is true. Sets the default values for fields as the record was
defined with INITIAL value in table definition. pk - If not null, the value is used as private key for the newly created record.public static <T> T createDTO(java.lang.Class<T> clazz,
java.lang.Object dmo,
java.lang.Class<?>[] markerInterfaces)
T - The DTO class of the object to be returned.clazz - The DTO type of the object to be returned.dmo - An instance of the DMO interface to which the calls to 'super' class will be delegated.markerInterfaces - The marker interfaces, can be null.public static <T> T createDTO(java.lang.Class<T> clazz,
java.lang.Object dmo)
T - The DTO class of the object to be returned.clazz - The DTO type of the object to be returned.dmo - An instance of the DMO interface to which the calls to 'super' class will be delegated.