Package net.pricefx.domain
Class LookupTable
Object
DomainObject
PersistedObject
PartitionedObject
NamedObject
TimedObject
TimedObjectWithStatus
LookupTable
- All Implemented Interfaces:
APIModifiable
,JobNameProvider
,NamedChangeTracker
,Persistable
,PlasmaRestrictedObject
,SourceTransactionIdTracker
,TreeStructuredObject
,UserGroupRestrictedObject
@Entity
public class LookupTable
extends TimedObjectWithStatus
implements TreeStructuredObject, UserGroupRestrictedObject, APIModifiable, PlasmaRestrictedObject, NamedChangeTracker, SourceTransactionIdTracker
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic 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.ImportManagerEnabled, PersistedObject.PersistedObjectMeta, PersistedObject.VirtualField, PersistedObject.VirtualFieldMapping, PersistedObject.VirtualSearchFields, PersistedObject.VirtualSortFields
-
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptionSearch
buildValuesSearch
(int startRow, int endRow, Map<String, Object> filters, String filterMatchStyle, List<String> sortBy, List<String> fields, boolean distinct, PersistedObjectService objService) void
boolean
Override this method to restrict the possibility to add an object of this type.boolean
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 edit-ability 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
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-deleteboolean
Class
<? extends AbstractJsonLookupTableValue> static Collection
<? extends JsonLookupTableAttributeMeta> getJsonLookupTableMeta
(LookupTable lookupTable, PersistedObjectService objService) getLookupValueFieldName
(int index) Class
<? extends AbstractMatrixLookupTableValue> static Collection
<? extends MatrixLookupTableAttributeMeta> getMatrixLookupTableMeta
(LookupTable lookupTable, PersistedObjectService objService) int
getOwner()
getType()
Class
<? extends PersistedObject> static boolean
isMatrixLookupTableValueClass
(Class<?> clazz) boolean
isPlasma()
AbstractJsonLookupTableValue
AbstractMatrixLookupTableValue
MetaAttributed
void
onDelete
(PersistedObjectService objService) Default does nothing.boolean
onPreProcessing
(Map<String, Object> values, LocalDateTime targetDate) Invoked before processing starts.void
onSavedOrUpdated
(PersistedObjectService objService) void
onSaveOrUpdate
(PersistedObjectService objService) Default does nothing.void
setCreatedByName
(String createdByName) void
setFormatType
(FieldFormatType formatType) void
setHideWarnings
(Boolean hideWarnings) void
setLastUpdateByName
(String lastUpdateByName) void
void
void
void
void
void
setUserGroupEdit
(String userGroup) void
setUserGroupViewDetails
(String userGroup) void
setValueType
(LookupTable.LookupTableValueType valueType) boolean
validate
(ValidationVisitor validationVisitor, PersistedObjectService objService) Override to implement per-object validation rulesMethods 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 interface NamedChangeTracker
contextCurrentUser, 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
-
FIELD_OWNER
- See Also:
-
FIELD_NAME
- See Also:
-
FIELD_ID
- See Also:
-
-
Constructor Details
-
LookupTable
-
LookupTable
public LookupTable()
-
-
Method Details
-
getValueType
-
setValueType
-
getType
-
setType
-
getHideWarnings
public boolean getHideWarnings() -
setHideWarnings
-
getFormatType
-
setFormatType
-
getLookupTableId
-
setLookupTableIdShouldBeIgnored
-
getNodeId
- Specified by:
getNodeId
in interfaceTreeStructuredObject
-
setNodeId
- Specified by:
setNodeId
in interfaceTreeStructuredObject
-
getUserGroupEdit
- Specified by:
getUserGroupEdit
in interfaceUserGroupRestrictedObject
-
setUserGroupEdit
- Specified by:
setUserGroupEdit
in interfaceUserGroupRestrictedObject
-
getUserGroupViewDetails
- Specified by:
getUserGroupViewDetails
in interfaceUserGroupRestrictedObject
-
setUserGroupViewDetails
- Specified by:
setUserGroupViewDetails
in interfaceUserGroupRestrictedObject
-
getLastUpdateByName
-
setLastUpdateByName
- Specified by:
setLastUpdateByName
in interfaceNamedChangeTracker
-
getCreatedByName
- Specified by:
getCreatedByName
in interfaceNamedChangeTracker
-
setCreatedByName
- Specified by:
setCreatedByName
in interfaceNamedChangeTracker
-
getOwner
-
setOwner
-
newXLookupTableValue
public MetaAttributed newXLookupTableValue() -
newMatrixLookupTableValue
public AbstractMatrixLookupTableValue newMatrixLookupTableValue() -
newJsonLookupTableValue
public AbstractJsonLookupTableValue newJsonLookupTableValue() -
getMatrixLookupTableClass
-
getJsonLookupTableClass
-
getXLookupTableClass
-
isMatrixLookupTableValueClass
-
getNumberOfKeyFields
public int getNumberOfKeyFields() -
getLookupValueFieldName
-
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 interfacePersistable
- Overrides:
doHardDelete
in classPersistedObject
-
isPlasma
public boolean isPlasma()- Specified by:
isPlasma
in interfacePlasmaRestrictedObject
-
setPlasma
- Specified by:
setPlasma
in interfacePlasmaRestrictedObject
-
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 classTimedObjectWithStatus
- Parameters:
validationVisitor
- visitor object that receives validation error detailsobjService
- PersistedObjectService instance. May be null, so be cautious when requiring it
-
canRead
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 an 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 classPersistedObject
- Parameters:
user
- that requests read accessvisitor
- 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 classPersistedObject
- Parameters:
user
- that requests add accessvalidationVisitor
- receives any "not allowed messages"objService
- needed for cross object edit-ability checks. Implemented as parameter to optimize performance (vs. new object creation)
-
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 edit-ability 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 classPersistedObject
- Parameters:
user
- that requests edit accessvalidationVisitor
- receives any "not allowed messages"objService
- needed for cross object edit-ability 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 edit-ability 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 classPersistedObject
- Parameters:
user
- that requests delete accessvalidationVisitor
- receives any "not allowed messages"objService
- needed for cross object edit-ability checks. Implemented as parameter to optimize performance (vs. new object creation)
-
buildValuesSearch
-
getMatrixLookupTableMeta
public static Collection<? extends MatrixLookupTableAttributeMeta> getMatrixLookupTableMeta(LookupTable lookupTable, PersistedObjectService objService) -
getJsonLookupTableMeta
public static Collection<? extends JsonLookupTableAttributeMeta> getJsonLookupTableMeta(LookupTable lookupTable, PersistedObjectService objService) -
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
-
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 classPersistedObject
-
onSavedOrUpdated
public void onSavedOrUpdated(PersistedObjectService objService) - Overrides:
onSavedOrUpdated
in classPersistedObject
-
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 classPersistedObject
-
bumpVersion
public void bumpVersion()- Overrides:
bumpVersion
in classPersistedObject
-