// create all our eager selects so that those fields are reserved
// and cannot be reused during the actual eager select process,
// preventing infinite recursion
eager = Math.min(eager, fetch.getEagerFetchMode());
FieldMapping eagerToMany = createEagerSelects(sel, mapping, sm, fields,
fetch, eager);
// select all base class mappings; do this after batching so that
// the joins needed by these selects don't get in the WHERE clause
// of the batched selects
int seld = selectBaseMappings(sel, mapping, mapping, sm, fields,
fetch, eager, eagerToMany, ident, joinedSupers);
// select eager to-many relations last because during load they
// advance the result set and could exhaust it, so no other mappings
// can load afterwords
if (eagerToMany != null)
eagerToMany.selectEagerJoin(sel, sm, this,
fetch.traverseJDBC(eagerToMany), eager);
// optionally select subclass mappings
if (subs == Select.SUBS_JOINABLE || subs == Select.SUBS_ANY_JOINABLE)
selectSubclassMappings(sel, mapping, sm, fetch);