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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAdds a new column with the specified name and type to the provided Columns object.static EntityAccountcreateFor(TransactionManager tm, AccountEntity<?> accountEntity) Creates an EntityAccount for the providedAccountEntity.static EntityAccountcreateFor(TransactionManager tm, AccountEntity<?> accountEntity, int category, int type) Creates an EntityAccount for the providedAccountEntity, category and type of invoice.static EntityAccountcreateFor(TransactionManager tm, AccountEntity<?> accountEntity, Class<? extends EntityAccount> accountClass) Creates an EntityAccount for the providedAccountEntityand class ofEntityAccount.static EntityAccountcreateFor(TransactionManager tm, AccountEntity<?> accountEntity, Currency currency, Class<? extends EntityAccount> accountClass) Creates an EntityAccount for the providedAccountEntityand class ofEntityAccount.static EntityAccountget(SystemEntity systemEntity, String name) Retrieves an instance ofEntityAccountbased on the givenSystemEntityand 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 StringgetTitle()Retrieves the name of the entity associated with this account.static voidAdds the specified column list to the indices.final booleanDetermines whether the account entity associated with this EntityAccount object is a business entity.final booleanDetermines 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.voidsetEntity(AccountEntity<?> entity) Sets the associated entity for the EntityAccount.voidSets the entity id.voidsetEntity(BigDecimal idValue) Sets the entity object with the provided id value.voidsetTaxRegion(Id taxRegionId) Sets the Tax Region id.voidsetTaxRegion(TaxRegion taxRegion) Sets the associated Tax Region for the EntityAccount.voidsetTaxRegion(BigDecimal idValue) Sets the Tax Region object with the provided id value.protected voidValidate account status to make sure that every status bit value adheres to the type of account.voidThe system will invoke this 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, searchColumns, setAccountStatus, setAlternateNumber, setBalance, setChart, setChart, setChart, setCurrency, setCurrency, setLocalCurrencyBalance, setLocalCurrencyOpeningBalance, setName, setNumber, setOpeningBalance, setOpeningBalance, setOpeningBalance, setSystemEntity, setSystemEntity, setSystemEntity, toDisplay, toString, toSubstring, validateDeleteMethods 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, getUniqueCondition, 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, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildAttach, validateChildDetach, validateChildUpdate, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEqualsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.storedobject.core.OfEntity
check, findSystemEntityId
-
Constructor Details
-
EntityAccount
public EntityAccount()Creates a new instance of EntityAccount.
-
-
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 ofEntityAccountbased on the givenSystemEntityand name.- Parameters:
systemEntity- The system entity associated with the account.name- The name of the account.- Returns:
- An instance of
EntityAccountmatching 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:StoredObjectThe system will invoke this whenever the object is saved to the DB. It will be invoked in all cases while creating new objects and updating/deleting/undeleting 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:
validateDatain classAccount- Parameters:
tm- Current transaction manager.- Throws:
Exception- If data is invalid.
-
validateAccountStatus
Description copied from class:AccountValidate account status to make sure that every status bit value adheres to the type of account.- Overrides:
validateAccountStatusin 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:
trueif the account entity is a business entity,falseotherwise.
-
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- TheAccountEntityfor which theEntityAccountneeds to be created.- Returns:
- The created EntityAccount object.
- Throws:
Exception- if any error occurs.
-
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- TheAccountEntityfor which theEntityAccountneeds to be created.category- Category.type- Type.- Returns:
- The created EntityAccount object.
- Throws:
Exception- if any error occurs.
-
createFor
public static EntityAccount createFor(TransactionManager tm, AccountEntity<?> accountEntity, Class<? extends EntityAccount> accountClass) throws Exception Creates an EntityAccount for the providedAccountEntityand class ofEntityAccount.- Parameters:
tm- The TransactionManager to be used for database transactions.accountEntity- TheAccountEntityfor which theEntityAccountneeds to be created.accountClass- Class of theEntityAccount.- Returns:
- The created EntityAccount object.
- Throws:
Exception- if any error occurs.
-
createFor
public static EntityAccount createFor(TransactionManager tm, AccountEntity<?> accountEntity, Currency currency, Class<? extends EntityAccount> accountClass) throws Exception Creates an EntityAccount for the providedAccountEntityand class ofEntityAccount.- Parameters:
tm- The TransactionManager to be used for database transactions.accountEntity- TheAccountEntityfor which theEntityAccountneeds to be created.currency- Currency of the account.accountClass- Class of theEntityAccount.- Returns:
- The created EntityAccount object.
- Throws:
Exception- if any error occurs.
-