sql.append(" from ");
sql.append(table);
sql.append(" where ");
appendCollectionWhereValues(connector, parent, sql);
final Results rs = connector.select(sql.toString());
final SpecificationLoaderSpi reflector = IsisContext.getSpecificationLoader();
final JdbcPolymorphicObjectReferenceMapping idMapping =
(JdbcPolymorphicObjectReferenceMapping) idMappingAbstract;
while (rs.next()) {
final ObjectSpecification itemSpecification = reflector.loadSpecification(rs.getString(classColumnName));
idMapping.setObjectSpecification(itemSpecification);
// Load new recordSet for the actual class
final ObjectMapping itemMapper = objectMappingLookup.getMapping(itemSpecification, connector);
final TypedOid oid = idMapping.recreateOid(rs, itemSpecification);
final ObjectAdapter loadedObject = itemMapper.getObject(connector, oid);
LOG.debug(" element " + loadedObject.getOid());
list.add(loadedObject);
}
rs.close();
}