Information
This version of the product has reached end of support. The documentation is available for your convenience. However, you must be logged in to access it. You will not be able to leave comments.

Java example--value set queries



// inNotInOption is either RelationalOperationInfo.AR_REL_OP_IN
// or RelationalOperationInfo.AR_REL_OP_NOT_IN
private void queryUsingSubquery(int inNotInOption, ARServerUser arConnection) throws ARException
{
// Create subquery part first.
ValueSetQuery subquery = new ValueSetQuery();

// Add InSubqueryPermissions4 form as the subquery source.
QuerySourceForm perm4Form = new QuerySourceForm("InSubqueryPermissions4");
subquery.addFromSource(perm4Form);

// The subquery's return value.
subquery.addFromField(536870913, perm4Form);

// Create regular query.
RegularQuery query = new RegularQuery();

// Add InSubqueryPermissions1 as the from source.
QuerySourceForm perm1Form = new QuerySourceForm("InSubqueryPermissions1");
query.addFromSource(perm1Form);

// Set the regular query's return fields.
query.addFromField(1, perm1Form);
query.addFromField(536870913, perm1Form);
query.addFromField(536870914, perm1Form);

// Set value set query now.
ArithmeticOrRelationalOperand field =
   new ArithmeticOrRelationalOperand(536870913, perm1Form);
ArithmeticOrRelationalOperand arethQuery =
   new ArithmeticOrRelationalOperand(subquery);
RelationalOperationInfo relOp =
   new RelationalOperationInfo(inNotInOption, field, arethQuery);
QualifierInfo subqueryQual = new QualifierInfo(relOp);
query.setQualifier(subqueryQual);

// Call routine.
List<QuerySourceValues> results =
   arConnection.getListEntryObjects(query, 0, 0, false, null);
}

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

AR System 21.3