ContactQueryBuilder class
This Gosu class provides a basic set of ABContact queries for the query builder classes. The classes that extend this one produce a set of queries for specific ABContact subtypes, which in turn are used by the duplicate finder classes for those subtypes.
To open this class in Guidewire Studio™, navigate in the Project window to and then to gw.plugin.contact.findduplicates.querybuilder.ContactQueryBuilder.
The class builds the following queries:
- hasEqualTaxId
- Adds an expression to the query. The expression determines if
the
TaxIDfield of the ABContact being checked for duplicates is equal to theTaxIDfield of an ABContact in the database.function hasEqualTaxId() : U { addExpression(new EqualFieldExpression<T>( "TaxID", _contact.TaxID)) return this as U } - hasEqualPhoneNumbers
- Adds an expression to the query. Determines if the
HomePhone,WorkPhone, orFaxPhonefield of the ABContact being checked for duplicates is equal to the equivalent field of an ABContact in the database. If one of the fields matches, the contacts have equal phone numbers.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) } addExpression(new OrCompositeFieldExpression<T>( phoneOperators.toTypedArray() )) return this as U } - hasEqualAddress
- Adds an expression to the query. Compares fields of the
PrimaryAddressof the ABContact being checked for duplicates to the equivalent fields of thePrimaryAddressof an ABContact in the database. If theAddressLine1,State,City, andPostalCodefields are equal for both contacts, the addresses are considered equal.function hasEqualAddress() : U { addExpression(new AndCompositeFieldExpression<T>({ new EqualFieldExpression<T>( "AddressLine1", "PrimaryAddress", _contact.PrimaryAddress.AddressLine1,false), new EqualFieldExpression<T>( "State", "PrimaryAddress", _contact.PrimaryAddress.State,false), new EqualFieldExpression<T>( "City", "PrimaryAddress", _contact.PrimaryAddress.City.flase), new EqualFieldExpression<T>( "PostalCode", "PrimaryAddress", _contact.PrimaryAddress.PostalCode,false) })) return this as U } - startsWithName
- Adds an expression to the query. Uses the entire string in the
Namefield of the ABContact being checked for duplicates. Compares this string to a substring at the start of theNamefield of an ABContact 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 startsWithName() : U { addExpression(new StartsWithFieldExpression<T>("Name", _contact.Name)) return this as U }
