// select data for this sm
final ClassMapping[] elems = getIndependentElementMappings(true);
final Joins[] resJoins = new Joins[Math.max(1, elems.length)];
Union union = store.getSQLFactory().newUnion
(Math.max(1, elems.length));
union.select(new Union.Selector() {
public void select(Select sel, int idx) {
ClassMapping elem = (elems.length == 0) ? null : elems[idx];
resJoins[idx] = selectAll(sel, elem, sm, store, fetch,
JDBCFetchConfiguration.EAGER_PARALLEL);
}