Extending pluggable SQL to new domains

Pluggable SQL can be extended to be used in new MDM domains.

Procedure

  1. Implement the following abstract class for any new domain:
    com.ibm.mdm.admin.ots.sql.metadata.AbstractSQLMetadata
  2. Implement the following methods in the AbstractSQLMetdata class:
    • getFilteredGroupNames() - This method returns a list of group names relevant for the inquiry level and group.
    • getChildSubGroupNames() - This method returns a list of logical groups of entities that a grouped together while generating SQL and processing Resultset Processor. For example:
      {PersonName, PartyIdentifier},{PartyAddress},{PartyRelationship}
      Note: The parent group Person is not included in the list, as it is taken from the inquiry level information.
    • getWhere() - This method returns the Where clause for a given group. This method must be implemented for every first child in the list, based upon the logical segregation of groups from the getChildSubGroupNames() method.

      You can ignore the first subgroup from getChildSubGroupNames() because the SQL for that subgroup uses the From and Where clauses of the domain parent.

      For example, using the following list of groups, {PersonName, PartyIdentifier},{PartyAddress},{PartyRelationship}, the method must be implemented for PartyAddress and PartyRelationship.

      The getWhere() method must also be implemented for the parent group of the domain.

    • getFrom(): This method returns the From clause for a given group. The groups for which this method must be implemented are the same as those for getWhere().
    • getJoin(): This method must be implemented for every child group with the corresponding parent group. This method is required for groups in which the getFrom() and getFrom() methods have not been implemented.

What to do next

You can reuse the common SQL Builders and Resultset Processors with the help of the preceding metadata class implementation.

The metadata implementation class is configured in the DWLCommon_extension.properties file's optimized.sql.metadata.<GroupName>=<Implementation class for metadata> property, where <GroupName> is the group name of the parent in the domain.

If the existing SQL Builder is not sufficient for your implementation, you can define a new SQL Builder:
  • Any new SQL Builder must implement the interface com.ibm.mdm.admin.ots.sql.OTSSQLBuilder, including the generateQuery() method.
  • The generateQuery method returns a string array of SQL statements that consist of two SQL statements: one for base and one for Point In Time (PIT).
  • The implementation must be configured in the DWLCommon_extension.properties file's optimized.sql.sqlbuilder.<GroupName>=<Implementation class for SQL Builder> property.