Fork me on GitHub

Provides a single point of contact from domain objects into the Apache Isis framework.

The DomainObjectContainer interface provides a single point of contact from domain objects into the Isis framework. It can also be used as a lightweight general purpose repository during prototyping.

The following table lists the most important (ie non deprecated) methods in this interface.

Category Method Description
Object creation newTransientInstance(Class<T>) Creates new non-persisted object.

While it is also possible to simply new() up an object, that object will not have any services injected into it, nor will any properties be defaulted nor will any created() callback be invoked.

Validation isValid(Object) whether object is valid
validate(Object) reason why object is invalid (if any)
Generic Repository allInstances(Class<T>) All persisted instances of specified type
allMatches(Class<T>, Predicate<T>) All persistenced instances of specified type matching predicate
allMatches(Class<T>, String) All persisted instances with the specified string as their title
allMatches(Class<T>, Object) All persisted instances matching object (query-by-example)
allMatches(Query<T>) All instances satisfying the provided query
firstMatch(...) As for allMatches(...), but returning first instance
uniqueMatch(...) As for firstMatch(...), but requiring there to be only one match
Object persistence isPersistent(Object) whether object is persistent
persist(Object) persist the transient object
persistIfNotAlready(Object) persist the object (provided is not already persisted)
remove(Object) remove the persisted object
removeIfNotAlready(Object) remove the object (provided is not already transient)
Presentation titleOf(Object) Returns the title of the object.
Messages and warnings informUser(String) Inform the user
warnUser(String) Warn the user about a situation, requiring acknowledgement.
raiseError(String) Notify user of a serious application error, typically requiring further action on behalf of the user
Security getUser() The currently-logged on user
Properties getProperty(String) Value of configuration property
getPropertyNames() All configuration properties available
Object store control flush() Flush all pending changes to object store