Defining business keys and validation

Business keys for groups are defined by metadata entries in the V_ELEMENTATTRIBUTE table, and supported by corresponding metadata entries in the V_GROUP, V_ELEMENT, CDDWLTABLETP, CDDWLCOLUMNTP, and GROUPDWLTABLE tables. The business key attributes and the supporting metadata in these tables are already defined for the groups that require business key validations.

About this task

Restriction: Only attributes that are persisted in the database (persistent attributes) can be used to define business keys.
Important: To modify the business keys for groups that do not follow the default business key validation rules, such as those listed as exceptions in Overview of business key validation rules, you must implement a custom validator. For information on implementing custom validators, see Overriding business key validation logic for a group.

Procedure

  1. To change the business key attributes of a group or define additional attributes as business keys, use SQL to populate the V_ELEMENTATTRIBUTE table with appropriate values for the business key attributes of a group. The SQL should take the following form:
    INSERT INTO DB2ADMIN.V_ELEMENTATTRIBUTE (V_ELEMENT_ATTRB_ID, ATTRIBUTE_TP_CD, APPLICATION, GROUP_NAME, ELEMENT_NAME, EXPIRY_DT, LAST_UPDATE_DT) VALUES (<Primary key value>,<Attribute type>,<Application Name>,<Group name>,<Element name>,null, current_timestamp);
  2. If applicable, define the primary key, child business keys, and implicit business keys with the correct attribute type.
    If the business key should be validated only among active entity instances, you must also define the EndDate and ExpiryDate attributes.
    Note: Choose attribute type values carefully. For more information, see Overview of business key validation attribute types.
  3. Ensure that all required supporting metadata is available in the related metadata tables:
    1. In the V_GROUP table, ensure that the group for which the business keys are defined has an entry.
    2. In the CDDWLTABLETP table, ensure that InfoSphere MDM data tables corresponding to the group requiring business key validation are defined.
    3. In the GROUPDWLTABLE table, ensure that the group is correctly mapped to one or more InfoSphere MDM data tables through metadata defined in V_GROUP and CDDWLTABLE.
    4. In the V_ELEMENT table, ensure that the business key, primary key, child business keys, implicit business key, EndDate, and ExpiryDate attributes have correct element definitions.
    5. In the V_ELEMENT table, ensure that the elements are correctly mapped to the respective columns of the InfoSphere MDM data tables through DWLCOLUMN_TP_CD.
    6. In the CDDWLCOLUMNTP table, ensure that the columns corresponding to business key, primary key, child business keys, implicit business key, EndDate, and ExpiryDate attributes are defined.
    7. In the CDDWLCOLUMNTP table, ensure that the JDBC_TYPE is set correctly.
      The following table provides a mapping for database types to the JDBC types:
      Table 1. Mapping database types to JDBC types
      DB2® Oracle JDBC type (code type)
      BIGINT NUMBER(19,0) BIGINT
      VARCHAR VARCHAR2 VARCHAR
      TIMESTAMP TIMESTAMP TIMESTAMP
      CHARACTER CHAR CHAR
      INTEGER INTEGER INTEGER
      SMALLINT SMALLINT SMALLINT
      DECIMAL NUMBER(17,3) DECIMAL
      CLOB CLOB CLOB
      XML XMLTYPE VARCHAR
      DATE DATE DATE
      DOUBLE DOUBLE PRECISION DECIMAL
      REAL REAL REAL