|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.wabit.dao.WabitSessionPersister
public class WabitSessionPersister
This class represents a Data Access Object for WabitSessions.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface ca.sqlpower.wabit.dao.WabitPersister |
|---|
WabitPersister.DataType, WabitPersister.WabitPersistMethod |
| Constructor Summary | |
|---|---|
WabitSessionPersister(java.lang.String name,
WabitSession session)
Creates a session persister that can update any object at or a descendant of the given session's workspace object. |
|
WabitSessionPersister(java.lang.String name,
WabitSession session,
WabitObject root)
Creates a session persister that can update an object at or a descendant of the given root now. |
|
| Method Summary | |
|---|---|
void |
begin()
Begins a transaction |
void |
commit()
Commits the persisted WabitObjects, its properties and removals |
void |
enforeThreadSafety()
|
boolean |
isHeadingToWisconsin()
|
boolean |
isUpdatingWabitWorkspace()
This is part of the 'echo-cancellation' system to notify any WorkspacePersisterListener listening to the same session to
ignore modifications to that session. |
void |
persistObject(java.lang.String parentUUID,
java.lang.String type,
java.lang.String uuid,
int index)
Persists a WabitObject given by its UUID, class name, and parent
UUID |
void |
persistProperty(java.lang.String uuid,
java.lang.String propertyName,
WabitPersister.DataType propertyType,
java.lang.Object newValue)
Persists a WabitObject property unconditionally given by its
object UUID, property name, property type, and new value |
void |
persistProperty(java.lang.String uuid,
java.lang.String propertyName,
WabitPersister.DataType propertyType,
java.lang.Object oldValue,
java.lang.Object newValue)
Persists a WabitObject property conditionally given by its object
UUID, property name, property type, expected old value, and new value |
void |
removeObject(java.lang.String parentUUID,
java.lang.String uuid)
Removes WabitObjects from persistent storage. |
void |
rollback()
Restores the persisted WabitObject back to the state it was in before the transaction began (i.e. |
void |
rollback(boolean force)
Rollback all changes to persistent storage to the beginning of the transaction |
void |
setGodMode(boolean godMode)
Turns this persister as a preacher of the truth and always the truth. |
java.lang.String |
toString()
|
static void |
undoForSession(WabitSession session,
java.util.List<PersistedObjectEntry> creations,
java.util.List<PersistedPropertiesEntry> properties,
java.util.List<RemovedObjectEntry> removals)
This static accessible method allows |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WabitSessionPersister(java.lang.String name,
WabitSession session)
public WabitSessionPersister(java.lang.String name,
WabitSession session,
WabitObject root)
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic void begin()
begin in interface WabitPersister
public void commit()
throws WabitPersistenceException
WabitObjects, its properties and removals
commit in interface WabitPersisterWabitPersistenceException - A general Exception that is thrown if any Exception occurs
while committing the transaction. This could be caused by one
being thrown by #persistObject(String, String),
#persistProperty(String, String, Object, Object), or
WabitPersister.removeObject(String, String). Some other exceptional
situations include:
public void persistObject(java.lang.String parentUUID,
java.lang.String type,
java.lang.String uuid,
int index)
throws WabitPersistenceException
WabitObject given by its UUID, class name, and parent
UUID
persistObject in interface WabitPersisterparentUUID - The parent UUID of the WabitObject to persisttype - The class name of the WabitObject to persistuuid - The UUID of the WabitObject to persistindex - The index of the WabitObject within its parents' list
of children
WabitPersistenceException - Thrown if the property name is not known in this method.
public void persistProperty(java.lang.String uuid,
java.lang.String propertyName,
WabitPersister.DataType propertyType,
java.lang.Object oldValue,
java.lang.Object newValue)
throws WabitPersistenceException
WabitObject property conditionally given by its object
UUID, property name, property type, expected old value, and new value
persistProperty in interface WabitPersisteruuid - The UUID of the WabitObject to persist the property
uponpropertyName - The property namepropertyType - The property typeoldValue - The expected old property valuenewValue - The new property value to persist
WabitPersistenceException - Thrown if the property name is not known in this method.
public void persistProperty(java.lang.String uuid,
java.lang.String propertyName,
WabitPersister.DataType propertyType,
java.lang.Object newValue)
throws WabitPersistenceException
WabitObject property unconditionally given by its
object UUID, property name, property type, and new value
persistProperty in interface WabitPersisteruuid - The UUID of the WabitObject to persist the property
uponpropertyName - The property namepropertyType - The property typenewValue - The new property value to persist
WabitPersistenceException - Thrown if the property name is not known in this method.
public void removeObject(java.lang.String parentUUID,
java.lang.String uuid)
throws WabitPersistenceException
WabitObjects from persistent storage.
removeObject in interface WabitPersisterparentUUID - The parent UUID of the WabitObject to removeuuid - The UUID of the WabitObject to remove
WabitPersistenceExceptionpublic void rollback()
WabitPersisterWabitPersister.begin() was made).
Typically, this would be called if an exception occurs during an atomic
transaction. In the event that a rollback() is called within a nested
transaction (that is, a begin() call after another begin() call before
commit()), then the state of the WabitObjects must be rolled back to the
state they were in before the highest level transaction began.
rollback in interface WabitPersisterpublic void rollback(boolean force)
WabitPersistenceExceptionpublic boolean isHeadingToWisconsin()
public boolean isUpdatingWabitWorkspace()
WorkspacePersisterListener listening to the same session to
ignore modifications to that session.
public void enforeThreadSafety()
public void setGodMode(boolean godMode)
godMode - True or False
public static void undoForSession(WabitSession session,
java.util.List<PersistedObjectEntry> creations,
java.util.List<PersistedPropertiesEntry> properties,
java.util.List<RemovedObjectEntry> removals)
throws WabitPersistenceException
session - creations - properties - removals -
WabitPersistenceException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||