org.nakedobjects.runtime.persistence
Interface PersistenceSessionHydrator

All Superinterfaces:
Injectable
All Known Subinterfaces:
PersistenceSession
All Known Implementing Classes:
PersistenceSessionAbstract, PersistenceSessionLogger, PersistenceSessionObjectStore

public interface PersistenceSessionHydrator
extends Injectable


Method Summary
 NakedObject recreateAdapter(Oid oid, NakedObjectSpecification specification)
          Returns an adapter of the type specified.
 NakedObject recreateAdapter(Oid oid, java.lang.Object pojo)
          Returns an adapter for the provided Oid, wrapping the provided domain object.
 
Methods inherited from interface org.nakedobjects.metamodel.commons.component.Injectable
injectInto
 

Method Detail

recreateAdapter

NakedObject recreateAdapter(Oid oid,
                            NakedObjectSpecification specification)
Returns an adapter of the type specified.

If an adapter exists in the map then that adapter is returned immediately. Otherwise a new domain object of the type specified is created and then an adapter is recreated as per recreateAdapter(Oid, Object).

Note: the similar looking method PersistenceSessionContainer.loadObject(Oid, NakedObjectSpecification) retrieves the existing object from the persistent store (if not available in the maps . Once the object has been retrieved, the object store calls back to recreateAdapter(Oid, Object) to map it.

See Also:
recreateAdapter(Oid, Object), PersistenceSessionContainer.loadObject(Oid, NakedObjectSpecification)

recreateAdapter

NakedObject recreateAdapter(Oid oid,
                            java.lang.Object pojo)
Returns an adapter for the provided Oid, wrapping the provided domain object.

If an adapter exists in the map for either the Oid or the domain object then that adapter is returned immediately. Otherwise a new adapter is created using the specified Oid and its resolved state set to either ResolveState.TRANSIENT or ResolveState.GHOST based on whether the Oid is transient or not.



Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.