}
StatementPrototypeGenerator whereGenerator = new StatementPrototypeGenerator(
adapter);
whereGenerator.setClauses(clause);
StatementPrototype sp = whereGenerator.generate(clazz, true);
// get the id of clazz
String shortName = whereGenerator.getTypeStack()
.getActualRepresentation().getAsName();
StringBuilder statement = new StringBuilder("SELECT ");
statement.append(shortName);
statement.append(".");
statement.append(Defaults.ID_COL);
statement.append(",");
statement.append(shortName);
statement.append(".");
statement.append(Defaults.REAL_CLASS_COL);
statement.append(",");
statement.append(shortName);
statement.append(".");
statement.append(Defaults.REAL_ID_COL);
statement.append(" FROM ");
if (id != null)
{
sp.addEqualsClause(shortName + "." + Defaults.ID_COL, id);
}
PreparedStatement ps = sp.toPreparedStatement(cw, statement.toString());
ResultSet rs = ps.executeQuery();
List<HashMap<String, Object>> propertyVector = createPropertyVector(rs);
ps.close();
// If a row has a REALCLASS entry, load data for the subclass
for (HashMap<String, Object> map : propertyVector)