}
out.println("if ((__caucho_loadMask_" + group + " & " + mask + "L) != 0)");
out.println(" return;");
AmberTable table = _entityType.getTable();
String from = null;
String select = null;
String where = null;
String subSelect = null;
AmberTable mainTable = null;
String tableName = null;
select = _entityType.generateLoadSelect(table, "o", _index);
if (select != null) {
from = table.getName() + " o";
where = _entityType.getId().generateMatchArgWhere("o");
mainTable = table;
tableName = "o";
}
ArrayList<AmberTable> subTables = _entityType.getSecondaryTables();
for (int i = 0; i < subTables.size(); i++) {
AmberTable subTable = subTables.get(i);
subSelect = _entityType.generateLoadSelect(subTable, "o" + i, _index);
if (subSelect == null)
continue;
if (select != null)
select = select + ", " + subSelect;
else
select = subSelect;
if (from != null)
from = from + ", " + subTable.getName() + " o" + i;
else
from = subTable.getName() + " o" + i;
if (where != null) {
LinkColumns link = subTable.getDependentIdLink();
where = where + " and " + link.generateJoin("o" + i, "o");
}
else
throw new IllegalStateException();