The next code seems to be appropriate:
Parent parentInstance = some given parent
QuerySpec querySpec = new QuerySpec();
int parentIndex = querySpec.appendClassList(Parent.class, false);
int linkIndex = querySpec.appendClassList(ParentChildLink.class, false);
int childIndex = querySpec.appendClassList(Child.class, false);
querySpec.appendSelect(new ClassAttribute(Child.class, Child.NAME), new int[]{childIndex}, true);
querySpec.appendJoin(linkIndex, ParentChildLink.CHILD_ROLE, childIndex);
querySpec.appendJoin(linkIndex, ParentChildLink.PARENT_ROLE, parentIndex);
CompositeWhereExpression whereExpression = new CompositeWhereExpression(LogicalOperator.AND);
whereExpression.append(new SearchCondition(Parent.class, Parent.NAME, SearchCondition.EQUAL, parentInstance.getName()), new int[]{0});
querySpec.appendWhere(whereExpression, new int[]{0});
But:
1) I need to get child objects, not some of their fields.
2) I specified parent name in where clause, the field of parent class i declared myself. Does windchill provide any unique field by default that would be more appropriate?