|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PersistenceSessionContainer
PersistenceSession as it appears to most typical client-side code.
| Method Summary | ||
|---|---|---|
NakedObject |
createInstance(NakedObjectSpecification specification)
Creates a new instance of the specified type and returns it in an adapter whose resolved state set to ResolveState.TRANSIENT (except if the type is marked as aggregated
in which case it will be set to ResolveState.VALUE). |
|
void |
destroyObject(NakedObject object)
|
|
NakedObject |
findInstances(PersistenceQuery criteria)
Finds and returns instances that match the specified PersistenceQuery. |
|
|
findInstances(Query<T> query,
QueryCardinality cardinality)
Finds and returns instances that match the specified query. |
|
boolean |
hasInstances(NakedObjectSpecification specification)
Whether there are any instances of the specified type. |
|
NakedObject |
loadObject(Oid oid,
NakedObjectSpecification spec)
Loads the object identified by the specified Oid from the persisted
set of objects. |
|
void |
makePersistent(NakedObject object)
Makes a naked object persistent. |
|
void |
objectChanged(NakedObject object)
Mark the NakedObject as changed, and therefore requiring flushing
to the persistence mechanism. |
|
void |
resolveField(NakedObject object,
NakedObjectAssociation association)
Hint that specified field within the specified object is likely to be needed soon. |
|
void |
resolveImmediately(NakedObject object)
Re-initialises the fields of an object. |
|
| Method Detail |
|---|
NakedObject createInstance(NakedObjectSpecification specification)
ResolveState.TRANSIENT (except if the type is marked as aggregated
in which case it will be set to ResolveState.VALUE).
REVIEW: not sure about ResolveState.VALUE - see comments in
#adapterFor(Object, Oid, Version).
While creating the object the it will be initialised with default values and its created
lifecycle method (its logical constructor) will be invoked. Contrast this with
#recreateTransientInstance(Oid, NakedObjectSpecification).
This method is ultimately delegated to by the DomainObjectContainer.
NakedObject loadObject(Oid oid,
NakedObjectSpecification spec)
Oid from the persisted
set of objects.
As used primarily by ServerDistribution.
<T> NakedObject findInstances(Query<T> query,
QueryCardinality cardinality)
The QueryCardinality determines whether all instances or just the first matching instance is returned.
UnsupportedFindException - if the criteria is not support by this persistorNakedObject findInstances(PersistenceQuery criteria)
PersistenceQuery.
Compared to findInstances(Query, QueryCardinality), not that there is no
QueryCardinality parameter. That's because PersistenceQuery intrinsically
carry the knowledge as to how many rows they return.
UnsupportedFindException - if the criteria is not support by this persistorboolean hasInstances(NakedObjectSpecification specification)
type.
Used (ostensibly) by client-side code.
void resolveImmediately(NakedObject object)
void resolveField(NakedObject object,
NakedObjectAssociation association)
This method need not do anything, but offers the object store the opportunity to load in objects before their use. Contrast this with resolveImmediately, which requires an object to be loaded before continuing.
resolveImmediately(NakedObject)void makePersistent(NakedObject object)
setOid method). The object, should also be added to the cache as the object is implicitly
'in use'.
If the object has any associations then each of these, where they aren't already persistent, should also be made persistent by recursively calling this method.
If the object to be persisted is a collection, then each element of that collection, that is not already persistent, should be made persistent by recursively calling this method.
void objectChanged(NakedObject object)
NakedObject as changed, and therefore requiring flushing
to the persistence mechanism.
void destroyObject(NakedObject object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||