4.4. Filter and Concurrency Columns
Contents
4.4.1. Filter Columns
4.4.2. Concurrency Columns
This section explains how to define filter and concurrency columns for a persistent class.
4.4.1. Filter Columns
For an introduction on filters see section 2.3. Mapping a Class Inheritance Tree. Please note that persistent classes sharing a common database table do not necessarily have to extend the same base class in the object model. Section 2.3 discusses filters in that context, but this is by no means a restriction on the use of filters.
A business class that has a filter column defined will only instantiate objects from the database table whose rows match a specific value in the filter column. Filters may be used with either SUBSET or SUPERSET class mappings, but are more commonly used with SUBSET classes. Specifically, when several business classes have many attributes in common (e.g., classes in an inheritance tree), it is convenient to store them in the same database table, and use the filter column value to distinguish among class types. VBSF automatically maintains the filter column value in the database table, therefore it should not be defined as an attribute in the class.
A filter may be defined based on a specific value or on the nullability of the filter column. If a filter column is defined based on nullability and with a value of NOT NULL, VBSF will not be able to automatically maintain the filter column because an exact value is not known.
4.4.2. Concurrency Columns
A concurrency column is a special column that VBSF can use to control concurrency. If a concurrency column is not defined, VBSF controls concurrency by checking that the values of all modified attributes in an object have not been changed by another user during a database update operation. There are two drawbacks to this approach:
A concurrency column is a column that is defined for the sole purpose of controlling concurrency. During database updates VBSF only checks that the value of this column has not been changed, which is faster than checking multiple columns. Also, using a concurrency column prevents users from making concurrent non-conflicting changes to an object.
VBSF supports two types of concurrency columns:
4.4.3. The Filter and Concurrency Columns Form
The Filter and Concurrency Columns form shown below is displayed when the "Filter and Concurrency" sub-header of a persistent class is clicked in the tree.

Filter panel
Type. Select the corresponding attribute type of the filter column. Attribute types are defined in section 4.2.1. Attribute Types.
Table name. If the filter is defined on a class with SUPERSET mapping, then enter or select from the combo box drop down list the name of the table where the filter column is located. Table names are case sensitive, therefore all references to the same table name throughout the schema must use the same capitalization. For classes with TABLE or SUBSET mappings this field is disabled.
Column name. Enter or select from the combo box drop down list the name of the filter column. Column names are case sensitive, therefore all references to the same column name throughout the schema must use the same capitalization.
Column type. If generating a DDL script from the schema, enter the column data type. For string and numeric attributes you may directly specify the size and precision. If you leave this field blank and generate a DDL script, the script generator will obtain the default column data type for the current Type from the DB Type Mappings panel of the configuration dialog box. If that value is also blank, the script generator will display an error message.
Nullable. This setting is only used when generating a DDL script from the schema. Check this option if the column is nullable.
Indexed. This setting is only used when generating a DDL script from the schema. Check this option if the column is indexed.
Based on nullability. Check this option if the filter column value is based on nullability, as opposed to an actual value.
Value. If Based on nullability is not checked, enter the value of the filter column. VBSF will only instantiate objects from the database table whose rows match this value. Otherwise this text field is disabled.
Must be NULL/NOT NULL. If Based on nullability is checked, specify whether the filter column should be NULL or NOT NULL. If NULL, then only objects from the database table whose rows have a NULL value in the filter column will be instantiated. If NOT NULL, then only objects from the database table whose rows have a NOT NULL value in the filter column will be instantiated.
Concurrency panel
Type. Select the corresponding attribute type of the concurrency column. Attribute types are defined in section 4.2.1. Attribute Types.
Table name. If the column is defined on a class with SUPERSET mapping, then enter or select from the combo box drop down list the name of the table where the concurrency column is located. Table names are case sensitive, therefore all references to the same table name throughout the schema must use the same capitalization. For classes with TABLE or SUBSET mappings this field is disabled.
Column name. Enter or select from the combo box drop down list the name of the concurrency column. Column names are case sensitive, therefore all references to the same column name throughout the schema must use the same capitalization.
Column type. If generating a DDL script from the schema, enter the column data type. For string and numeric attributes you may directly specify the size and precision. If you leave this field blank and generate a DDL script, the script generator will obtain the default column data type for the current Type from the DB Type Mappings panel of the configuration dialog box. If that value is also blank, the script generator will display an error message.
Nullable. This setting is only used when generating a DDL script from the schema. Check this option if the column is nullable.
Indexed. This setting is only used when generating a DDL script from the schema. Check this option if the column is indexed.
Updated by VBSF. Select this option if the concurrency column is to be maintained by VBSF. In this case, the Type should be INTEGER or LONG.
Updated by Database. Select this option if the concurrency column is to be maintained by the database. In this case, the Type will probably be OBJECT.