org.nakedobjects.runtime.persistence.adaptermanager
Interface AdapterManagerPersist

All Known Subinterfaces:
AdapterManagerExtended
All Known Implementing Classes:
AdapterManagerAbstract, AdapterManagerDefault

public interface AdapterManagerPersist

API used solely by the PersistenceSession.


Method Summary
 NakedObject recreateRootAdapter(Oid oid, java.lang.Object pojo)
          Either returns an existing adapter (as per #getAdapterFor(Object) or #getAdapterFor(Oid)), otherwise re-creates an adapter with the specified (persistent) Oid.
 void remapAsPersistent(NakedObject adapter)
          Remaps the adapter and any associated aggregated (collection) adapters using a new value for the Oid provided by the OidGenerator.
 

Method Detail

remapAsPersistent

void remapAsPersistent(NakedObject adapter)
Remaps the adapter and any associated aggregated (collection) adapters using a new value for the Oid provided by the OidGenerator.

The Oid of the supplied adapter should be in such a state that it can be converted from transient to persistent. Note that some Oid implementations require an initial state call to do this (eg to read from a database identity or sequence value).

The adapter is remapped in the AdapterManager, and the previous is set to its transient value). Similarly for any aggregated adapters. This is needed for client/server so that the client can remap a changed object.

See Also:
AdapterManagerProxy.remapUpdated(Oid)

recreateRootAdapter

NakedObject recreateRootAdapter(Oid oid,
                                java.lang.Object pojo)
Either returns an existing adapter (as per #getAdapterFor(Object) or #getAdapterFor(Oid)), otherwise re-creates an adapter with the specified (persistent) Oid.

Typically called when the Oid is already known, that is, when resolving an already-persisted object. Is also available for Memento support however, so Oid could also represent a transient object.

If the adapter is recreated, its ResolveState will be ResolveState.GHOST if a persistent Oid, or ResolveState.TRANSIENT otherwise.



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