QuerySpec querySpec = new QuerySpec(); int linkIndex = querySpec.appendClassList(WTPartUsageLink.class, true); int partIndex = querySpec.appendClassList(WTPart.class, false); querySpec.appendJoin(linkIndex,wt.part.WTPartUsageLink.USED_BY_ROLE, partIndex); querySpec.appendWhere(new SearchCondition(WTPart.class, WTPart.LIFE_CYCLE_STATE, SearchCondition.EQUAL, "APPROVED"),newint[]{partIndex});
I just wonder why you want to get the links for all iterations -- maybe you should only search for wtparts where islatestiteration is 1