public final class DirtyInfo
extends java.lang.Object
DMO found
by the check, if any, and
whether that record was newly inserted
(as opposed to
representing an update to an pre-existing record). If no DMO was found,
this object will indicate whether a candidate DMO found in the primary
database was deleted
in an uncommitted transaction.
It will also indicate whether a candidate DMO found in the primary database
has been modified
in an uncommitted transaction.Modifier and Type | Field and Description |
---|---|
static int |
CHANGE
Status flag indicating an insert and/or update
|
private Persistable |
comparableDMO
Actual DMO found in dirty database during dirty check
|
static int |
DELETE
Status flag indicating delete
|
private Persistable |
dirtyDMO
DMO found in dirty database during dirty check (or snapshot)
|
static int |
INSERT
Status flag indicating insert specifically
|
static int |
LOCAL
Status flag indicating found DMO was added to dirty tracking by the local context
|
static int |
NONE
Status flag indicating no change
|
private int |
status
Bitfield of status flags
|
Constructor and Description |
---|
DirtyInfo()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
Persistable |
getComparableDMO()
Get the DMO, if any, found in the dirty database during a dirty check.
|
Persistable |
getDirtyDMO()
Get the DMO, if any, found in the dirty database during a dirty check.
|
boolean |
isDeleted()
Indicate whether the candidate DMO found in the primary database has
been deleted in an uncommitted transaction.
|
boolean |
isFullyPublished()
Indicate whether the dirty DMO (assumed to be non-
null )
contains all changes known to the dirty database, as opposed to being a
potentially outdated snapshot taken at the point the record was first
stored in the dirty database. |
boolean |
isInserted()
Indicate whether a
dirty DMO found during a dirty
database check has been newly inserted in an uncommitted transaction. |
boolean |
isLocal()
Indicate whether the record found in the dirty database was added to dirty share tracking
by the current/local context.
|
boolean |
isModified()
Indicate whether the candidate DMO found in the primary database has
been modified in an uncommitted transaction.
|
void |
setDeleted()
Record the fact that the candidate DMO found in the primary database has
been deleted in an uncommitted transaction.
|
(package private) void |
setDirtyDMOs(Persistable dirtyDMO,
Persistable comparableDMO)
Store DMOs found in the dirty share manager during a dirty check.
|
(package private) void |
setInserted()
Record the fact that the dirty DMO stored in this object is newly
inserted in an uncommitted transaction.
|
(package private) void |
setLocal()
Record the fact that the record contained in this object was added to dirty share tracking
by the current/local context.
|
(package private) void |
setModified()
Record the fact that the candidate DMO found in the primary database has
been modified in an uncommitted transaction.
|
public static final int NONE
public static final int CHANGE
public static final int INSERT
public static final int DELETE
public static final int LOCAL
private Persistable dirtyDMO
private Persistable comparableDMO
private int status
public boolean isDeleted()
true
if candidate DMO was deleted, else
false
.public boolean isInserted()
dirty DMO
found during a dirty
database check has been newly inserted in an uncommitted transaction.true
if dirty DMO is newly inserted, else
false
.public boolean isModified()
true
if candidate DMO was modified, else
false
.public boolean isLocal()
true
if the record in this object is local to the current context,
else false
.public Persistable getDirtyDMO()
null
if no record was
found.setDirtyDMOs(Persistable, Persistable)
public Persistable getComparableDMO()
This version of the DMO should not be exposed to business logic. It is provided for persistence runtime purposes, to allow the correct record to be found during dynamic navigation.
null
if no record was found. In cases where the comparable DMO is
the same as the dirty DMO, the dirty DMO is returned.getDirtyDMO()
,
setDirtyDMOs(Persistable, Persistable)
public boolean isFullyPublished()
null
)
contains all changes known to the dirty database, as opposed to being a
potentially outdated snapshot taken at the point the record was first
stored in the dirty database.true
if all uncommitted changes are included in
the dirty DMO, else false
.public void setDeleted()
void setInserted()
void setModified()
void setLocal()
void setDirtyDMOs(Persistable dirtyDMO, Persistable comparableDMO)
dirtyDMO
- Copy of the dirty record which is suitable for use by business logic. This use
should be read-only, unless isLocal()
returns true
.comparableDMO
- Dirty record which is not suitable for use by business logic, but is intended for
internal runtime use only.getDirtyDMO()