Hi.
I need to create QuerySpec to find WTPartUsageLink, where parent WTPart has specified state.
Can anyone provide me sample code?
I tried:
QuerySpec querySpec = new QuerySpec(WTPartUsageLink.class);
int linkIndex = querySpec.appendClassList(WTPartUsageLink.class, false);
int partIndex = querySpec.appendClassList(WTPart.class, false);
querySpec.appendJoin(linkIndex, "roleAObjectRef", partIndex);
CompositeWhereExpression where = new CompositeWhereExpression(LogicalOperator.AND);
where.append(new SearchCondition(WTPart.class, WTPart.LIFE_CYCLE_STATE, SearchCondition.EQUAL, "APPROVED"), new int[]{partIndex});
querySpec.appendWhere(where, new int[]{0});
I get QueryException that WTPart is not parent for WTPartUsageLink.
What am i doing wrong?
Thanks.