public class DefaultPersistentContext extends Object implements PersistentContextServices
PersistentContextServices.ObjectReference| Constructor and Description |
|---|
DefaultPersistentContext(PersistenceManager manager) |
| Modifier and Type | Method and Description |
|---|---|
PersistentContextServices.ObjectReference |
add(PersistentIdentifier id)
Add a new reference associated to the identifier passed as
parameter.
|
PersistentContextServices.ObjectReference |
add(PersistentState state,
Object obj)
Add a reference to the object associated to the state.
|
void |
addError(Throwable cause)
Add a error to the list of errors of the context.
|
void |
clear()
Clear the instances of references previously recreated
|
PersistentContextServices.ObjectReference |
get(Object obj)
Return the object reference associated to the object
passed as parameter.
|
PersistentContextServices.ObjectReference |
get(PersistentIdentifier id)
Return the object reference associated to the id indicated
as parameter.
|
PersistentContextServices.ObjectReference |
get(PersistentState state)
Return the object reference associated to the state passed as parameter.
|
boolean |
getCollectErrors()
Get information about if collect errors or launch it
when produce.
|
PersistenceException |
getErrors()
Get all errors collected to the moment in this context.
|
PersistentIdentifier |
getId(Object obj)
Return the id associated to the object passed as parameter.
|
PersistentIdentifier |
getIdentifier(String id)
Create a new identifier based on the string passed as parameter
and return this.
|
PersistentIdentifier |
getNewIdentifier()
Get a valid new persistent identifier.
|
Object |
getObject(Integer id) |
PersistentContextServices.ObjectReference |
getRoot() |
PersistentState |
getState(Integer id) |
PersistentState |
getState(Object obj) |
Iterator |
iterator()
Return an iterator over the states stored in this
context.
|
void |
setCollectErrors(boolean collectErrors)
Set flag to collect errors.
|
void |
setRootId(PersistentIdentifier id) |
void |
update(PersistentContextServices.ObjectReference ref)
Update the object referenced by ref, recreating it with this
state,
|
void |
validate(int mode)
Validate al statetes en the context.
|
public DefaultPersistentContext(PersistenceManager manager)
public PersistentIdentifier getNewIdentifier()
PersistentContextServicesgetNewIdentifier in interface PersistentContextServicespublic PersistentIdentifier getIdentifier(String id) throws PersistenceException
PersistentContextServicesgetIdentifier in interface PersistentContextServicesPersistenceExceptionpublic PersistentContextServices.ObjectReference add(PersistentIdentifier id) throws PersistenceException
PersistentContextServicesadd in interface PersistentContextServicesPersistenceExceptionpublic PersistentContextServices.ObjectReference add(PersistentState state, Object obj) throws PersistenceException
PersistentContextServicesadd in interface PersistentContextServicesPersistenceExceptionpublic PersistentContextServices.ObjectReference get(PersistentState state) throws PersistenceException
PersistentContextServicesget in interface PersistentContextServicesPersistenceExceptionpublic PersistentContextServices.ObjectReference get(PersistentIdentifier id)
PersistentContextServicesget in interface PersistentContextServicespublic PersistentContextServices.ObjectReference get(Object obj)
PersistentContextServicesget in interface PersistentContextServicespublic void update(PersistentContextServices.ObjectReference ref) throws PersistenceException
PersistentContextServicesupdate in interface PersistentContextServicesPersistenceExceptionpublic void clear()
PersistentContextServicesclear in interface PersistentContextServicespublic Iterator iterator()
PersistentContextiterator in interface PersistentContextpublic PersistentState getState(Integer id) throws PersistenceException
getState in interface PersistentContextServicesPersistenceExceptionpublic PersistentState getState(Object obj) throws PersistenceException
getState in interface PersistentContextServicesPersistenceExceptionpublic Object getObject(Integer id) throws PersistenceException
getObject in interface PersistentContextServicesPersistenceExceptionpublic PersistentIdentifier getId(Object obj) throws PersistenceException
PersistentContextServicesgetId in interface PersistentContextServicesPersistenceExceptionpublic void setRootId(PersistentIdentifier id)
setRootId in interface PersistentContextServicespublic PersistentContextServices.ObjectReference getRoot() throws PersistenceException
getRoot in interface PersistentContextServicesPersistenceExceptionpublic void setCollectErrors(boolean collectErrors)
PersistentContextServicessetCollectErrors in interface PersistentContextServicespublic boolean getCollectErrors()
PersistentContextServicesgetCollectErrors in interface PersistentContextServicespublic void addError(Throwable cause)
PersistentContextaddError in interface PersistentContextpublic PersistenceException getErrors()
PersistentContextgetErrors in interface PersistentContextpublic void validate(int mode)
throws PersistenceValidateExceptions
PersistentContextServicesvalidate in interface PersistentContextServicesPersistenceValidateExceptions