Class LookupTable

Object
DomainObject
PersistedObject
PartitionedObject
NamedObject
TimedObject
TimedObjectWithStatus
LookupTable
All Implemented Interfaces:
APIModifiable, JobNameProvider, NamedChangeTracker, Persistable, PlasmaRestrictedObject, SourceTransactionIdTracker, TreeStructuredObject, UserGroupRestrictedObject, WithLastUpdateByName

@Entity public class LookupTable extends TimedObjectWithStatus implements TreeStructuredObject, UserGroupRestrictedObject, APIModifiable, PlasmaRestrictedObject, NamedChangeTracker, SourceTransactionIdTracker
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
    static enum 
     
    static final class 
     

    Nested classes/interfaces inherited from class TimedObjectWithStatus

    TimedObjectWithStatus.TimedObjectStatus

    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
     
    static final String
     
    static final String
     

    Fields inherited from class TimedObjectWithStatus

    FIELD_SIMULATIONSET, FIELD_STATUS, simulationSet

    Fields inherited from class TimedObject

    FIELD_VALIDAFTER

    Fields inherited from class NamedObject

    FIELD_LABEL, FIELD_UNIQUENAME

    Fields inherited from class PartitionedObject

    FIELD_PARTITION, FIELD_PARTITIONID

    Fields inherited from class PersistedObject

    FIELD_CREATEDATE, FIELD_CREATEDBY, FIELD_DELETEDATE, FIELD_DELETEDBY, FIELD_ISDELETED, FIELD_LASTUPDATEDATE

    Fields inherited from class DomainObject

    DEFAULT_MAX_PACKET_SIZE

    Fields inherited from interface UserGroupRestrictedObject

    FIELD_USERGROUPEDIT, FIELD_USERGROUPVIEWDETAILS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    LookupTable(Partition p, String uniqueName, String label)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Search
    buildValuesSearch(int startRow, int endRow, Map<String,Object> filters, String filterMatchStyle, List<String> sortBy, List<String> fields, boolean distinct, PersistedObjectService objService)
     
    void
     
    boolean
    canAdd(User user, ValidationVisitor validationVisitor, PersistedObjectService objService)
    Override this method to restrict the possibility to add an object of this type.
    boolean
    canDelete(User user, ValidationVisitor validationVisitor, PersistedObjectService objService)
    Override this method to restrict the possibility to delete an object of this type.
    boolean
    canEdit(User user, ValidationVisitor validationVisitor, PersistedObjectService objService, Map<String,Object> fieldsToEdit)
    Override this method to do editability checks based on request details and object data (or related object data) and new data from request In case of a false return value a validation error should be added.
    boolean
    canRead(User user, ValidationVisitor visitor, PersistedObjectService txn)
    Override this method to do readability checks based on request details and object data (or related object data) In case of a false return value a validation error should be added.
    boolean
    Override to define if an object instance should be really deleted (vs just marked as deleted) Default: soft-delete
     
     
     
    boolean
     
    Class<? extends AbstractJsonLookupTableValue>
     
    static Collection<? extends JsonLookupTableAttributeMeta>
    getJsonLookupTableMeta(LookupTable lookupTable, PersistedObjectService objService)
     
     
     
     
    Class<? extends AbstractMatrixLookupTableValue>
     
    static Collection<? extends MatrixLookupTableAttributeMeta>
    getMatrixLookupTableMeta(LookupTable lookupTable, PersistedObjectService objService)
     
     
    int
     
     
     
     
     
     
    Class<? extends PersistedObject>
     
    static boolean
     
    boolean
     
    AbstractJsonLookupTableValue
     
    AbstractMatrixLookupTableValue
     
    MetaAttributed
     
    void
    onDelete(PersistedObjectService objService)
    Default does nothing.
    boolean
    Invoked before processing starts.
    void
    onSavedOrUpdated(PersistedObjectService objService)
     
    void
    onSaveOrUpdate(PersistedObjectService objService)
    Default does nothing.
    void
    setCreatedByName(String createdByName)
     
    void
     
    void
    setHideWarnings(Boolean hideWarnings)
     
    void
    setLastUpdateByName(String lastUpdateByName)
     
    void
     
    void
    setNodeId(Number nodeId)
     
    void
     
    void
    setPlasma(Boolean isPlasma)
     
    void
     
    void
     
    void
     
    void
     
    boolean
    validate(ValidationVisitor validationVisitor, PersistedObjectService objService)
    Override to implement per-object validation rules

    Methods inherited from class TimedObjectWithStatus

    getBusinessKey, getSignificantFields, getSimulationSet, getStatus, isActive, setSimulationSet, setStatus

    Methods inherited from class TimedObject

    getValidAfter, setValidAfter

    Methods inherited from class NamedObject

    equals, getJobName, getLabel, getLabelOrUniqueName, getUniqueName, hashCode, labelValid, setLabel, setUniqueName, toString, uniqueNameValid

    Methods inherited from class PartitionedObject

    addUniqueConstraint, getLoginNameByUserId, getPartition, setPartition

    Methods inherited from class PersistedObject

    auditOperation, canEdit, createDate, entityIsSafeInserted, entityIsSafeInserted, findAnnotationRecursively, getBulkloadMap, getCreateDate, getCreatedBy, getDbColumnNameForField, getDefaultSortKey, getDeleteDate, getDeletedBy, getId, getLastUpdateBy, getLastUpdateDate, getTypeCode, getTypedId, getVersion, getVirtualFieldMappings, isAudited, isDeleted, isVirtualField, lastUpdateDate, notifyOnBusinessKeyChange, onBusinessKeyChange, setCreateDate, setCreateDateShouldBeIgnored, setCreateDateTime, setCreatedBy, setDeleted, setDeleteDate, setDeletedBy, setId, setLastUpdateBy, setLastUpdateDate, setLastUpdateDateTime, setTypedId, setVersion, userGroupEditBulkloadFilter, 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, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface NamedChangeTracker

    getCreatedBy, setCreatedAndLastUpdated, setLastUpdateBy

    Methods inherited from interface PlasmaRestrictedObject

    canDeletePlasma, getId, getPlasmaName, getTypeCode, getTypedId

    Methods inherited from interface SourceTransactionIdTracker

    getTypedId, getVersion, logEntityCreateOrUpdate, logEntityDelete, obtainTextualRepresentation
  • Field Details

  • Constructor Details

    • LookupTable

      public LookupTable(Partition p, String uniqueName, String label)
    • LookupTable

      public LookupTable()
  • Method Details

    • getValueType

      public LookupTable.LookupTableValueType getValueType()
    • setValueType

      public void setValueType(LookupTable.LookupTableValueType valueType)
    • getType

      public LookupTable.LookupTableType getType()
    • setType

      public void setType(LookupTable.LookupTableType type)
    • getHideWarnings

      public boolean getHideWarnings()
    • setHideWarnings

      public void setHideWarnings(Boolean hideWarnings)
    • getFormatType

      public FieldFormatType getFormatType()
    • setFormatType

      public void setFormatType(FieldFormatType formatType)
    • getLookupTableId

      public Long getLookupTableId()
    • setLookupTableIdShouldBeIgnored

      public void setLookupTableIdShouldBeIgnored(Long id)
    • getNodeId

      public Long getNodeId()
      Specified by:
      getNodeId in interface TreeStructuredObject
    • setNodeId

      public void setNodeId(Number nodeId)
      Specified by:
      setNodeId in interface TreeStructuredObject
    • 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
    • getLastUpdateByName

      public String getLastUpdateByName()
    • setLastUpdateByName

      public void setLastUpdateByName(String lastUpdateByName)
      Specified by:
      setLastUpdateByName in interface NamedChangeTracker
      Specified by:
      setLastUpdateByName in interface WithLastUpdateByName
    • getCreatedByName

      public String getCreatedByName()
      Specified by:
      getCreatedByName in interface NamedChangeTracker
    • setCreatedByName

      public void setCreatedByName(String createdByName)
      Specified by:
      setCreatedByName in interface NamedChangeTracker
    • getOwner

      public String getOwner()
    • setOwner

      public void setOwner(String owner)
    • newXLookupTableValue

      public MetaAttributed newXLookupTableValue()
    • newMatrixLookupTableValue

      public AbstractMatrixLookupTableValue newMatrixLookupTableValue()
    • newJsonLookupTableValue

      public AbstractJsonLookupTableValue newJsonLookupTableValue()
    • getMatrixLookupTableClass

      public Class<? extends AbstractMatrixLookupTableValue> getMatrixLookupTableClass()
    • getJsonLookupTableClass

      public Class<? extends AbstractJsonLookupTableValue> getJsonLookupTableClass()
    • getXLookupTableClass

      public Class<? extends PersistedObject> getXLookupTableClass()
    • isMatrixLookupTableValueClass

      public static boolean isMatrixLookupTableValueClass(Class<?> clazz)
    • getNumberOfKeyFields

      public int getNumberOfKeyFields()
    • getLookupValueFieldName

      public String getLookupValueFieldName(int index)
    • getCopyValuesNamedQuery

      public String getCopyValuesNamedQuery()
    • doHardDelete

      public boolean doHardDelete()
      Description copied from class: net.pricefx.domain.PersistedObject
      Override to define if an object instance should be really deleted (vs just marked as deleted) Default: soft-delete
      Specified by:
      doHardDelete in interface Persistable
      Overrides:
      doHardDelete in class PersistedObject
    • isPlasma

      public boolean isPlasma()
      Specified by:
      isPlasma in interface PlasmaRestrictedObject
    • setPlasma

      public void setPlasma(Boolean isPlasma)
      Specified by:
      setPlasma in interface PlasmaRestrictedObject
    • 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 TimedObjectWithStatus
      Parameters:
      validationVisitor - visitor object that receives validation error details
      objService - PersistedObjectService instance. May be null, so be cautious when requiring it
    • canRead

      public boolean canRead(User user, ValidationVisitor visitor, PersistedObjectService txn)
      Description copied from class: net.pricefx.domain.PersistedObject
      Override this method to do readability checks based on request details and object data (or related object data) In case of a false return value a validation error should be added.

      This is mostly used to check if a user can access details of an object (e.g., values of a LT, calculation results of a JST) but not for fetching collections of objects. Collection of objects are mainly filtered via AuthUtil.createUserGroupViewDetailsRestrictionFilter(Class, User).

      Overrides:
      canRead in class PersistedObject
      Parameters:
      user - that requests read access
      visitor - receives any "not allowed messages"
      txn - needed for cross object readability checks. Implemented as parameter to optimize performance (vs. new object creation)
      Returns:
      true if read is allowed, false otherwise
    • canAdd

      public boolean canAdd(User user, ValidationVisitor validationVisitor, PersistedObjectService objService)
      Description copied from class: net.pricefx.domain.PersistedObject
      Override this method to restrict the possibility to add an object of this type. Typically this call makes most sense once the properties of the object to add have been set. Default: true
      Overrides:
      canAdd in class PersistedObject
      Parameters:
      user - that requests add access
      validationVisitor - receives any "not allowed messages"
      objService - needed for cross object editability checks. Implemented as parameter to optimize performance (vs. new object creation)
      Returns:
    • canEdit

      public boolean canEdit(User user, ValidationVisitor validationVisitor, PersistedObjectService objService, Map<String,Object> fieldsToEdit)
      Description copied from class: net.pricefx.domain.PersistedObject
      Override this method to do editability checks based on request details and object data (or related object data) and new data from request In case of a false return value a validation error should be added.
      Overrides:
      canEdit in class PersistedObject
      Parameters:
      user - that requests edit access
      validationVisitor - receives any "not allowed messages"
      objService - needed for cross object editability checks. Implemented as parameter to optimize performance (vs. new object creation)
      fieldsToEdit - fields and their values that are about to be modified. To implement more fine grained editability checks (like e.g. allow tree repositioning while the object is otherwise locked)
      Returns:
      true if edit is allowed, false otherwise
    • canDelete

      public boolean canDelete(User user, ValidationVisitor validationVisitor, PersistedObjectService objService)
      Description copied from class: net.pricefx.domain.PersistedObject
      Override this method to restrict the possibility to delete an object of this type. Default: true
      Overrides:
      canDelete in class PersistedObject
      Parameters:
      user - that requests delete access
      validationVisitor - receives any "not allowed messages"
      objService - needed for cross object editability checks. Implemented as parameter to optimize performance (vs. new object creation)
      Returns:
    • buildValuesSearch

      public Search buildValuesSearch(int startRow, int endRow, Map<String,Object> filters, String filterMatchStyle, List<String> sortBy, List<String> fields, boolean distinct, PersistedObjectService objService)
    • getMatrixLookupTableMeta

      public static Collection<? extends MatrixLookupTableAttributeMeta> getMatrixLookupTableMeta(LookupTable lookupTable, PersistedObjectService objService)
    • getJsonLookupTableMeta

      public static Collection<? extends JsonLookupTableAttributeMeta> getJsonLookupTableMeta(LookupTable lookupTable, PersistedObjectService objService)
    • 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
      Parameters:
      values -
      Returns:
      false when processing should be stopped
    • onSaveOrUpdate

      public void onSaveOrUpdate(PersistedObjectService objService)
      Description copied from class: net.pricefx.domain.PersistedObject
      Default does nothing. Method is called when object is about to be saved or updated Override point
      Overrides:
      onSaveOrUpdate in class PersistedObject
      Parameters:
      objService -
    • onSavedOrUpdated

      public void onSavedOrUpdated(PersistedObjectService objService)
      Overrides:
      onSavedOrUpdated in class PersistedObject
    • onDelete

      public void onDelete(PersistedObjectService objService)
      Description copied from class: net.pricefx.domain.PersistedObject
      Default does nothing. Method is called when object is about to be deleted Override point
      Overrides:
      onDelete in class PersistedObject
      Parameters:
      objService -
    • bumpVersion

      public void bumpVersion()
      Overrides:
      bumpVersion in class PersistedObject