org.nakedobjects.runtime.persistence.oidgenerator
Interface OidGenerator

All Superinterfaces:
Component, DebugInfo, Injectable, SessionScopedComponent
All Known Implementing Classes:
OidGeneratorAbstract, SimpleOidGenerator, TimeBasedOidGenerator

public interface OidGenerator
extends DebugInfo, SessionScopedComponent, Injectable


Method Summary
 void convertTransientToPersistentOid(Oid oid)
          Convert the Oid from transient to persistent, storing the previous Oid as Oid.getPrevious()
 Oid createTransientOid(java.lang.Object pojo)
          Create a new transient Oid for the supplied pojo, uniquely distinguishable from any other Oid.
 OidStringifier getOidStringifier()
          An OidStringifier to use for stringifying instances of the concrete Oid generated by this generator.
 
Methods inherited from interface org.nakedobjects.metamodel.commons.debug.DebugInfo
debugData, debugTitle
 
Methods inherited from interface org.nakedobjects.metamodel.commons.component.SessionScopedComponent
close, open
 
Methods inherited from interface org.nakedobjects.metamodel.commons.component.Injectable
injectInto
 

Method Detail

createTransientOid

Oid createTransientOid(java.lang.Object pojo)
Create a new transient Oid for the supplied pojo, uniquely distinguishable from any other Oid.


convertTransientToPersistentOid

void convertTransientToPersistentOid(Oid oid)
Convert the Oid from transient to persistent, storing the previous Oid as Oid.getPrevious()

Implementation notes:


getOidStringifier

OidStringifier getOidStringifier()
An OidStringifier to use for stringifying instances of the concrete Oid generated by this generator.

All Oids (ultimately being Encodable) can be stringified using OidStringifierHex. However, some implementations (for example SerialOid) implement DirectlyStringableOid which means that we can get a more user-friendly string representation of the Oid.



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