Package com.jbstrap.core.dao
Class JBMultiValue
java.lang.Object
com.jbstrap.core.dao.JBMultiValue
This object is used to ensure that a record can have the set of values of a multiple value field mapped.
During the saving of the
The object contains the field values in a list, and the field save parameters. The field set of values can have any type of objects. The
Field parameters:
Form
, the MultiValueFormItem
fields will be converted automatically.The object contains the field values in a list, and the field save parameters. The field set of values can have any type of objects. The
joinTableName, recordColumnName, valueColumnName
must be specified.Field parameters:
- joinTableName: The name of the join table, where the values are saved
- recordColumnName: The name of the record colum, where the record's primary ID is saved.
- valueColumnName: The name of the value column, where the field values are saved.
- extendedValues: Optional parameter. In this parameter, other additional values can be specified. This can be done by setting a fix value to a field (dbFieldName=dbFieldValue). Here, the value before the '=' represents the join table's field, and the value after the '=' represents the field value. Another way to do this, is to have a record value be saved to a join table field. (dbFieldName=${recordFieldName}). In this case, the value before the "=" is the join table field, and the text after the "=", between the "${" and "}" is a recordFieldName value. This will be automatically replaced to the record's corresponding value during both saving or deleting. Multiple field and value pairs can be specified, the pairs are separated by a "," character.
- Since:
- 4.0
- Author:
- JBStrap
- See Also:
-
Constructor Summary
ConstructorDescriptionJBMultiValue
(String joinTableName, String recordColumnName, String valueColumnName, String extendedValues) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionGets the extended values.Gets the join table name.Gets the record column name.Gets the value column nameGets the value list.Sets the value list.
-
Constructor Details
-
JBMultiValue
public JBMultiValue(String joinTableName, String recordColumnName, String valueColumnName, String extendedValues) Creates a new instance. ThejoinTableName, recordColumnName, valueColumnName
must be specified. TheextendValues
is optional.- Parameters:
joinTableName
- The name of the join table, where the values are savedrecordColumnName
- The name of the record column, where the record's primary ID is saved.valueColumnName
- The name of the value column, where the field values are saved.extendedValues
- Optional parameter. In this parameter, other additional values can be specified. This can be done by setting a fix value to a field (dbFieldName=dbFieldValue). Here, the value before the '=' represents the join table's field, and the value after the '=' represents the field value. Another way to do this, is to have a record value be saved to a join table field. (dbFieldName=${recordFieldName}). In this case, the value before the "=" is the join table field, and the text after the "=", between the "${" and "}" is a recordFieldName value. This will be automatically replaced to the record's corresponding value during both saving or deleting. Multiple field and value pairs can be specified, the pairs are separated by a "," character.- Throws:
NullPointerException
- Occurs if thejoinTableName / recordColumnName / valueColumnName
parameter(s) is/arenull
-
-
Method Details
-
setValue
Sets the value list.- Parameters:
valueList
- The value list, ifnull
, an empty list will be used- Returns:
- The JBMultiValue object
-
getValueList
Gets the value list.- Returns:
- The value list.
-
getJoinTableName
Gets the join table name.- Returns:
- The join table's database specific name
-
getRecordColumnName
Gets the record column name.- Returns:
- The record column name.
-
getValueColumnName
Gets the value column name- Returns:
- The value column name a.
-
getExtendedValues
Gets the extended values.- Returns:
- The extended values, in a text form.
-