Class JBMultiValue

java.lang.Object
com.jbstrap.core.dao.JBMultiValue

public class JBMultiValue extends Object
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 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 Details

    • JBMultiValue

      public JBMultiValue(String joinTableName, String recordColumnName, String valueColumnName, String extendedValues)
      Creates a new instance. The joinTableName, recordColumnName, valueColumnName must be specified. The extendValues is optional.
      Parameters:
      joinTableName - The name of the join table, where the values are saved
      recordColumnName - 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 the joinTableName / recordColumnName / valueColumnName parameter(s) is/are null
  • Method Details

    • setValue

      public JBMultiValue setValue(List<Object> valueList)
      Sets the value list.
      Parameters:
      valueList - The value list, if null, an empty list will be used
      Returns:
      The JBMultiValue object
    • getValueList

      public List<Object> getValueList()
      Gets the value list.
      Returns:
      The value list.
    • getJoinTableName

      public String getJoinTableName()
      Gets the join table name.
      Returns:
      The join table's database specific name
    • getRecordColumnName

      public String getRecordColumnName()
      Gets the record column name.
      Returns:
      The record column name.
    • getValueColumnName

      public String getValueColumnName()
      Gets the value column name
      Returns:
      The value column name a.
    • getExtendedValues

      public String getExtendedValues()
      Gets the extended values.
      Returns:
      The extended values, in a text form.