Package com.storedobject.accounts
Class EntityAccount
java.lang.Object
com.storedobject.core.StoredObject
com.storedobject.core.Account
com.storedobject.accounts.EntityAccount
- All Implemented Interfaces:
Displayable
,StringFiller
,HasId
,HasName
,OfEntity
- Direct Known Subclasses:
InstantaneousAccount
EntityAccount is a subclass of com.storedobject.core.Account that represents an account associated with an entity.
- Author:
- Syam
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Adds a new column with the specified name and type to the provided Columns object.static EntityAccount
createFor
(TransactionManager tm, AccountEntity<?> accountEntity) Creates an EntityAccount for the providedAccountEntity
.static EntityAccount
createFor
(TransactionManager tm, AccountEntity<?> accountEntity, int category, int type) Creates an EntityAccount for the providedAccountEntity
, category and type of invoice.static EntityAccount
createFor
(TransactionManager tm, AccountEntity<?> accountEntity, Class<? extends EntityAccount> accountClass) Creates an EntityAccount for the providedAccountEntity
and class ofEntityAccount
.static EntityAccount
createFor
(TransactionManager tm, AccountEntity<?> accountEntity, Currency currency, Class<? extends EntityAccount> accountClass) Creates an EntityAccount for the providedAccountEntity
and class ofEntityAccount
.static EntityAccount
get
(SystemEntity systemEntity, String name) Retrieves an instance ofEntityAccount
based on the givenSystemEntity
and name.Retrieves the associated entity for this EntityAccount.Returns the entity Id.Retrieves the associated Tax Region for this EntityAccount.Returns the Tax Region Id.final String
getTitle()
Retrieves the name of the entity associated with this account.static void
Adds the specified column list to the indices.final boolean
Determines whether the account entity associated with this EntityAccount object is a business entity.final boolean
Determines whether the entity account is associated with a personal party.static ObjectIterator
<? extends EntityAccount> list
(SystemEntity systemEntity, String name) Returns an iterator of EntityAccount objects that match the specified systemEntity and name.void
setEntity
(AccountEntity<?> entity) Sets the associated entity for the EntityAccount.void
Sets the entity id.void
setEntity
(BigDecimal idValue) Sets the entity object with the provided id value.void
setTaxRegion
(Id taxRegionId) Sets the Tax Region id.void
setTaxRegion
(TaxRegion taxRegion) Sets the associated Tax Region for the EntityAccount.void
setTaxRegion
(BigDecimal idValue) Sets the Tax Region object with the provided id value.protected void
Validate account status to make sure that every status bit value adheres to the type of account.void
This will be invoked by the system whenever the object is saved to the DB.Methods inherited from class com.storedobject.core.Account
actionPrefixForUI, addToOpeningBalance, addToOpeningBalance, allow, browseColumns, close, createAmount, createLocalCurrencyAmount, displayColumns, getAccountNumber, getAccountStatus, getAlternateNumber, getBalance, getBalance, getByNameOrNumber, getChart, getChartId, getCurrency, getFor, getLedger, getLedger, getLocalCurrency, getLocalCurrencyBalance, getLocalCurrencyBalance, getLocalCurrencyOpeningBalance, getLocalCurrencyOpeningBalance, getName, getNumber, getOpeningBalance, getOpeningBalance, getStatusDescription, getStatusDescription, getSystemEntity, getSystemEntityId, isClosed, isForeignCurrency, isLocalCurrency, listByNameOrNumber, protectedColumns, readOnlyColumns, refresh, reopen, setAccountStatus, setAlternateNumber, setBalance, setChart, setChart, setChart, setCurrency, setCurrency, setLocalCurrencyBalance, setLocalCurrencyOpeningBalance, setName, setNumber, setOpeningBalance, setOpeningBalance, setOpeningBalance, setSystemEntity, setSystemEntity, setSystemEntity, toDisplay, toString, toSubstring, validateDelete
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, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, 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, getUniqueCondition, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, 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, 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, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildAttach, validateChildDetach, validateChildUpdate, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.storedobject.core.OfEntity
check, findSystemEntityId
-
Constructor Details
-
Method Details
-
columns
Adds a new column with the specified name and type to the provided Columns object.- Parameters:
columns
- The Columns object to add the column to.
-
indices
Adds the specified column list to the indices.- Parameters:
indices
- The Indices object to add the column list to.
-
setEntity
Sets the entity id.- Parameters:
entityId
- The id of the entity to set.- Throws:
Set_Not_Allowed
- If the method is called while loading.
-
setEntity
Sets the entity object with the provided id value.- Parameters:
idValue
- the ID value of the entity
-
setEntity
Sets the associated entity for the EntityAccount. If the given entity is null, sets the entity ID to null.- Parameters:
entity
- The AccountEntity to associate with the EntityAccount.
-
getEntityId
Returns the entity Id.- Returns:
- The entity Id.
-
getEntity
Retrieves the associated entity for this EntityAccount.- Returns:
- The AccountEntity associated with this EntityAccount. If the entity has not been fetched yet, it will be fetched and cached before returning.
-
setTaxRegion
Sets the Tax Region id.- Parameters:
taxRegionId
- The id of the Tax Region to set.- Throws:
Set_Not_Allowed
- If the method is called while loading.
-
setTaxRegion
Sets the Tax Region object with the provided id value.- Parameters:
idValue
- the ID value of the Tax Region
-
setTaxRegion
Sets the associated Tax Region for the EntityAccount. If the given Tax Region is null, sets the Tax Region ID to null.- Parameters:
taxRegion
- The AccountEntity to associate with the EntityAccount.
-
getTaxRegionId
Returns the Tax Region Id.- Returns:
- The Tax Region Id.
-
getTaxRegion
Retrieves the associated Tax Region for this EntityAccount.- Returns:
- The Tax Region associated with this EntityAccount.
-
get
Retrieves an instance ofEntityAccount
based on the givenSystemEntity
and name.- Parameters:
systemEntity
- The system entity associated with the account.name
- The name of the account.- Returns:
- An instance of
EntityAccount
matching the given system entity and name.
-
list
Returns an iterator of EntityAccount objects that match the specified systemEntity and name.- Parameters:
systemEntity
- The SystemEntity object to filter the accounts by.name
- The name of the accounts to retrieve.- Returns:
- An iterator of EntityAccount objects that match the specified systemEntity and name.
-
getTitle
-
validateData
Description copied from class:StoredObject
This will be invoked by the system whenever the object is saved to the DB. It will be invoked in all cases, while creating new objects and updating/deleting/un-deleting existing objects. If any exception is raised by this method, the process of saving to the DB will be abandoned.
Note: This method is mainly used to validate the data of all attributes of the object and it may be used by others for validating the object. For example, front-end data-entry systems can use this method for validating the object.
- Overrides:
validateData
in classAccount
- Parameters:
tm
- Current transaction manager.- Throws:
Exception
- If data is invalid.
-
validateAccountStatus
Description copied from class:Account
Validate account status to make sure that every status bit value adheres to the type of account.- Overrides:
validateAccountStatus
in classAccount
- Throws:
Exception
- if status is invalid.
-
isPersonal
public final boolean isPersonal()Determines whether the entity account is associated with a personal party.- Returns:
- true if the entity account is associated with a personal party, false otherwise
-
isBusiness
public final boolean isBusiness()Determines whether the account entity associated with this EntityAccount object is a business entity.- Returns:
true
if the account entity is a business entity,false
otherwise.
-
createFor
public static EntityAccount createFor(TransactionManager tm, AccountEntity<?> accountEntity) throws Exception Creates an EntityAccount for the providedAccountEntity
.- Parameters:
tm
- The TransactionManager to be used for database transactions.accountEntity
- TheAccountEntity
for which theEntityAccount
needs to be created.- Returns:
- The created EntityAccount object.
- Throws:
Exception
-
createFor
public static EntityAccount createFor(TransactionManager tm, AccountEntity<?> accountEntity, int category, int type) throws Exception Creates an EntityAccount for the providedAccountEntity
, category and type of invoice.Note: Category is typically 0 for suppliers and 1 for customers.
- Parameters:
tm
- The TransactionManager to be used for database transactions.accountEntity
- TheAccountEntity
for which theEntityAccount
needs to be created.- Returns:
- The created EntityAccount object.
- Throws:
Exception
-
createFor
public static EntityAccount createFor(TransactionManager tm, AccountEntity<?> accountEntity, Class<? extends EntityAccount> accountClass) throws Exception Creates an EntityAccount for the providedAccountEntity
and class ofEntityAccount
.- Parameters:
tm
- The TransactionManager to be used for database transactions.accountEntity
- TheAccountEntity
for which theEntityAccount
needs to be created.accountClass
- Class of theEntityAccount
.- Returns:
- The created EntityAccount object.
- Throws:
Exception
-
createFor
public static EntityAccount createFor(TransactionManager tm, AccountEntity<?> accountEntity, Currency currency, Class<? extends EntityAccount> accountClass) throws Exception Creates an EntityAccount for the providedAccountEntity
and class ofEntityAccount
.- Parameters:
tm
- The TransactionManager to be used for database transactions.accountEntity
- TheAccountEntity
for which theEntityAccount
needs to be created.currency
- Currency of the account.accountClass
- Class of theEntityAccount
.- Returns:
- The created EntityAccount object.
- Throws:
Exception
-