Package com.tibco.patterns.dedupe_utils

## Class GenericQueryBuilder

- java.lang.Object
- - com.tibco.patterns.dedupe_utils.GenericQueryBuilder

- All Implemented Interfaces:
    `QueryBuilder<KeyedNetricsRecord>`

      public class GenericQueryBuilder
      extends java.lang.Object
      implements QueryBuilder<KeyedNetricsRecord>

  Wrap ANetricsQueryBuilder as a QueryBuilder. This allows any implementation of ANetricsQueryBuilder to be wrapped as an implementation of QueryBuilder<KeyedNetricsRecord>. This allows any implementation of ANetricsQueryBuilder to be plugged into the deduplication framework as the record matching query.

  Note that objects of this class are not thread safe. They should not be used in more than one deduplicator at the same time.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GenericQueryBuilder​(java.lang.String query_table, com.netrics.likeit.ANetricsQueryBuilder our_builder, int exception_limit)` | Wrap a generic query builder for use in deduplication framework.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `KeyedQuery` | `buildQuery​(KeyedNetricsRecord record)` | Generate and return the dedupe framework query.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GenericQueryBuilder

          public GenericQueryBuilder​(java.lang.String query_table,
                                     com.netrics.likeit.ANetricsQueryBuilder our_builder,
                                     int exception_limit)
                              throws java.lang.IllegalArgumentException

      Wrap a generic query builder for use in deduplication framework.
      Parameters:
        `query_table` - name of the table to be queried.
        `our_builder` - a fully initialized query builder. This is used to generate the record matching queries.
        `exception_limit` - Query processing is halted if more than this number of unexpected exceptions is encountered when building queries. If this is zero or negative the default value of 100 is used.
      Throws:
        `java.lang.IllegalArgumentException` - if our_builder is null, or if query_table is null or empty.

  - ### Method Detail

    - #### buildQuery

          public KeyedQuery buildQuery​(KeyedNetricsRecord record)
                                throws QueryBuildException

      Generate and return the dedupe framework query.
      Specified by:
        `buildQuery` in interface `QueryBuilder<KeyedNetricsRecord>`
      Parameters:
        `record` - this must contain an instance of NetricsRecord. A ClassCastException is thrown if it is not.
      Returns:
        the keyed query for matching this record.
      Throws:
        `QueryBuildException` - action is halt if our builder is in invalid state or if the exception limit is exceeded, action is continue otherwise.