PersonQueryBuilderBase class

This Gosu class builds queries for querying an ABPerson entity. It extends ContactQueryBuilder and adds new query logic used by PersonQueryBuilder and UserContactQueryBuilder. You can compare PersonQueryBuilderBase to ContactQueryBuilder class to see how to add new query logic for a field, such as LastName or LicenseNumber.

To open this class in Guidewire Studio™, navigate in the Project window to configuration > gsrc and then to gw.plugin.contact.findduplicates.querybuilder.PersonQueryBuilderBase.

The class builds the following queries in addition to, or in place of, those in ContactQueryBuilder:

startsWithFirstName
Adds an expression to the query. Uses the entire string in the FirstName field of the ABPerson being checked for duplicates. Compares this string to a substring at the start of the FirstName field of an ABPerson in the database. If the string and the substring are equal, the contacts are a starts with match. For example, “Asim” would be a starts with match with “Asimov”.
function startsWithFirstName() : U {
  addExpression(new StartsWithFieldExpression<T>(
      "FirstName", Contact.FirstName))
  return this as U
}
hasEqualLastName
Adds an expression to the query. The expression determines if the LastName field of the ABPerson being checked for duplicates is equal to the LastName field of an ABPerson in the database.
function hasEqualLastName() : U {
  addExpression(new EqualFieldExpression<T>(
      "LastNameDenorm", Contact.LastName, false))
  return this as U
}
hasEqualBirthDate
Adds an expression to the query. The expression determines if the DateOfBirth field of the ABPerson being checked for duplicates is equal to the DateOfBirth field of an ABPerson in the database.
function hasEqualBirthDate() : U {
  addExpression(new EqualFieldExpression<T>(
      "DateOfBirth", Contact.DateOfBirth))
  return this as U
}
hasEqualLicenseNumber
Adds an expression to the query. The expression determines if the LicenseNumber and LicenseState fields of the ABPerson being checked for duplicates are equal to the same fields of an ABPerson in the database.
function hasEqualLicenseNumber() : U {
  addExpression(new AndCompositeFieldExpression<T>({
    new EqualFieldExpression<T>("LicenseNumber", Contact.LicenseNumber),
    new EqualFieldExpression<T>("LicenseState", Contact.LicenseState)
  }))
  return this as U
}
hasEqualPhoneNumbers
Adds an expression to the query. The method overrides ContactQueryBuilder.hasEqualPhoneNumbers and adds the CellPhone field as one of the phone number fields to check. The method determines if the HomePhone, WorkPhone, FaxPhone, or CellPhone field of the ABPerson being checked for duplicates is equal to the equivalent field of an ABPerson in the database. If one of the fields matches, the contacts have equal phone numbers.
override function hasEqualPhoneNumbers() : U {
  var numbers = PhoneNumbers
  var phoneOperators : List<FieldExpression<T>> = {
    new InFieldExpression<T>("HomePhone", numbers),
    new InFieldExpression<T>("WorkPhone", numbers),
    new InFieldExpression<T>("FaxPhone", numbers)
    new InFieldExpression<T>("CellPhone", numbers)
  }
  addExpression(new OrCompositeFieldExpression<T>(
    phoneOperators.toTypedArray() ))
  return this as U
}