The following sample searches involved party records by entity type and contact last name.
//for this sample, it is assumed there exists an involved record
with the unique key equal to a String, invUniqueKey
private InvolvedRepository involvedRepository;
private List<String> getPropertiesToRead() {
List<String> props = new List<String>();
props.add("uniqueKey");
props.add("person.lastName");
props.add("person.firstName");
props.add("project");
props.add("project.name");
props.add("contact.uniqueKey");
return props;
}
public void searchInvolveds() throws Exception {
StringFieldCriterion fieldCriterion1 = new StringFieldCriterion();
fieldCriterion.setComparator(StringComparator.EQUALS_ENFORCE_CASE);
LegacySearchFieldPathExpression fieldPathExpression1 = new LegacySearchFieldPathExpression();
fieldPathExpression1.setSearchKeyPath("entityType.uniqueCode");
fieldCriterion1.setFieldPath(fieldPathExpression1);
//filtering for involved party records defined by the Involved object definition with the TeamConnect unique code, "DINV"
fieldCriterion.getValue().add("DINV");
FieldSearchClause searchCriteria = new FieldSearchClause();
searchCriteria.setOperator(LogicOperator.AND);
searchCriteria.getCriteria().add(fieldCriterion1);
//the following section defines a second fieldCriterion item for
StringFieldCriterion fieldCriterion2 = new StringFieldCriterion();
fieldCriterion.setComparator(StringComparator.EQUALS);
LegacySearchFieldPathExpression fieldPathExpression2 = new LegacySearchFieldPathExpression();
fieldPathExpression2.setSearchKeyPath("contact.person.lastName");
fieldCriterion2.setFieldPath(fieldPathExpression2);
fieldCriterion.getValue().add("Doe");
searchCriteria.getCriteria().add(fieldCriterion2);
public void test_readInvolvedsByCriteria throws Exception {
// Search the involved records
Involved involved = involvedRepository.readInvolvedsByCriteria(searchCriteria, 100,
getPropertiesToRead());
}