Interface PdoFactory
- All Known Implementing Classes:
AbstractPdoFactory, DefaultPdoFactory
public interface PdoFactory
A factory for persistent domain objects.
- Author:
- harald
-
Method Summary
Modifier and TypeMethodDescription<T extends PersistentDomainObject<T>>
TCreates a PDO without any domain context or session.<T extends PersistentDomainObject<T>>
Tcreate(Class<T> clazz, DomainContext context) Creates a PDO.<T extends PersistentDomainObject<T>>
Tcreate(Class<T> clazz, DomainContext context, DomainObject<T> domainDelegate) Creates a PDO for a given domain delegate.<T extends PersistentDomainObject<T>>
Tcreate(Class<T> clazz, PersistentObject<T> persistenceDelegate) Creates a PDO for a given persistence delegate.<T extends PersistentDomainObject<T>>
Tcreate(Class<T> clazz, PersistentObject<T> persistenceDelegate, DomainObject<T> domainDelegate) Creates a PDO for given delegates.<T extends PersistentDomainObject<T>>
TCreates a PDO.<T extends PersistentDomainObject<T>>
Tcreate(Class<T> clazz, Session session, DomainObject<T> domainDelegate) Creates a PDO for a given domain delegate.<T extends PersistentDomainObject<T>>
TCreates a PDO without any domain context or session.<T extends PersistentDomainObject<T>>
Tcreate(String className, DomainContext context) Creates a PDO.<T extends PersistentDomainObject<T>>
Tcreate(String className, DomainContext context, DomainObject<T> domainDelegate) Creates a PDO for a given domain delegate.<T extends PersistentDomainObject<T>>
Tcreate(String className, PersistentObject<T> persistenceDelegate) Creates a PDO for a given persistence delegate.<T extends PersistentDomainObject<T>>
Tcreate(String className, PersistentObject<T> persistenceDelegate, DomainObject<T> domainDelegate) Creates a PDO for given delegates.<T extends PersistentDomainObject<T>>
TCreates a PDO for a session only.<T extends PersistentDomainObject<T>>
Tcreate(String className, Session session, DomainObject<T> domainDelegate) Creates a PDO for a given domain delegate.<T extends PersistentDomainObject<T>>
Tcreate(T pdo) Creates a PDO.<T extends PersistentDomainObject<T>>
TCreates a PDO within a sub context.
If the current context is already within the given context name, the result is equivalent tocreate(PersistentDomainObject).<T extends PersistentDomainObject<T>>
DomainObject<T> createDomainDelegate(String className) Creates the delegate implementing the domain layer.<T extends PersistentDomainObject<T>>
PersistentObject<T> createPersistenceDelegate(String className) Creates the delegate implementing the persistence layer.<T extends PersistentDomainObject<T>>
Class<DomainObject<T>> getDomainClass(String className) Gets the class implementing the domain layer.org.tentackle.reflect.ClassMapperGets the domain class mapper associated to this factory.
The classmapper maps PDO interfaces to their domain implementation.static PdoFactoryThe singleton.<T extends PersistentDomainObject<T>>
Class<PersistentObject<T>> getPersistenceClass(String className) Gets the class implementing the persistence layer.org.tentackle.reflect.ClassMapperGets the persistence class mapper associated to this factory.
The classmapper maps PDO interfaces to their persistence implementation.
-
Method Details
-
getInstance
-
getPersistenceMapper
org.tentackle.reflect.ClassMapper getPersistenceMapper()Gets the persistence class mapper associated to this factory.
The classmapper maps PDO interfaces to their persistence implementation.- Returns:
- the mapper for the persistence implementations
-
getDomainMapper
org.tentackle.reflect.ClassMapper getDomainMapper()Gets the domain class mapper associated to this factory.
The classmapper maps PDO interfaces to their domain implementation.- Returns:
- the mapper for the domain implementations
-
create
Creates a PDO.- Type Parameters:
T- the PDO type- Parameters:
clazz- the class of the PDO, usually an interfacecontext- the domain context- Returns:
- the created PDO
-
create
Creates a PDO.- Type Parameters:
T- the PDO type- Parameters:
clazz- the class of the PDO, usually an interfacesession- the session- Returns:
- the created PDO
-
create
Creates a PDO.- Type Parameters:
T- the PDO type- Parameters:
className- the name of PDO-class, usually an interfacecontext- the domain context- Returns:
- the created PDO
-
create
Creates a PDO for a session only.Note: the application must set the context.
- Type Parameters:
T- the PDO type- Parameters:
className- the name of PDO-class, usually an interfacesession- the session- Returns:
- the created PDO
-
create
Creates a PDO without any domain context or session.Note: the application must set the context.
- Type Parameters:
T- the PDO type- Parameters:
clazz- the class of the PDO, usually an interface- Returns:
- the created PDO
-
create
Creates a PDO without any domain context or session.Note: the application must set the context.
- Type Parameters:
T- the PDO type- Parameters:
className- the name of PDO-class, usually an interface- Returns:
- the created PDO
-
create
Creates a PDO.- Type Parameters:
T- the PDO type- Parameters:
pdo- the PDO- Returns:
- the created PDO belonging to the same class as the given
pdoand in same context.
-
create
Creates a PDO within a sub context.
If the current context is already within the given context name, the result is equivalent tocreate(PersistentDomainObject).- Type Parameters:
T- the PDO type- Parameters:
pdo- the PDOcontextName- the context name- Returns:
- the created PDO belonging to the same class as the given
pdoin a sub context of given name
-
create
<T extends PersistentDomainObject<T>> T create(Class<T> clazz, PersistentObject<T> persistenceDelegate) Creates a PDO for a given persistence delegate.- Type Parameters:
T- the PDO type- Parameters:
clazz- the class of the PDO, usually an interfacepersistenceDelegate- the persistence delegate- Returns:
- the created PDO
-
create
<T extends PersistentDomainObject<T>> T create(String className, PersistentObject<T> persistenceDelegate) Creates a PDO for a given persistence delegate.- Type Parameters:
T- the PDO type- Parameters:
className- the name of PDO-class, usually an interfacepersistenceDelegate- the persistence delegate- Returns:
- the created PDO
-
create
<T extends PersistentDomainObject<T>> T create(Class<T> clazz, DomainContext context, DomainObject<T> domainDelegate) Creates a PDO for a given domain delegate.- Type Parameters:
T- the PDO type- Parameters:
clazz- the class of the PDO, usually an interfacecontext- the domain contextdomainDelegate- the domain delegate- Returns:
- the created PDO
-
create
<T extends PersistentDomainObject<T>> T create(String className, DomainContext context, DomainObject<T> domainDelegate) Creates a PDO for a given domain delegate.- Type Parameters:
T- the PDO type- Parameters:
className- the name of PDO-class, usually an interfacecontext- the domain contextdomainDelegate- the domain delegate- Returns:
- the created PDO
-
create
<T extends PersistentDomainObject<T>> T create(Class<T> clazz, Session session, DomainObject<T> domainDelegate) Creates a PDO for a given domain delegate.- Type Parameters:
T- the PDO type- Parameters:
clazz- the class of the PDO, usually an interfacesession- the sessiondomainDelegate- the domain delegate- Returns:
- the created PDO
-
create
<T extends PersistentDomainObject<T>> T create(String className, Session session, DomainObject<T> domainDelegate) Creates a PDO for a given domain delegate.- Type Parameters:
T- the PDO type- Parameters:
className- the name of PDO-class, usually an interfacesession- the sessiondomainDelegate- the domain delegate- Returns:
- the created PDO
-
create
<T extends PersistentDomainObject<T>> T create(Class<T> clazz, PersistentObject<T> persistenceDelegate, DomainObject<T> domainDelegate) Creates a PDO for given delegates.- Type Parameters:
T- the PDO type- Parameters:
clazz- the class of the PDO, usually an interfacepersistenceDelegate- the persistence delegatedomainDelegate- the domain delegate- Returns:
- the created PDO
-
create
<T extends PersistentDomainObject<T>> T create(String className, PersistentObject<T> persistenceDelegate, DomainObject<T> domainDelegate) Creates a PDO for given delegates.- Type Parameters:
T- the PDO type- Parameters:
className- the name of PDO-class, usually an interfacepersistenceDelegate- the persistence delegatedomainDelegate- the domain delegate- Returns:
- the created PDO
-
getPersistenceClass
<T extends PersistentDomainObject<T>> Class<PersistentObject<T>> getPersistenceClass(String className) Gets the class implementing the persistence layer.- Type Parameters:
T- the PDO type- Parameters:
className- the name of PDO-class, usually an interface- Returns:
- the persistence class
-
getDomainClass
Gets the class implementing the domain layer.- Type Parameters:
T- the PDO type- Parameters:
className- the name of PDO-class, usually an interface- Returns:
- the domain class
-
createPersistenceDelegate
<T extends PersistentDomainObject<T>> PersistentObject<T> createPersistenceDelegate(String className) Creates the delegate implementing the persistence layer.- Type Parameters:
T- the PDO type- Parameters:
className- the name of PDO-class, usually an interface- Returns:
- the persistent delegate
-
createDomainDelegate
Creates the delegate implementing the domain layer.- Type Parameters:
T- the PDO type- Parameters:
className- the name of PDO-class, usually an interface- Returns:
- the domain delegate
-