private final class RecordBuffer.ReversibleDelete extends Reversible
Reversible
which on rollback
reverses a record delete action by reattaching its DMO to the underlying
persistence session.Modifier and Type | Field and Description |
---|---|
private Persistable |
dmo
Deleted DMO
|
LOG
Constructor and Description |
---|
ReversibleDelete()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getAction()
Get a string which briefly describes the action which this object
will reverse upon rollback.
|
protected Persistable |
getDMO()
Get the DMO which was deleted.
|
protected java.lang.String |
getDMOName()
Get the unqualified interface name of the DMO being managed by this
reversible.
|
protected java.io.Serializable |
getId()
Get the ID of the underlying DMO.
|
protected void |
rollback(boolean rollForward,
boolean transaction)
Reverse the deletion of the underlying database record by reattaching
it to the underlying persistence session.
|
protected void |
setDMO(Persistable dmo)
Store the deleted DMO.
|
protected boolean |
storesDMO()
Indicate whether this
Reversible implementation stores its
DMO locally, as opposed to storing an identifier and having to retrieve
the DMO from the backing database, or not making a DMO available at all. |
duplicate, isNewlyCreated, prepareRollback, setNewlyCreated, toString
private Persistable dmo
protected java.lang.String getAction()
getAction
in class Reversible
protected boolean storesDMO()
Reversible
implementation stores its
DMO locally, as opposed to storing an identifier and having to retrieve
the DMO from the backing database, or not making a DMO available at all.storesDMO
in class Reversible
true
if the DMO is stored locally, else
false
.protected Persistable getDMO()
getDMO
in class Reversible
protected void setDMO(Persistable dmo)
setDMO
in class Reversible
dmo
- Deleted DMO.protected java.lang.String getDMOName()
getDMOName
in class Reversible
protected java.io.Serializable getId()
getId
in class Reversible
protected void rollback(boolean rollForward, boolean transaction) throws PersistenceException
rollback
in class Reversible
rollForward
- If true
, this method is being invoked in order
to re-roll forward a non-undoable change, after a
database-level rollback. This indicates the modification is
made within a new transaction invoked after the
database-level rollback.
If false
, this method is being invoked in order
to roll back an undoable change within the context of an
application-level, full transaction or sub-transaction
rollback.transaction
- true
if this rollback occurs at a full
transaction boundary, else false
.PersistenceException
- if an error occurs at the database or in the persistence
layer when detaching the record.