I am using 2.2.7.RELEASE
version of Spring Batch in my project.
I have a batch which is using JdbcPagingItemReader
to read records from DB2. In that I have a JOIN on 2 tables and have some where conditions. At the last I am providing column by which I want to sort my records. But because I am using table aliases, its giving me error. When skipping alias name, then its give problem while fetching the next set of result.
I searched and found that this issue got resolved in 2.1.9 Release but I couldn't find the fix in later releases. Anybody has any idea about this issue and the solution too.
You can find the code snippet of query configuration below.
<bean id="releaseSqlPagingQueryProvider" class="org.springframework.batch.item.database.support.SqlPagingQueryProviderFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="selectClause" value="SELECT M.* " />
<property name="fromClause" value="FROM MASTER AS M JOIN RELEASE AS R ON M.EMPLOYEE_ID = R.EMPLOYEE_ID " />
<property name="whereClause" >
<value>
<![CDATA[
WHERE R.COLUMN_1 = ?
]]>
</value>
</property>
<property name="sortKey" value="EMPLOYEE_ID" />