Package com.storedobject.core
Class UserAction
java.lang.Object
com.storedobject.core.StoredObject
com.storedobject.core.UserAction
- All Implemented Interfaces:
Displayable,StringFiller,HasId
Represents an action performed by a system user. This class maps the relationship
between a
SystemUser and a UIAction.
Each instance of this class corresponds to a unique combination of a user and an action, enforcing that a user can only perform an action once in the context of a specific condition.
- Author:
- Syam
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic UserActionget(SystemUser user, UIAction action) Retrieves a UserAction object based on the specified SystemUser and UIAction.static UserActionget(SystemUser user, String action) Retrieves a UserAction based on the given SystemUser and action.static UserActionget(TransactionManager tm, String action) Retrieves a UserAction object associated with a given action.Retrieves the UIAction object associated with the current entity.Retrieves the unique identifier associated with the action.static SystemUsergetActor(StoredObject so, String action) Retrieves the system user who is the actor associated with a specific action for a stored object.Retrieves the related SystemUser instance associated with this UserAction.Retrieves the unique identifier associated with the system user for this action.Gets the unique index condition of this object.static voidvoidSets the action for the UserAction instance.voidSets the action for this instance using the providedUIAction.voidsetAction(BigDecimal idValue) Sets the action associated with this object using the provided BigDecimal value.voidsetSystemUser(Id userId) Sets the system user for this instance.voidsetSystemUser(SystemUser user) Sets the system user for this UserAction instance.voidsetSystemUser(BigDecimal idValue) Sets the system user for this UserAction instance using a BigDecimal value.voidValidates the data for the current object by performing type checks and ensuring no duplicates.Methods inherited from class com.storedobject.core.StoredObject
addLink, addLink, addLink, addLink, addLink, addLink, addLink, addLink, checkCurrency, checkCurrency, checkForDuplicate, checkForDuplicate, checkTimeZone, checkTransaction, clearObjectLinks, contemporary, copy, copy, count, count, count, count, count, count, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, create, created, delete, delete, delete, deleted, directUpdate, equals, exists, exists, exists, exists, exists, existsFileData, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsMaster, existsMaster, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, family, family, family, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getActor, getAttachment, getAttachmentId, getChildren, getContemporaryOf, getDeleted, getDeleted, getExistsCondition, getExistsCondition, getFileData, getFileData, getHistorical, getId, getKeyIndex, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getNotExistsCondition, getNotExistsCondition, getParent, getParent, getParent, getParentId, getParentId, getParentId, getRelated, getRelated, getTransaction, getTransactionId, getTransactionIP, getUnique, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, listDeletedIds, listFileData, listFileData, listHistory, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listTree, listTree, listTree, listTree, listViaQuery, listViaQuery, load, load, load, load, loadAttributesFrom, loaded, loading, makeNew, makeVirtual, migrate, moduleName, nextVersion, objectLink, objectLink, objectLink, objectLinks, objectLinks, old, person, previousVersion, previousVersion, query, query, query, query, query, query, query, query, query, query, query, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, reload, reload, reloaded, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeReverseLinks, removeReverseLinks, save, save, save, save, save, save, save, save, save, save, save, save, save, save, save, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, toDisplay, toString, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildAttach, validateChildDetach, validateChildUpdate, validateDelete, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
-
Constructor Details
-
UserAction
public UserAction()Default constructor for the UserAction class. This constructor creates an instance of UserAction with default attribute values.
-
-
Method Details
-
columns
-
indices
-
getUniqueCondition
Description copied from class:StoredObjectGets the unique index condition of this object.- Overrides:
getUniqueConditionin classStoredObject- Returns:
- Unique index condition.
-
setSystemUser
Sets the system user for this instance. Throws an exception if the system user cannot be changed under the current conditions.- Parameters:
userId- The ID of the system user to be set.
-
setSystemUser
Sets the system user for this UserAction instance using a BigDecimal value.- Parameters:
idValue- The BigDecimal representing the identifier of the system user.
-
setSystemUser
Sets the system user for this UserAction instance. Converts the provided SystemUser object into its associated ID using the `getId` method and assigns it to the corresponding field.- Parameters:
user- the SystemUser instance to set. If null, it clears the associated user ID.
-
getSystemUserId
Retrieves the unique identifier associated with the system user for this action.- Returns:
- The unique identifier representing the system user.
-
getSystemUser
Retrieves the related SystemUser instance associated with this UserAction. This method fetches the SystemUser object linked via the systemUserId field.- Returns:
- The related SystemUser instance, or null if no association exists.
-
setAction
Sets the action for the UserAction instance. This method assigns the provided action ID to the actionId field if the object is not in a loading state and the given action ID differs from the current one. If the set operation is not allowed, it throws a Set_Not_Allowed exception.- Parameters:
actionId- The ID of the action to be set. This must be a validIdinstance. If the action ID cannot be changed due to current constraints, an exception is thrown.- Throws:
Set_Not_Allowed- if attempting to set the action while not allowed.
-
setAction
Sets the action associated with this object using the provided BigDecimal value. This method internally creates an Id object from the given BigDecimal value and updates the action.- Parameters:
idValue- The BigDecimal value representing the action's unique identifier.
-
setAction
-
getActionId
Retrieves the unique identifier associated with the action.- Returns:
- the Id representing the action's unique identifier
-
getAction
Retrieves the UIAction object associated with the current entity.- Returns:
- the UIAction instance linked to this entity through the actionId, or null if no association exists.
-
validateData
Validates the data for the current object by performing type checks and ensuring no duplicates.- Overrides:
validateDatain classStoredObject- Parameters:
tm- the TransactionManager instance used to perform type checks and validation.- Throws:
Exception- if any data validation fails, including type mismatches or duplicate entries.
-
get
Retrieves a UserAction based on the given SystemUser and action.- Parameters:
user- the SystemUser for whom the action is being retrievedaction- the action identifier as a string- Returns:
- the UserAction corresponding to the specified user and action
-
get
Retrieves a UserAction object based on the specified SystemUser and UIAction. If either the user or action is null, the method returns null.- Parameters:
user- the SystemUser whose associated action is to be retrievedaction- the UIAction to be associated with the given SystemUser- Returns:
- the corresponding UserAction object if both user and action are valid; otherwise, null
-
get
Retrieves a UserAction object associated with a given action. If the action does not exist, it will be created and associated UserAction will be initialized and saved.- Parameters:
tm- the TransactionManager instance used for transaction operations and user retrievalaction- the action code or description to find or create the associated UserAction- Returns:
- the UserAction associated with the given action, or null if the save operation fails
-
getActor
Retrieves the system user who is the actor associated with a specific action for a stored object.- Parameters:
so- the stored object for which the actor is to be retrievedaction- the action identifier used to determine the associated actor- Returns:
- the system user associated with the specified action for the given stored object, or null if no actor is identified
-