Package net.sf.basedb.core.data
Class ParameterValueData<T>
java.lang.Object
net.sf.basedb.core.data.BasicData
net.sf.basedb.core.data.ParameterValueData<T>
- All Implemented Interfaces:
IdentifiableData
- Direct Known Subclasses:
BooleanParameterValueData
,DateParameterValueData
,DoubleParameterValueData
,FloatParameterValueData
,IntegerParameterValueData
,ItemParameterValueData
,LongParameterValueData
,StringParameterValueData
,TextParameterValueData
,TimestampParameterValueData
The base class for the different types of parameter values.
- Version:
- 2.0
- Author:
- Nicklas, Samuel
- See Also:
- Last modified
- $Date: 2016-12-12 08:50:49 +0100 (må, 12 dec 2016) $
- Hibernate: class
- table="`ParameterValues`" discriminator-value="-1" lazy="true" batch-size="10"
- Hibernate: discriminator
- column="`discriminator`" type="int"
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the description of the parameter.getLabel()
Get the label of the parameter.Get the old values that has been replaced by new values in this session.Get values of this parameter.abstract int
Get the type of parameter values that are store in this parameter.boolean
isMasked()
A flag indicating if the value should be masked when displayed in client applications (eg. since it may be a password) NOTE!boolean
replaceValuesIfDifferent
(List<?> values, boolean checkOnly) Replace the values in the database with the new values in the specified list.void
setDescription
(String description) void
void
setMasked
(boolean masked) (package private) abstract void
Set values of this parameter.protected void
storeCurrentValuesAsOld
(List<T> current) Store the current values as old values, except if there are no current values or if old values have already been stored.Methods inherited from class net.sf.basedb.core.data.BasicData
equals, getId, getVersion, hashCode, setId, setVersion, toString
-
Field Details
-
oldValues
-
MAX_LABEL_LENGTH
public static final int MAX_LABEL_LENGTHThe maximum length of the label of the parameter that can be stored in the database.- See Also:
-
label
-
MAX_DESCRIPTION_LENGTH
public static final int MAX_DESCRIPTION_LENGTHThe maximum length of the description of the parameter that can be stored in the database.- See Also:
-
description
-
masked
private boolean masked
-
-
Constructor Details
-
ParameterValueData
ParameterValueData() -
ParameterValueData
-
-
Method Details
-
getLabel
Get the label of the parameter.- Hibernate: property
- column="`label`" type="string" size="255" not-null="false"
-
setLabel
-
getDescription
Get the description of the parameter.- Hibernate: property
- column="`description`" type="text" not-null="false"
-
setDescription
-
isMasked
public boolean isMasked()A flag indicating if the value should be masked when displayed in client applications (eg. since it may be a password) NOTE! This property is mapped in hibernate-properties-ParameterValueData.xml since 'default' is not supported by XDoclet //hibernate.property type="boolean" //hibernate.column name="`masked`" type="boolean" not-null="true" default="false"- Since:
- 3.7
-
setMasked
public void setMasked(boolean masked) -
getValueType
public abstract int getValueType()Get the type of parameter values that are store in this parameter. The value should correspond to one of theType.getValue()
values, or 0 if the parameter has no corresponding type.- Returns:
- An integer value found in the
Type
enumeration or 0 - Since:
- 2.16
-
getValues
Get values of this parameter. Hibernate mapped in each subclass to a bag containing all values for the parameter.- Returns:
- Collection of values.
-
setValues
Set values of this parameter.NOTE! Used by Hibernate to initialize the object. Do not call
AnnotationData.setLastUpdate(java.util.Date)
!- Parameters:
values
- Collection of values.
-
replaceValuesIfDifferent
Replace the values in the database with the new values in the specified list. It is expected that the list contains only objects of the correct type.NOTE! When this method is called to set annotation values for an
AnnotationData
, don't forget to also update the last update timestamp:AnnotationData.setLastUpdate(java.util.Date)
. and to invalidate the annotation set snapshot:AnnotationSet.setSnapshotInvalid()
- Parameters:
checkOnly
- Only check the values, do not replace them even if they are different- Returns:
- TRUE if the values were replaced/different, FALSE if not
- Since:
- 3.8, 3.10
-
storeCurrentValuesAsOld
Store the current values as old values, except if there are no current values or if old values have already been stored.- Since:
- 3.8
-
getOldValues
Get the old values that has been replaced by new values in this session.- Returns:
- A list or null if the values has not been replaced
- Since:
- 3.3
-