public final class DBObjectHelper
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
GlobalKey |
cacheGlobalKey
Cache the Global key which is used through out the System ( Only used in mutable mode)
|
boolean |
deleted
deleted object
|
java.util.HashMap<java.lang.String,java.lang.String> |
denormalizedData |
boolean |
disableOnChange
disable the on change so that we can clone the object.
|
boolean |
forceReindex
force re-index
|
java.lang.Long |
newRowKey
cache of the newly created row key
|
boolean |
reindexOnly
re-index only
|
boolean |
savingNewRecord
saving new record.
|
boolean |
undeleted
undeleted object
|
java.util.concurrent.ConcurrentHashMap<java.lang.Long,ModData> |
updatedData
Holds all data for fields that have been changed up the user.
|
Constructor and Description |
---|
DBObjectHelper(DBObject base) |
Modifier and Type | Method and Description |
---|---|
void |
addCascadeDelete(DBObject obj) |
void |
addDenormalizedResult(java.lang.String code,
java.lang.String data) |
static java.lang.Object |
calculateValue(DBObject obj,
DBField field,
java.lang.Object defaultValue)
same as getValue but throws Exceptions
|
java.lang.Object |
clone() |
void |
doUndelete() |
static void |
fireOnChange(DBObject obj,
DBField field,
FldParams params) |
void |
forcelockedTransaction(long validatedTransId) |
DBObject |
getDeletedBy() |
long |
getLockedTransaction() |
Login |
getLogin() |
ModData |
getModData(DBField field) |
static boolean |
hasChanged(DBObject obj)
Has this object changed since last save
Are all fields are blank or the auto entered values ? |
static boolean |
hasChangedByUser(DBObject obj)
Has the user changed this object since last save
Are all fields are blank or the auto entered values ? |
static java.util.ArrayList |
iAddEventListener(DBObject obj,
java.util.ArrayList orgListeners,
Watcher watcher)
Handle the event listener.
|
long |
lastTouched() |
static java.lang.Object |
makeCurrentValue(DataSource ds,
DBField field,
java.lang.Object userValue,
java.lang.Object previousValueActual,
GlobalKey currentKey,
java.lang.String language,
FldParams inParams) |
static java.lang.Long |
makeKey(DBField field) |
static GlobalKey |
makeLinkedKey(DataSource ds,
DBField field,
boolean isLinked,
java.lang.Object orgValue,
FldParams inParams) |
DBObjectHelper |
makeSavePoint(java.lang.String id) |
static void |
raiseDependantAddedEvent(DataSource ds,
GlobalKey sourceKey,
GlobalKey targetKey,
GlobalKey sourceFieldKey)
Within the MutableData Source notify when objects are added and removed.
|
static void |
raiseDependantAddedEvent(GlobalKey sourceKey,
DBObject target,
GlobalKey sourceFieldKey)
Within the MutableData Source notify when objects are added and removed.
|
static void |
raiseDependantRemovedEvent(DataSource ds,
GlobalKey sourceKey,
GlobalKey targetKey,
GlobalKey sourceFieldKey)
Within the MutableData Source notify when objects are added and removed.
|
static void |
raiseDependantRemovedEvent(GlobalKey sourceKey,
DBObject target,
GlobalKey sourceFieldKey)
Within the MutableData Source notify when objects are added and removed.
|
static void |
raiseEvents(MutableDataSource ds,
DBObject base)
Raise Events that matches the current state of the object
|
static void |
removeEventListener(java.util.ArrayList listeners,
Watcher watcher) |
DBObjectHelper |
rollbackTo(java.lang.String id)
Rollback to save point.
|
void |
setClearedBy(DBObject obj,
DBField field) |
void |
setDeletedBy(DBObject obj) |
void |
setlockedTransaction(long validatedTransId) |
void |
touch(long time) |
public java.util.concurrent.ConcurrentHashMap<java.lang.Long,ModData> updatedData
public java.util.HashMap<java.lang.String,java.lang.String> denormalizedData
public GlobalKey cacheGlobalKey
public boolean disableOnChange
public boolean forceReindex
public boolean reindexOnly
public boolean deleted
public boolean undeleted
public java.lang.Long newRowKey
public boolean savingNewRecord
public DBObjectHelper(@Nonnull DBObject base)
base
- the base objectpublic static java.util.ArrayList iAddEventListener(DBObject obj, java.util.ArrayList orgListeners, Watcher watcher)
obj
- orgListeners
- watcher
- public void addDenormalizedResult(java.lang.String code, java.lang.String data)
@Nonnull @CheckReturnValue public DBObjectHelper makeSavePoint(@Nonnull java.lang.String id)
id
- @Nullable @CheckReturnValue public DBObjectHelper rollbackTo(@Nullable java.lang.String id) throws NoSavePointException
id
- the save point idNoSavePointException
- no save point found@CheckReturnValue @Nonnull public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public static void removeEventListener(@Nullable java.util.ArrayList listeners, @Nullable Watcher watcher)
listeners
- watcher
- public static void raiseDependantAddedEvent(@Nonnull GlobalKey sourceKey, @Nullable DBObject target, @Nonnull GlobalKey sourceFieldKey)
sourceKey
- target
- sourceFieldKey
- public static void raiseDependantRemovedEvent(@Nonnull GlobalKey sourceKey, @Nullable DBObject target, @Nonnull GlobalKey sourceFieldKey)
sourceKey
- target
- sourceFieldKey
- public static void raiseDependantAddedEvent(@Nonnull DataSource ds, @Nonnull GlobalKey sourceKey, @Nullable GlobalKey targetKey, @Nonnull GlobalKey sourceFieldKey)
ds
- the data sourcesourceKey
- targetKey
- sourceFieldKey
- public static void raiseDependantRemovedEvent(@Nonnull DataSource ds, @Nonnull GlobalKey sourceKey, @Nullable GlobalKey targetKey, @Nonnull GlobalKey sourceFieldKey)
ds
- the data sourcesourceKey
- targetKey
- sourceFieldKey
- @Nullable @CheckReturnValue public static java.lang.Object calculateValue(@Nonnull DBObject obj, @Nonnull DBField field, @Nullable java.lang.Object defaultValue) throws java.lang.Exception
obj
- field
- The fielddefaultValue
- java.lang.Exception
- a serious problempublic static void raiseEvents(@Nonnull MutableDataSource ds, @Nonnull DBObject base) throws java.lang.Exception
ds
- the data sourcebase
- the base objectjava.lang.Exception
- a serious problempublic void forcelockedTransaction(@Nonnegative long validatedTransId)
validatedTransId
- public void setlockedTransaction(@Nonnegative long validatedTransId)
validatedTransId
- @Nonnegative @CheckReturnValue public long getLockedTransaction()
public static void fireOnChange(@Nonnull DBObject obj, @Nonnull DBField field, @Nullable FldParams params) throws java.lang.Exception
obj
- field
- The fieldparams
- the field parametersjava.lang.Exception
- a serious problem@CheckReturnValue public static boolean hasChanged(@Nonnull DBObject obj)
obj
- @CheckReturnValue public static boolean hasChangedByUser(@Nonnull DBObject obj)
obj
- @CheckReturnValue @Nullable public static java.lang.Object makeCurrentValue(@Nonnull DataSource ds, @Nonnull DBField field, @Nullable java.lang.Object userValue, @Nullable java.lang.Object previousValueActual, @Nullable GlobalKey currentKey, @Nullable java.lang.String language, @Nullable FldParams inParams)
ds
- the data sourcefield
- The fielduserValue
- previousValueActual
- actual valuecurrentKey
- language
- the languageinParams
- the parameters to use@Nullable @CheckReturnValue public static GlobalKey makeLinkedKey(DataSource ds, DBField field, boolean isLinked, java.lang.Object orgValue, FldParams inParams) throws java.lang.Exception
ds
- the data sourcefield
- The fieldisLinked
- orgValue
- inParams
- java.lang.Exception
- a serious problem@CheckReturnValue @Nullable public DBObject getDeletedBy()
public void setDeletedBy(@Nullable DBObject obj)
obj
- public void doUndelete() throws java.lang.Exception
java.lang.Exception
- a serious problempublic void setClearedBy(@Nonnull DBObject obj, @Nonnull DBField field)
obj
- field
- The fieldpublic void addCascadeDelete(@Nonnull DBObject obj)
obj
- @CheckReturnValue @Nonnull public Login getLogin()
@CheckReturnValue public long lastTouched()
public void touch(long time)
time
- @CheckReturnValue @Nonnull public static java.lang.Long makeKey(@Nonnull DBField field)
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.