* @return the EOSQLExpression which the EOFetchSpecification would use
*/
public static EOSQLExpression sqlExpressionForFetchSpecification(EOEditingContext ec, EOFetchSpecification spec, long start, long end) {
EOSQLExpression expression = null;
EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, spec.entityName());
EOModel model = entity.model();
EODatabaseContext dbc = EODatabaseContext.registeredDatabaseContextForModel(model, ec);
dbc.lock();
try {
ERXSQLHelper sqlHelper = ERXSQLHelper.newSQLHelper(ec, model.name());
expression = sqlHelper.sqlExpressionForFetchSpecification(ec, spec, start, end);