Class AccountEntity<T extends StoredObject>
- Type Parameters:
T
- Underlying party type.
- All Implemented Interfaces:
Displayable
,StringFiller
,HasContacts
,HasId
,HasName
,HasShortName
- Direct Known Subclasses:
BusinessEntity
,PersonalEntity
- Author:
- Syam
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]
Returns the columns to be displayed in the browser for the AccountEntity class.static void
Adds columns to the provided Columns interface for an entity.static AccountEntity
<?> Get the address.getEmail()
Get the email address.abstract String
getName()
Retrieves the name of the entity associated with this account.final T
getParty()
Retrieves the party associated with this account entity.Retrieves the party class associated with this object.protected abstract Id
Retrieves the ID of the party associated with this object.long
getPhone()
Get the phone number.Retrieves the primary address of the AccountEntity.Returns the primary address value of the AccountEntity.Retrieves the primary email address of the account entity.Retrieves the primary phone number of the account entity.Retrieves the short name of the Entity.Returns the tax code of the AccountEntity.static void
Adds columns to the provided Indices interface for an entity.final boolean
Determines whether the account entity is a business entity.final boolean
Determines whether the account entity is associated with a personal party.static ObjectIterator
<AccountEntity<?>> final void
Sets the party associated with this object.void
Sets the party for this object.protected abstract void
setPartyId
(Id id) Sets the party ID for the given object.void
setPrimaryAddress
(String primaryAddress) Sets the primary address of the AccountEntity.void
setPrimaryEmail
(String primaryEmail) Sets the primary email address for the account entity.void
setPrimaryPhone
(String primaryPhone) Sets the primary phone number for the account entity.void
setShortName
(String shortName) Sets the short name of the Entity.void
setTaxCode
(String taxCode) Sets the tax code for the entity.toString()
String representation of the instance.void
This will be invoked by the system whenever the object is saved to the DB.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, toDisplay, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildAttach, validateChildDetach, validateChildUpdate, validateDelete, 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.HasContacts
getAddress, getContact, getContact, getContactGroupingCode, getContactObject, getContactObject, getContactObject, getContactOwnerId, getContactRaw, getContactRaw, getEmail, getId, getMobile, getPhone, getTelegram, listContacts, listContactTypes, setContact, setContact
-
Constructor Details
-
AccountEntity
public AccountEntity()Represents an account entity.The AccountEntity class is a base class for PersonalEntity and BusinessEntity classes used in the EntityAccount class. It provides common functionality and fields related to an account entity.
The AccountEntity class is an abstract class and cannot be instantiated directly.
This class extends the StoredObject class and implements the HasContacts, HasName, and HasShortName interfaces.
-
-
Method Details
-
columns
Adds columns to the provided Columns interface for an entity. The columns represent the following fields in the entity: - ShortName (text): The short name of the entity. - PrimaryAddress (address): The primary address of the entity. - PrimaryEmail (email): The primary email address of the entity. - PrimaryPhone (phone): The primary phone number of the entity. - TaxCode (text): The tax code of the entity.- Parameters:
columns
- The Columns interface to add the columns to.
-
indices
Adds columns to the provided Indices interface for an entity. The columns represent the following fields in the entity: - lower(ShortName) (text): Adds an index for the ShortName field in the entity, ignoring case.- Parameters:
indices
- The Indices interface to add the columns to.
-
browseColumns
Returns the columns to be displayed in the browser for the AccountEntity class.- Returns:
- An array of strings representing the columns.
-
setParty
Sets the party associated with this object.- Parameters:
partyId
- the ID of the party to be set- Throws:
Set_Not_Allowed
- if the method is called when not loading and the provided party ID is different from the current party ID
-
setPartyId
Sets the party ID for the given object.- Parameters:
id
- The party ID to be set.
-
setParty
Sets the party for this object.- Parameters:
party
- The party to set. (null is allowed)
-
getPartyId
Retrieves the ID of the party associated with this object.- Returns:
- The ID of the party
-
getParty
Retrieves the party associated with this account entity. If the party is not already initialized, it retrieves the related instance from the database using the party class and party id. If the instance is old, it might return an old instance.- Returns:
- The party associated with this account entity, or null if it is not available for the given parameters.
-
setShortName
Sets the short name of the Entity.- Parameters:
shortName
- The new short name.
-
getShortName
Retrieves the short name of the Entity.- Specified by:
getShortName
in interfaceHasShortName
- Returns:
- The short name.
-
setPrimaryAddress
Sets the primary address of the AccountEntity.- Parameters:
primaryAddress
- The new primary address.
-
getPrimaryAddress
-
getPrimaryAddressValue
Returns the primary address value of the AccountEntity.- Returns:
- The primary address value as an instance of the Address class.
-
setPrimaryEmail
Sets the primary email address for the account entity.- Parameters:
primaryEmail
- The new primary email address.
-
getPrimaryEmail
-
setPrimaryPhone
Sets the primary phone number for the account entity.- Parameters:
primaryPhone
- The primary phone number to set.
-
getPrimaryPhone
-
setTaxCode
Sets the tax code for the entity.- Parameters:
taxCode
- The tax code to be set for the entity.
-
getTaxCode
-
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 classStoredObject
- Parameters:
tm
- Current transaction manager.- Throws:
Exception
- If data is invalid.
-
getPartyClass
-
getName
Retrieves the name of the entity associated with this account.- Specified by:
getName
in interfaceHasContacts
- Specified by:
getName
in interfaceHasName
- Returns:
- The name of the entity as a string.
-
isPersonal
public final boolean isPersonal()Determines whether the account entity is associated with a personal party.- Returns:
- true if the account entity is associated with a personal party, false otherwise
-
isBusiness
public final boolean isBusiness()Determines whether the account entity is a business entity.- Returns:
true
if the account entity is a business entity,false
otherwise.
-
toString
Description copied from class:StoredObject
String representation of the instance. Mostly used for logging purposes.- Overrides:
toString
in classStoredObject
- Returns:
- String representation of the instance.
-
getAddress
Description copied from interface:HasContacts
Get the address. (It will look for an address with address type name "Address").- Specified by:
getAddress
in interfaceHasContacts
- Returns:
- Address instance if available, otherwise
null
.
-
getEmail
Description copied from interface:HasContacts
Get the email address. (It will look for an email address with type name "Email").- Specified by:
getEmail
in interfaceHasContacts
- Returns:
- Email address if available, otherwise
null
.
-
getPhone
public long getPhone()Description copied from interface:HasContacts
Get the phone number. (It will look for a phone number with type name "Phone").- Specified by:
getPhone
in interfaceHasContacts
- Returns:
- Phone number if available, otherwise
null
.
-
get
-
list
-