Module org.tentackle.domain
Package org.tentackle.domain
Class AbstractDomainObject<T extends PersistentDomainObject<T>,D extends AbstractDomainObject<T,D>>
java.lang.Object
org.tentackle.domain.AbstractDomainObject<T,D>
- Type Parameters:
T- the PDO classD- the domain object class
- All Implemented Interfaces:
Serializable,DomainContextProvider,DomainDelegate<T>,DomainObject<T>,PdoProvider<T>,ProxyDelegate<T>,org.tentackle.reflect.EffectiveClassProvider<T>,org.tentackle.reflect.Interceptable,org.tentackle.session.SessionProvider
- Direct Known Subclasses:
NumberPoolDomainImpl,NumberRangeDomainImpl,SecurityDomainImpl
public abstract class AbstractDomainObject<T extends PersistentDomainObject<T>,D extends AbstractDomainObject<T,D>>
extends Object
implements DomainObject<T>, org.tentackle.reflect.EffectiveClassProvider<T>, Serializable
Base domain implementation of a PDO.
- Author:
- harald
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an application domain object.AbstractDomainObject(T pdo) Creates an application domain object. -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks if the PDO is a root entity.findByUniqueDomainKey(Object domainKey) getPdo()org.tentackle.session.SessionClass<?> booleanme()voidSets the PDO.voidsetUniqueDomainKey(Object domainKey) toString()Gets the string representation of this domain object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tentackle.pdo.DomainContextProvider
isWithinContext, isWithinContext, on, on, op, opMethods inherited from interface org.tentackle.pdo.PdoProvider
on, on
-
Constructor Details
-
AbstractDomainObject
Creates an application domain object.- Parameters:
pdo- the persistent domain object this is a delegate for
-
AbstractDomainObject
public AbstractDomainObject()Creates an application domain object.
-
-
Method Details
-
getPersistenceDelegate
- Specified by:
getPersistenceDelegatein interfaceDomainDelegate<T extends PersistentDomainObject<T>>
-
getPdo
- Specified by:
getPdoin interfacePdoProvider<T extends PersistentDomainObject<T>>
-
me
- Specified by:
mein interfaceProxyDelegate<T extends PersistentDomainObject<T>>
-
setPdo
Sets the PDO.- Parameters:
pdo- the pdo
-
getEffectiveClass
- Specified by:
getEffectiveClassin interfaceorg.tentackle.reflect.EffectiveClassProvider<T extends PersistentDomainObject<T>>
-
getEffectiveSuperClasses
- Specified by:
getEffectiveSuperClassesin interfaceorg.tentackle.reflect.EffectiveClassProvider<T extends PersistentDomainObject<T>>
-
getDomainContext
- Specified by:
getDomainContextin interfaceDomainContextProvider
-
getSession
public org.tentackle.session.Session getSession()- Specified by:
getSessionin interfaceorg.tentackle.session.SessionProvider
-
toGenericString
- Specified by:
toGenericStringin interfaceDomainObject<T extends PersistentDomainObject<T>>
-
toString
Gets the string representation of this domain object.The default implementation returns the domain key, if this is a root entity. If a component, its single-name will be returned. If evaluating the domain key failed, the generic string is returned along with the exception in parentheses. This is due to the fact that toString should never throw an exception as it is used for logging and debugging.
-
isUniqueDomainKeyProvided
public boolean isUniqueDomainKeyProvided()- Specified by:
isUniqueDomainKeyProvidedin interfaceDomainObject<T extends PersistentDomainObject<T>>
-
getUniqueDomainKeyType
- Specified by:
getUniqueDomainKeyTypein interfaceDomainObject<T extends PersistentDomainObject<T>>
-
getUniqueDomainKey
- Specified by:
getUniqueDomainKeyin interfaceDomainObject<T extends PersistentDomainObject<T>>
-
setUniqueDomainKey
- Specified by:
setUniqueDomainKeyin interfaceDomainObject<T extends PersistentDomainObject<T>>
-
findByUniqueDomainKey
- Specified by:
findByUniqueDomainKeyin interfaceDomainObject<T extends PersistentDomainObject<T>>
-
getSingular
- Specified by:
getSingularin interfaceDomainObject<T extends PersistentDomainObject<T>>
-
getPlural
- Specified by:
getPluralin interfaceDomainObject<T extends PersistentDomainObject<T>>
-
assertRootEntity
public void assertRootEntity()Checks if the PDO is a root entity.
-