result = objects.immutableClone();
}
else {
// we have hints, use them
EOModel model = EOModelGroup.defaultGroup().entityNamed(spec.entityName()).model();
ERXSQLHelper sqlHelper = ERXSQLHelper.newSQLHelper(ec, model.name());
Object hint = spec.hints().valueForKey(EODatabaseContext.CustomQueryExpressionHintKey);
String sql = sqlHelper.customQueryExpressionHintAsString(hint);
sql = sqlHelper.limitExpressionForSQL(null, spec, sql, start, end);
if (rawRowsForCustomQueries) {
result = EOUtilities.rawRowsForSQL(ec, model.name(), sql, null);
}
else {
EOFetchSpecification fs = new EOFetchSpecification(spec.entityName(), null, null);
fs.setHints(new NSDictionary(sql, EODatabaseContext.CustomQueryExpressionHintKey));
result = ec.objectsWithFetchSpecification(fs);