sel.selectPrimaryKey(field.getDefiningMapping());
// set a variable name that does not conflict with any in the query;
// using a variable guarantees that the selected data will use different
// aliases and joins than any existing WHERE conditions on this field
// that might otherwise limit the relations that match
Joins joins = sel.newJoins().setVariable("*");
eagerJoin(joins, cls, true);
sel.select(cls, field.getSelectSubclasses(), store, fetch, eagerMode,
joins);
}