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.ImportManagerEnabled, PersistedObject.PersistedObjectMeta, PersistedObject.VirtualField, PersistedObject.VirtualFieldMapping, PersistedObject.VirtualFields, PersistedObject.VirtualSearchFields, PersistedObject.VirtualSortFields -
Field Summary
FieldsFields inherited from class PartitionedObject
FIELD_PARTITION, FIELD_PARTITIONID, PARTITION_FILTER_NAME, PARTITION_FILTER_PARAMFields inherited from class PersistedObject
FIELD_CREATEDATE, FIELD_CREATEDBY, FIELD_DELETEDATE, FIELD_DELETEDBY, FIELD_ID, FIELD_ISDELETED, FIELD_LASTUPDATEBY, FIELD_LASTUPDATEDATE, FIELD_VERSIONFields inherited from class DomainObject
DEFAULT_MAX_PACKET_SIZEFields inherited from interface Attributed10
ATTRIBUTE10_NAME, ATTRIBUTE9_NAMEFields inherited from interface Attributed20
ATTRIBUTE11_NAME, ATTRIBUTE12_NAME, ATTRIBUTE13_NAME, ATTRIBUTE14_NAME, ATTRIBUTE15_NAME, ATTRIBUTE16_NAME, ATTRIBUTE17_NAME, ATTRIBUTE18_NAME, ATTRIBUTE19_NAME, ATTRIBUTE20_NAMEFields inherited from interface Attributed3
ATTRIBUTE1_NAME, ATTRIBUTE2_NAME, ATTRIBUTE3_NAMEFields 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_NAMESFields inherited from interface Attributed6
ATTRIBUTE4_NAME, ATTRIBUTE5_NAME, ATTRIBUTE6_NAMEFields inherited from interface Attributed8
ATTRIBUTE7_NAME, ATTRIBUTE8_NAMEFields inherited from interface UserGroupRestrictedObject
FIELD_USERGROUPEDIT, FIELD_USERGROUPVIEWDETAILS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttributeMetaSearchCriteria(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 aTreeObjectwhich 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) booleanisParent()Returnstrueif this is a parent object,falseotherwise.booleanonPreProcessing(Map<String, Object> values, LocalDateTime targetDate) Invoked before processing starts.voidonTreeObjectAdd(Map<String, Object> data, PersistedObjectService objService) Sets up newTreeObjectfrom the data.voidonTreeObjectAddChildren(Map<String, Object> data, PersistedObjectService objService) Gets called whilethisTreeObjectis about to be set as parent of multiple children at once.booleanonTreeObjectRemove(Map<String, Object> data, PersistedObjectService objService) Gets called whilethisTreeObjectis being removed from the tree.voidonTreeObjectUpdate(Map<String, Object> data, PersistedObjectService objService) UpdatesthisTreeObjectbased on the data.voidremoveValue(String property) voidsaveBigDecimalValue(String property, BigDecimal value) voidsaveDateTimeValue(String property, DateTime value) voidsaveDateValue(String property, Date value) voidsaveIntegerValue(String property, Integer value) voidsaveStringValue(String property, String value) voidsetCustomerId(String customerId) voidvoidMarks this object as parent/leaf.voidsetParentId(Long parentId) (Re)sets the parent ofthisobject.voidsetUserGroupEdit(String userGroup) voidsetUserGroupViewDetails(String userGroup) toString()booleanuserGroupEditBulkloadFilter(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.booleanvalidate(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, setAttribute9Methods inherited from class AttributedObject
getAllAttributesMap, getAttribute, getAttribute, getAttributeClass, getAttributeClass, getAttributeType, getTypedAttribute, getTypedAttributeMethods inherited from class PartitionedObject
addUniqueConstraint, getLoginNameByUserId, getPartition, setPartitionMethods inherited from class PersistedObject
auditOperation, bumpVersion, canAdd, canDelete, canEdit, canEdit, canRead, createDate, doHardDelete, entityIsSafeInserted, entityIsSafeInserted, getBulkloadMap, getCreateDate, getCreatedBy, getDbColumnNameForField, getDeleteDate, getDeletedBy, getId, getLastUpdateBy, getLastUpdateDate, getSensitiveFields, getTypeCode, getTypedId, getVersion, getVirtualSearchFieldMappings, getVirtualSortFieldMappings, isAudited, isDeleted, isVirtualSearchField, lastUpdateDate, notifyOnBusinessKeyChange, onBusinessKeyChange, onDelete, onRefreshed, onSavedOrUpdated, onSaveOrUpdate, setCreateDate, setCreateDateShouldBeIgnored, setCreateDateTime, setCreatedBy, setDeleted, setDeleteDate, setDeletedBy, setId, setLastUpdateBy, setLastUpdateDate, setLastUpdateDateTime, setTypedId, setVersion, userGroupEditBulkloadFilterMethods 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, truncatedToStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Attributed
getAttributeClass, getAttributeExtensionNames, setBigDecimalValue, setDateTimeValue, setDateValue, setIntegerValueMethods inherited from interface Attributed30
getRawAttribute, setRawAttributeMethods inherited from interface MetaAttributed
getPartitionMethods 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.TreeObjectReturns unique identifier of the parent object in the tree. May benullto indicatethisobject is an immediate child of the virtual root object.- Specified by:
getParentIdin interfaceTreeObject
-
setParentId
Description copied from interface:net.pricefx.domain.TreeObject(Re)sets the parent ofthisobject. May benull. In such casethisobject becomes an immediate child of the virtual root object.- Specified by:
setParentIdin interfaceTreeObject
-
isParent
public boolean isParent()Description copied from interface:net.pricefx.domain.TreeObjectReturnstrueif this is a parent object,falseotherwise.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,
thismethod returnstrue.- Specified by:
isParentin interfaceTreeObject
-
setParent
Description copied from interface:net.pricefx.domain.TreeObjectMarks this object as parent/leaf. IfisParentisfalseornull,thisobject 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
nullequals to passing infalse- Specified by:
setParentin interfaceTreeObject
-
getUserGroupEdit
- Specified by:
getUserGroupEditin interfaceUserGroupRestrictedObject
-
setUserGroupEdit
- Specified by:
setUserGroupEditin interfaceUserGroupRestrictedObject
-
getUserGroupViewDetails
- Specified by:
getUserGroupViewDetailsin interfaceUserGroupRestrictedObject
-
setUserGroupViewDetails
- Specified by:
setUserGroupViewDetailsin interfaceUserGroupRestrictedObject
-
getSignificantFields
Description copied from class:net.pricefx.domain.PersistedObjectThe fields that represent the business key of the object, seePersistedObject.getBusinessKey(). For some objects, the business key is dynamically generated instead, seeDynamicBusinessKeyObject.- Overrides:
getSignificantFieldsin classPersistedObject
-
getBusinessKey
Description copied from class:net.pricefx.domain.PersistedObjectThe business key represents the logical uniqueness of the object. The keys of the returnedMapmust 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:
getBusinessKeyin classPersistedObject
-
validate
public boolean validate(ValidationVisitor validationVisitor, PersistedObjectService objService) Description copied from class:net.pricefx.domain.PersistedObjectOverride to implement per-object validation rules- Specified by:
validatein interfacePersistable- Overrides:
validatein 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.MetaAttributedThis 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:
getAttributeMetaMapPrefixin interfaceMetaAttributed- Returns:
-
toString
- Overrides:
toStringin classPartitionedObject
-
getValueByName
public Object getValueByName(String valueName, BiFunction<MetaAttributed, String, AttributeMeta> metaLoader) - Specified by:
getValueByNamein interfaceDataChangeRequestEnabledObject
-
getClassByName
public Class getClassByName(String valueName, BiFunction<MetaAttributed, String, AttributeMeta> metaLoader) - Specified by:
getClassByNamein interfaceDataChangeRequestEnabledObject
-
saveStringValue
- Specified by:
saveStringValuein interfaceDataChangeRequestEnabledObject
-
saveIntegerValue
- Specified by:
saveIntegerValuein interfaceDataChangeRequestEnabledObject
-
saveBigDecimalValue
- Specified by:
saveBigDecimalValuein interfaceDataChangeRequestEnabledObject
-
saveDateValue
- Specified by:
saveDateValuein interfaceDataChangeRequestEnabledObject
-
saveDateTimeValue
- Specified by:
saveDateTimeValuein interfaceDataChangeRequestEnabledObject
-
removeValue
- Specified by:
removeValuein interfaceDataChangeRequestEnabledObject
-
getExplicitNames
- Specified by:
getExplicitNamesin 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.TreeObjectWithArtificialRootReturns aTreeObjectwhich should be used as an artificial root of the tree when the root is needed, i.e. by the sgwt client.- Specified by:
getTreeArtificialRootin interfaceTreeObjectWithArtificialRoot
-
onTreeObjectAdd
Description copied from interface:net.pricefx.domain.TreeObjectWithCallbacksSets up newTreeObjectfrom the data. Gets called whilethisTreeObjectis being added into a tree and itsparentIdwas already set.- Specified by:
onTreeObjectAddin interfaceTreeObjectWithCallbacks
-
onTreeObjectRemove
Description copied from interface:net.pricefx.domain.TreeObjectWithCallbacksGets called whilethisTreeObjectis being removed from the tree.By default,
TreeObjectsaren't deleted upon removal from a tree, just theirparentId, andparentproperties are cleared out. In case the object would be useless when not belonging to a tree, the implementation shall returntrueto request deletion ofthisobject. 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
thisTreeObjectmight 'have' at this time. This is ensured automatically elsewhere.Thisobject still has its oldparentIdset at the time of calling this method.- Specified by:
onTreeObjectRemovein interfaceTreeObjectWithCallbacks- Returns:
truein casethisobject must be deleted during this tree-removal operation,falseotherwise.
-
onTreeObjectUpdate
Description copied from interface:net.pricefx.domain.TreeObjectWithCallbacksUpdatesthisTreeObjectbased on the data. Gets called whilethisTreeObjectis being updated.The
parentIdproperty was already updated. Contrary to theparentproperty which isn't automatically set totrueunless 'children'TreeObjectsare about to be added.- Specified by:
onTreeObjectUpdatein interfaceTreeObjectWithCallbacks
-
onTreeObjectAddChildren
Description copied from interface:net.pricefx.domain.TreeObjectWithCallbacksGets called whilethisTreeObjectis 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_CHILDRENkey.Please note that the
parentproperty ofthisobject was automatically set totrueif there's at least one child to add. Also note that the children were automatically marked as parents if thePriceFxInterface.FIELD_PARENTproperty istrue.- Specified by:
onTreeObjectAddChildrenin interfaceTreeObjectWithCallbacks
-
onPreProcessing
Description copied from interface:net.pricefx.domain.APIModifiableInvoked before processing starts. Good point to normalize the structure. For instance lookup LookupTable and set it into the values.- Specified by:
onPreProcessingin 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.PersistedObjectA 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:
userGroupEditBulkloadFilterin 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.MetaAttributedThis 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:
addAttributeMetaSearchCriteriain interfaceMetaAttributed- Parameters:
search-
-