RESOLVED: BATCH-1501 - paging queries fixed for sort key not in first column of query
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
<bean class="org.springframework.batch.item.database.support.SqlPagingQueryProviderFactoryBean">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
<property name="sortKey" value="ID" />
|
||||
<property name="selectClause" value="select ID, NAME, CREDIT" />
|
||||
<!-- Intentionally put sort key second in the query list as a test -->
|
||||
<property name="selectClause" value="select NAME, ID, CREDIT" />
|
||||
<property name="fromClause" value="FROM CUSTOMER" />
|
||||
<property name="whereClause" value="WHERE CREDIT > :credit" />
|
||||
</bean>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.springframework.batch.sample.iosample;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -57,7 +58,15 @@ public class JdbcPagingRestartIntegrationTests {
|
||||
ExecutionContext executionContext = new ExecutionContext();
|
||||
executionContext.putInt("JdbcPagingItemReader.read.count", 2);
|
||||
((ItemStream)reader).open(executionContext);
|
||||
assertNotNull(reader.read());
|
||||
CustomerCredit item = reader.read();
|
||||
// System.err.println(item);
|
||||
assertNotNull(item);
|
||||
item = reader.read();
|
||||
// System.err.println(item);
|
||||
assertNotNull(item);
|
||||
item = reader.read();
|
||||
// System.err.println(item);
|
||||
assertNull(item);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user