Class Customer
- All Implemented Interfaces:
APIModifiable
,Attributed
,Attributed10
,Attributed20
,Attributed3
,Attributed30
,Attributed6
,Attributed8
,DataChangeRequestEnabledObject
,MetaAttributed
,Persistable
,TreeObject
,TreeObjectWithArtificialRoot
,TreeObjectWithCallbacks
,UserGroupRestrictedObject
-
Nested Class Summary
Nested classes/interfaces inherited from class PersistedObject
PersistedObject.BatchDelete, PersistedObject.BulkloadFilterCheckCallback, PersistedObject.ComputedFieldMapping, PersistedObject.ComputedFields, PersistedObject.PersistedObjectMeta, PersistedObject.VirtualField, PersistedObject.VirtualFieldMapping, PersistedObject.VirtualSearchFields, PersistedObject.VirtualSortFields
-
Field Summary
Fields inherited from class PartitionedObject
FIELD_PARTITION, FIELD_PARTITIONID
Fields inherited from class PersistedObject
FIELD_CREATEDATE, FIELD_CREATEDBY, FIELD_DELETEDATE, FIELD_DELETEDBY, FIELD_ID, FIELD_ISDELETED, FIELD_LASTUPDATEDATE
Fields inherited from class DomainObject
DEFAULT_MAX_PACKET_SIZE
Fields inherited from interface Attributed10
ATTRIBUTE10_NAME, ATTRIBUTE9_NAME
Fields inherited from interface Attributed20
ATTRIBUTE11_NAME, ATTRIBUTE12_NAME, ATTRIBUTE13_NAME, ATTRIBUTE14_NAME, ATTRIBUTE15_NAME, ATTRIBUTE16_NAME, ATTRIBUTE17_NAME, ATTRIBUTE18_NAME, ATTRIBUTE19_NAME, ATTRIBUTE20_NAME
Fields inherited from interface Attributed3
ATTRIBUTE1_NAME, ATTRIBUTE2_NAME, ATTRIBUTE3_NAME
Fields inherited from interface Attributed30
ATTRIBUTE21_NAME, ATTRIBUTE22_NAME, ATTRIBUTE23_NAME, ATTRIBUTE24_NAME, ATTRIBUTE25_NAME, ATTRIBUTE26_NAME, ATTRIBUTE27_NAME, ATTRIBUTE28_NAME, ATTRIBUTE29_NAME, ATTRIBUTE30_NAME, ATTRIBUTES_NAMES
Fields inherited from interface Attributed6
ATTRIBUTE4_NAME, ATTRIBUTE5_NAME, ATTRIBUTE6_NAME
Fields inherited from interface Attributed8
ATTRIBUTE7_NAME, ATTRIBUTE8_NAME
Fields inherited from interface UserGroupRestrictedObject
FIELD_USERGROUPEDIT, FIELD_USERGROUPVIEWDETAILS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttributeMetaSearchCriteria
(Search search) This methods needs to be overridden in case a set of AttributeMeta objects is not applicable per partition.This method returns a cache key that identifies a set of AttributeMetas For a set that applies to the entire partition (e.g.The business key represents the logical uniqueness of the object.getClassByName
(String valueName, BiFunction<MetaAttributed, String, AttributeMeta> metaLoader) Needed to get attribute by name in formulasgetName()
Returns unique identifier of the parent object in the tree.String[]
The fields that represent the business key of the object, seePersistedObject.getBusinessKey()
.Returns aTreeObject
which should be used as an artificial root of the tree when the root is needed, i.e. by the sgwt client.getValueByName
(String valueName, BiFunction<MetaAttributed, String, AttributeMeta> metaLoader) boolean
isParent()
Returnstrue
if this is a parent object,false
otherwise.boolean
onPreProcessing
(Map<String, Object> values, LocalDateTime targetDate) Invoked before processing starts.void
onTreeObjectAdd
(Map<String, Object> data, PersistedObjectService objService) Sets up newTreeObject
from the data.void
onTreeObjectAddChildren
(Map<String, Object> data, PersistedObjectService objService) Gets called whilethis
TreeObject
is about to be set as parent of multiple children at once.boolean
onTreeObjectRemove
(Map<String, Object> data, PersistedObjectService objService) Gets called whilethis
TreeObject
is being removed from the tree.void
onTreeObjectUpdate
(Map<String, Object> data, PersistedObjectService objService) Updatesthis
TreeObject
based on the data.void
removeValue
(String property) void
saveBigDecimalValue
(String property, BigDecimal value) void
saveDateTimeValue
(String property, DateTime value) void
saveDateValue
(String property, Date value) void
saveIntegerValue
(String property, Integer value) void
saveStringValue
(String property, String value) void
setCustomerId
(String customerId) void
void
Marks this object as parent/leaf.void
setParentId
(Long parentId) (Re)sets the parent ofthis
object.void
setUserGroupEdit
(String userGroup) void
setUserGroupViewDetails
(String userGroup) toString()
boolean
userGroupEditBulkloadFilter
(PersistedObjectService objService, List<String> header, List<Object> line, User user, Map<String, Object> cache) A callback during generic loaddata commands that enables the domain objects to implement row filtering based on group edit-ability.boolean
validate
(ValidationVisitor validationVisitor, PersistedObjectService objService) Override to implement per-object validation rulesMethods inherited from class AttributedObject30
clearAttributes, getAllAttributesList, getAllRawAttributesMap, getAttribute1, getAttribute10, getAttribute11, getAttribute12, getAttribute13, getAttribute14, getAttribute15, getAttribute16, getAttribute17, getAttribute18, getAttribute19, getAttribute2, getAttribute20, getAttribute21, getAttribute22, getAttribute23, getAttribute24, getAttribute25, getAttribute26, getAttribute27, getAttribute28, getAttribute29, getAttribute3, getAttribute30, getAttribute4, getAttribute5, getAttribute6, getAttribute7, getAttribute8, getAttribute9, getAttributeCount, getAttributeNames, getFieldLength, getTypedAttribute, getTypedAttribute1, getTypedAttribute10, getTypedAttribute11, getTypedAttribute12, getTypedAttribute13, getTypedAttribute14, getTypedAttribute15, getTypedAttribute16, getTypedAttribute17, getTypedAttribute18, getTypedAttribute19, getTypedAttribute2, getTypedAttribute20, getTypedAttribute21, getTypedAttribute22, getTypedAttribute23, getTypedAttribute24, getTypedAttribute25, getTypedAttribute26, getTypedAttribute27, getTypedAttribute28, getTypedAttribute29, getTypedAttribute3, getTypedAttribute30, getTypedAttribute4, getTypedAttribute5, getTypedAttribute6, getTypedAttribute7, getTypedAttribute8, getTypedAttribute9, setAttribute1, setAttribute10, setAttribute11, setAttribute12, setAttribute13, setAttribute14, setAttribute15, setAttribute16, setAttribute17, setAttribute18, setAttribute19, setAttribute2, setAttribute20, setAttribute21, setAttribute22, setAttribute23, setAttribute24, setAttribute25, setAttribute26, setAttribute27, setAttribute28, setAttribute29, setAttribute3, setAttribute30, setAttribute4, setAttribute5, setAttribute6, setAttribute7, setAttribute8, setAttribute9
Methods inherited from class AttributedObject
getAllAttributesMap, getAttribute, getAttribute, getAttributeClass, getAttributeClass, getAttributeMetaInfo, getAttributeType, getTypedAttribute, getTypedAttribute
Methods inherited from class PartitionedObject
addUniqueConstraint, getLoginNameByUserId, getPartition, setPartition
Methods inherited from class PersistedObject
auditOperation, bumpVersion, canAdd, canDelete, canEdit, canEdit, canRead, createDate, doHardDelete, entityIsSafeInserted, entityIsSafeInserted, findAnnotationRecursively, getBulkloadMap, getCreateDate, getCreatedBy, getDbColumnNameForField, getDefaultSortKey, getDeleteDate, getDeletedBy, getId, getLastUpdateBy, getLastUpdateDate, getTypeCode, getTypedId, getVersion, getVirtualFieldMappings, isAudited, isDeleted, isVirtualField, lastUpdateDate, notifyOnBusinessKeyChange, onBusinessKeyChange, onDelete, onSavedOrUpdated, onSaveOrUpdate, setCreateDate, setCreateDateShouldBeIgnored, setCreateDateTime, setCreatedBy, setDeleted, setDeleteDate, setDeletedBy, setId, setLastUpdateBy, setLastUpdateDate, setLastUpdateDateTime, setTypedId, setVersion, userGroupEditBulkloadFilter
Methods inherited from class DomainObject
deepCopy, getNewMidnightDate, getNewMidnightDateTime, isMidnight, isMidnight, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerializedSizeOK, jsonSerializeToBytes, jsonSerializeToBytes, setToDayEnd, setToDayEnd, setToMidnight, setToMidnight, setToMidnightAsLocalDateTime, toPropertyMap
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface Attributed
getAttributeClass, getAttributeExtensionNames, setBigDecimalValue, setDateTimeValue, setDateValue, setIntegerValue
Methods inherited from interface Attributed30
getRawAttribute, setRawAttribute
Methods inherited from interface MetaAttributed
getPartition
Methods inherited from interface TreeObject
getId
-
Field Details
-
FIELD_CUSTOMERID
- See Also:
-
-
Constructor Details
-
Customer
public Customer() -
Customer
-
Customer
public Customer(Partition partition)
-
-
Method Details
-
getCustomerId
-
getCustomerid
Needed to get attribute by name in formulas- Returns:
-
setCustomerId
-
getName
-
setName
-
getParentId
Description copied from interface:net.pricefx.domain.TreeObject
Returns unique identifier of the parent object in the tree. May benull
to indicatethis
object is an immediate child of the virtual root object.- Specified by:
getParentId
in interfaceTreeObject
-
setParentId
Description copied from interface:net.pricefx.domain.TreeObject
(Re)sets the parent ofthis
object. May benull
. In such casethis
object becomes an immediate child of the virtual root object.- Specified by:
setParentId
in interfaceTreeObject
-
isParent
public boolean isParent()Description copied from interface:net.pricefx.domain.TreeObject
Returnstrue
if this is a parent object,false
otherwise.Please note that parent objects still may have no children. On the other hand, a leaf object having children is considered illegal. I.e. it should always be ensured that if a given object has at least one child,
this
method returnstrue
.- Specified by:
isParent
in interfaceTreeObject
-
setParent
Description copied from interface:net.pricefx.domain.TreeObject
Marks this object as parent/leaf. IfisParent
isfalse
ornull
,this
object shall have no children. The implementation may check this condition and throw an exception if that is not met (or optionally reparent the children).Note: passing in
null
equals to passing infalse
- Specified by:
setParent
in interfaceTreeObject
-
getUserGroupEdit
- Specified by:
getUserGroupEdit
in interfaceUserGroupRestrictedObject
-
setUserGroupEdit
- Specified by:
setUserGroupEdit
in interfaceUserGroupRestrictedObject
-
getUserGroupViewDetails
- Specified by:
getUserGroupViewDetails
in interfaceUserGroupRestrictedObject
-
setUserGroupViewDetails
- Specified by:
setUserGroupViewDetails
in interfaceUserGroupRestrictedObject
-
getSignificantFields
Description copied from class:net.pricefx.domain.PersistedObject
The fields that represent the business key of the object, seePersistedObject.getBusinessKey()
. For some objects, the business key is dynamically generated instead, seeDynamicBusinessKeyObject
.- Overrides:
getSignificantFields
in classPersistedObject
-
getBusinessKey
Description copied from class:net.pricefx.domain.PersistedObject
The business key represents the logical uniqueness of the object. The keys of the returnedMap
must be the same as the values returned byPersistedObject.getSignificantFields()
.Usually this is the same as
PersistedObject.addUniqueConstraint(Map)
but in some case this can be different for more advanced use cases.This can also be overridden for performances reasons or to tweak the value used by the fields.
- Overrides:
getBusinessKey
in classPersistedObject
-
validate
public boolean validate(ValidationVisitor validationVisitor, PersistedObjectService objService) Description copied from class:net.pricefx.domain.PersistedObject
Override to implement per-object validation rules- Specified by:
validate
in interfacePersistable
- Overrides:
validate
in classAttributedObject
- Parameters:
validationVisitor
- visitor object that receives validation error detailsobjService
- PersistedObjectService instance. May be null, so be cautious when requiring it
-
getAttributeMetaMapPrefix
Description copied from interface:net.pricefx.domain.MetaAttributed
This method returns a cache key that identifies a set of AttributeMetas For a set that applies to the entire partition (e.g. Product) this is a fixed string For sets that are list specific this typically contains the key of the list- Specified by:
getAttributeMetaMapPrefix
in interfaceMetaAttributed
- Returns:
-
toString
- Overrides:
toString
in classPartitionedObject
-
getValueByName
public Object getValueByName(String valueName, BiFunction<MetaAttributed, String, AttributeMeta> metaLoader) - Specified by:
getValueByName
in interfaceDataChangeRequestEnabledObject
-
getClassByName
public Class getClassByName(String valueName, BiFunction<MetaAttributed, String, AttributeMeta> metaLoader) - Specified by:
getClassByName
in interfaceDataChangeRequestEnabledObject
-
saveStringValue
- Specified by:
saveStringValue
in interfaceDataChangeRequestEnabledObject
-
saveIntegerValue
- Specified by:
saveIntegerValue
in interfaceDataChangeRequestEnabledObject
-
saveBigDecimalValue
- Specified by:
saveBigDecimalValue
in interfaceDataChangeRequestEnabledObject
-
saveDateValue
- Specified by:
saveDateValue
in interfaceDataChangeRequestEnabledObject
-
saveDateTimeValue
- Specified by:
saveDateTimeValue
in interfaceDataChangeRequestEnabledObject
-
removeValue
- Specified by:
removeValue
in interfaceDataChangeRequestEnabledObject
-
getExplicitNames
- Specified by:
getExplicitNames
in interfaceDataChangeRequestEnabledObject
- Returns:
- an iterable of all fields that are allowed to be manipulated in dcr operations. No other fields can be accessed or updated
-
getTreeArtificialRoot
Description copied from interface:net.pricefx.domain.TreeObjectWithArtificialRoot
Returns aTreeObject
which should be used as an artificial root of the tree when the root is needed, i.e. by the sgwt client.- Specified by:
getTreeArtificialRoot
in interfaceTreeObjectWithArtificialRoot
-
onTreeObjectAdd
Description copied from interface:net.pricefx.domain.TreeObjectWithCallbacks
Sets up newTreeObject
from the data. Gets called whilethis
TreeObject
is being added into a tree and itsparentId
was already set.- Specified by:
onTreeObjectAdd
in interfaceTreeObjectWithCallbacks
-
onTreeObjectRemove
Description copied from interface:net.pricefx.domain.TreeObjectWithCallbacks
Gets called whilethis
TreeObject
is being removed from the tree.By default,
TreeObjects
aren't deleted upon removal from a tree, just theirparentId
, andparent
properties are cleared out. In case the object would be useless when not belonging to a tree, the implementation shall returntrue
to request deletion ofthis
object. Mind that it itself mustn't delete the object here.Also keep in mind that implementations shouldn't delete nor modify links to any children
this
TreeObject
might 'have' at this time. This is ensured automatically elsewhere.This
object still has its oldparentId
set at the time of calling this method.- Specified by:
onTreeObjectRemove
in interfaceTreeObjectWithCallbacks
- Returns:
true
in casethis
object must be deleted during this tree-removal operation,false
otherwise.
-
onTreeObjectUpdate
Description copied from interface:net.pricefx.domain.TreeObjectWithCallbacks
Updatesthis
TreeObject
based on the data. Gets called whilethis
TreeObject
is being updated.The
parentId
property was already updated. Contrary to theparent
property which isn't automatically set totrue
unless 'children'TreeObjects
are about to be added.- Specified by:
onTreeObjectUpdate
in interfaceTreeObjectWithCallbacks
-
onTreeObjectAddChildren
Description copied from interface:net.pricefx.domain.TreeObjectWithCallbacks
Gets called whilethis
TreeObject
is about to be set as parent of multiple children at once.The children can be passed in either as search filter (obviously only in case the children objects themselves already exist) or by other (at the moment custom) means. In any case, they are accessible under the
PriceFxInterface.PARAM_TM_CHILDREN
key.Please note that the
parent
property ofthis
object was automatically set totrue
if there's at least one child to add. Also note that the children were automatically marked as parents if thePriceFxInterface.FIELD_PARENT
property istrue
.- Specified by:
onTreeObjectAddChildren
in interfaceTreeObjectWithCallbacks
-
onPreProcessing
Description copied from interface:net.pricefx.domain.APIModifiable
Invoked before processing starts. Good point to normalize the structure. For instance lookup LookupTable and set it into the values.- Specified by:
onPreProcessing
in interfaceAPIModifiable
- Parameters:
values
-- Returns:
- false when processing should be stopped
-
userGroupEditBulkloadFilter
public boolean userGroupEditBulkloadFilter(PersistedObjectService objService, List<String> header, List<Object> line, User user, Map<String, Object> cache) Description copied from class:net.pricefx.domain.PersistedObject
A callback during generic loaddata commands that enables the domain objects to implement row filtering based on group edit-ability. Default implementation does not filterOverride point
- Overrides:
userGroupEditBulkloadFilter
in classPersistedObject
- Parameters:
objService
- Object serviceheader
- The bulkload header columnsline
- The line to filteruser
- The current usercache
- A cache object that is retained during the whole filtering cycle. Content managed by the filter implementation- Returns:
- true: Line OK (do not filter out). false: Do not bulkload line
-
addAttributeMetaSearchCriteria
public void addAttributeMetaSearchCriteria(Search search) Description copied from interface:net.pricefx.domain.MetaAttributed
This methods needs to be overridden in case a set of AttributeMeta objects is not applicable per partition. e.g. in case AttributeMetas are defined per pricelist- Specified by:
addAttributeMetaSearchCriteria
in interfaceMetaAttributed
- Parameters:
search
-
-