Class Customer

Object
DomainObject
PersistedObject
PartitionedObject
AttributedObject
AttributedObject30
Customer
All Implemented Interfaces:
APIModifiable, Attributed, Attributed10, Attributed20, Attributed3, Attributed30, Attributed6, Attributed8, DataChangeRequestEnabledObject, MetaAttributed, Persistable, TreeObject, TreeObjectWithArtificialRoot, TreeObjectWithCallbacks, UserGroupRestrictedObject

@Entity public class Customer extends AttributedObject30 implements TreeObjectWithArtificialRoot, TreeObjectWithCallbacks, UserGroupRestrictedObject, DataChangeRequestEnabledObject, APIModifiable
  • 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
    Modifier and Type
    Field
    Description
    static final String
     

    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

    Constructors
    Constructor
    Description
     
    Customer(Partition partition)
     
    Customer(Partition p, String customerId, String name)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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 formulas
     
     
     
    Returns unique identifier of the parent object in the tree.
    The fields that represent the business key of the object, see PersistedObject.getBusinessKey().
    Returns a TreeObject which should be used as an artificial root of the tree when the root is needed, i.e.
     
     
    getValueByName(String valueName, BiFunction<MetaAttributed,String,AttributeMeta> metaLoader)
     
    boolean
    Override this method in case a custom SQL insert statement that takes care of key collisions (Mysql: ON DUPLICATE KEY) Default: false
    boolean
    Returns true if this is a parent object, false otherwise.
    boolean
    Invoked before processing starts.
    void
    onTreeObjectAdd(Map<String,Object> data, PersistedObjectService objService)
    Sets up new TreeObject from the data.
    void
    onTreeObjectAddChildren(Map<String,Object> data, PersistedObjectService objService)
    Gets called while this TreeObject is about to be set as parent of multiple children at once.
    boolean
    onTreeObjectRemove(Map<String,Object> data, PersistedObjectService objService)
    Gets called while this TreeObject is being removed from the tree.
    void
    onTreeObjectUpdate(Map<String,Object> data, PersistedObjectService objService)
    Updates this TreeObject based on the data.
    void
    removeValue(String property)
     
    void
     
    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
    setParent(Boolean isParent)
    Marks this object as parent/leaf.
    void
    setParentId(Long parentId)
    (Re)sets the parent of this object.
    void
     
    void
     
     
    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 editability.
    boolean
    validate(ValidationVisitor validationVisitor, PersistedObjectService objService)
    Override to implement per-object validation rules

    Methods 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, 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

    addAttributeMetaSearchCriteria, getPartition

    Methods inherited from interface TreeObject

    getId
  • Field Details

  • Constructor Details

    • Customer

      public Customer()
    • Customer

      public Customer(Partition p, String customerId, String name)
    • Customer

      public Customer(Partition partition)
  • Method Details

    • getCustomerId

      public String getCustomerId()
    • getCustomerid

      public String getCustomerid()
      Needed to get attribute by name in formulas
      Returns:
    • setCustomerId

      public void setCustomerId(String customerId)
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getParentId

      public Long getParentId()
      Description copied from interface: net.pricefx.domain.TreeObject
      Returns unique identifier of the parent object in the tree. May be null to indicate this object is an immediate child of the virtual root object.
      Specified by:
      getParentId in interface TreeObject
    • setParentId

      public void setParentId(Long parentId)
      Description copied from interface: net.pricefx.domain.TreeObject
      (Re)sets the parent of this object. May be null . In such case this object becomes an immediate child of the virtual root object.
      Specified by:
      setParentId in interface TreeObject
    • isParent

      public boolean isParent()
      Description copied from interface: net.pricefx.domain.TreeObject
      Returns true 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 returns true.

      Specified by:
      isParent in interface TreeObject
    • setParent

      public void setParent(Boolean isParent)
      Description copied from interface: net.pricefx.domain.TreeObject
      Marks this object as parent/leaf. If isParent is false or null, 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 in false

      Specified by:
      setParent in interface TreeObject
    • getUserGroupEdit

      public String getUserGroupEdit()
      Specified by:
      getUserGroupEdit in interface UserGroupRestrictedObject
    • setUserGroupEdit

      public void setUserGroupEdit(String userGroup)
      Specified by:
      setUserGroupEdit in interface UserGroupRestrictedObject
    • getUserGroupViewDetails

      public String getUserGroupViewDetails()
      Specified by:
      getUserGroupViewDetails in interface UserGroupRestrictedObject
    • setUserGroupViewDetails

      public void setUserGroupViewDetails(String userGroup)
      Specified by:
      setUserGroupViewDetails in interface UserGroupRestrictedObject
    • getSignificantFields

      public String[] getSignificantFields()
      Description copied from class: net.pricefx.domain.PersistedObject
      The fields that represent the business key of the object, see PersistedObject.getBusinessKey(). For some objects, the business key is dynamically generated instead, see DynamicBusinessKeyObject.
      Overrides:
      getSignificantFields in class PersistedObject
    • getBusinessKey

      public Map<String,Object> getBusinessKey()
      Description copied from class: net.pricefx.domain.PersistedObject
      The business key represents the logical uniqueness of the object. The keys of the returned Map must be the same as the values returned by PersistedObject.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 class PersistedObject
    • hasSafeInsertConfigured

      public boolean hasSafeInsertConfigured()
      Description copied from class: net.pricefx.domain.PersistedObject
      Override this method in case a custom SQL insert statement that takes care of key collisions (Mysql: ON DUPLICATE KEY) Default: false
      Specified by:
      hasSafeInsertConfigured in interface Persistable
      Overrides:
      hasSafeInsertConfigured in class PersistedObject
    • 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 interface Persistable
      Overrides:
      validate in class AttributedObject
      Parameters:
      validationVisitor - visitor object that receives validation error details
      objService - PersistedObjectService instance. May be null, so be cautios when requiring it
    • getAttributeMetaMapPrefix

      public String getAttributeMetaMapPrefix()
      Description copied from class: net.pricefx.domain.AttributedObject
      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 interface MetaAttributed
      Specified by:
      getAttributeMetaMapPrefix in class AttributedObject
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class PartitionedObject
    • getValueByName

      public Object getValueByName(String valueName, BiFunction<MetaAttributed,String,AttributeMeta> metaLoader)
      Specified by:
      getValueByName in interface DataChangeRequestEnabledObject
    • getClassByName

      public Class getClassByName(String valueName, BiFunction<MetaAttributed,String,AttributeMeta> metaLoader)
      Specified by:
      getClassByName in interface DataChangeRequestEnabledObject
    • saveStringValue

      public void saveStringValue(String property, String value)
      Specified by:
      saveStringValue in interface DataChangeRequestEnabledObject
    • saveIntegerValue

      public void saveIntegerValue(String property, Integer value)
      Specified by:
      saveIntegerValue in interface DataChangeRequestEnabledObject
    • saveBigDecimalValue

      public void saveBigDecimalValue(String property, BigDecimal value)
      Specified by:
      saveBigDecimalValue in interface DataChangeRequestEnabledObject
    • saveDateValue

      public void saveDateValue(String property, Date value)
      Specified by:
      saveDateValue in interface DataChangeRequestEnabledObject
    • saveDateTimeValue

      public void saveDateTimeValue(String property, DateTime value)
      Specified by:
      saveDateTimeValue in interface DataChangeRequestEnabledObject
    • removeValue

      public void removeValue(String property)
      Specified by:
      removeValue in interface DataChangeRequestEnabledObject
    • getExplicitNames

      public Iterable<String> getExplicitNames()
      Specified by:
      getExplicitNames in interface DataChangeRequestEnabledObject
      Returns:
      an iterable of all fields that are allowed to be manipulated in dcr operations. No other fields can be accessed or updated
    • getTreeArtificialRoot

      public Customer getTreeArtificialRoot()
      Description copied from interface: net.pricefx.domain.TreeObjectWithArtificialRoot
      Returns a TreeObject 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 interface TreeObjectWithArtificialRoot
    • onTreeObjectAdd

      public void onTreeObjectAdd(Map<String,Object> data, PersistedObjectService objService)
      Description copied from interface: net.pricefx.domain.TreeObjectWithCallbacks
      Sets up new TreeObject from the data. Gets called while this TreeObject is being added into a tree and its parentId was already set.
      Specified by:
      onTreeObjectAdd in interface TreeObjectWithCallbacks
    • onTreeObjectRemove

      public boolean onTreeObjectRemove(Map<String,Object> data, PersistedObjectService objService)
      Description copied from interface: net.pricefx.domain.TreeObjectWithCallbacks
      Gets called while this TreeObject is being removed from the tree.

      By default, TreeObjects aren't deleted upon removal from a tree, just their parentId, and parent properties are cleared out. In case the object would be useless when not belonging to a tree, the implementation shall return true to request deletion of this 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 old parentId set at the time of calling this method.

      Specified by:
      onTreeObjectRemove in interface TreeObjectWithCallbacks
      Returns:
      true in case this object must be deleted during this tree-removal operation, false otherwise.
    • onTreeObjectUpdate

      public void onTreeObjectUpdate(Map<String,Object> data, PersistedObjectService objService)
      Description copied from interface: net.pricefx.domain.TreeObjectWithCallbacks
      Updates this TreeObject based on the data. Gets called while this TreeObject is being updated.

      The parentId property was already updated. Contrary to the parent property which isn't automatically set to true unless 'children' TreeObjects are about to be added.

      Specified by:
      onTreeObjectUpdate in interface TreeObjectWithCallbacks
    • onTreeObjectAddChildren

      public void onTreeObjectAddChildren(Map<String,Object> data, PersistedObjectService objService)
      Description copied from interface: net.pricefx.domain.TreeObjectWithCallbacks
      Gets called while this 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 of this object was automatically set to true if there's at least one child to add. Also note that the children were automatically marked as parents if the PriceFxInterface.FIELD_PARENT property is true.

      Specified by:
      onTreeObjectAddChildren in interface TreeObjectWithCallbacks
    • onPreProcessing

      public boolean onPreProcessing(Map<String,Object> values, LocalDateTime targetDate)
      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 interface APIModifiable
      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 editability. Default implementation does not filter Override point
      Overrides:
      userGroupEditBulkloadFilter in class PersistedObject
      Parameters:
      objService - Object service
      header - The bulkload header columns
      line - The line to filter
      user - The current user
      cache - 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