BATCH-1546: add and run integration tests for oracle

This commit is contained in:
dsyer
2010-04-06 07:51:25 +00:00
parent 135845f9ec
commit d04a904eaf
11 changed files with 190 additions and 22 deletions

View File

@@ -43,7 +43,7 @@ public class OraclePagingQueryProvider extends AbstractSqlPagingQueryProvider {
int offset = (page * pageSize);
offset = offset==0 ? 1 : offset;
return SqlPagingQueryUtils.generateRowNumSqlQuery(this, this.getSortKey() + " AS SORT_KEY", false,
"ROWNUM = " + offset);
"TMP_ROW_NUM = " + offset);
}
private String buildRowNumClause(int pageSize) {

View File

@@ -101,7 +101,7 @@ public class SqlPagingQueryUtils {
public static String generateRowNumSqlQuery(AbstractSqlPagingQueryProvider provider, String selectClause, boolean remainingPageQuery,
String rowNumClause) {
StringBuilder sql = new StringBuilder();
sql.append("SELECT * FROM (SELECT ").append(selectClause);
sql.append("SELECT * FROM (SELECT ").append(selectClause).append(", ROWNUM as TMP_ROW_NUM");
sql.append(" FROM ").append(provider.getFromClause());
buildWhereClause(provider, remainingPageQuery, sql);
sql.append(" ORDER BY ").append(provider.getSortKey());

View File

@@ -136,6 +136,9 @@ public abstract class AbstractItemCountingItemStreamItemReader<T> implements Ite
catch (Exception e) {
throw new ItemStreamException("Failed to initialize the reader", e);
}
if (!isSaveState()) {
return;
}
if (executionContext.containsKey(ecSupport.getKey(READ_COUNT_MAX))) {
maxItemCount = executionContext.getInt(ecSupport.getKey(READ_COUNT_MAX));