Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paging query for IbatisPagingItemReader in reference documentation is incorrect [BATCH-1648] #1934

Closed
spring-issuemaster opened this issue Oct 28, 2010 · 1 comment

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Oct 28, 2010

Anand Chittanuri opened BATCH-1648 and commented

In the documentation for IbatisPagingItemReader, (http://static.springsource.org/spring-batch/reference/html/readersAndWriters.html#IbatisPagingItemReader)

the paging query is given as

<select id="getPagedCustomerCredits" resultMap="customerCreditResult">
select * from (
select * from (
select t.id, t.name, t.credit, ROWNUM ROWNUM_ from customer t order by id
) where ROWNUM_ <![CDATA[ > ]]> ( #_page# * #_pagesize# )
) where ROWNUM <![CDATA[ <= ]]> #_pagesize#
</select>

But it should be

<select id="getPagedCustomerCredits" resultMap="customerCreditResult">
select * from (
select * from (
select id,name,credit, ROWNUM rownum_ from (
select t.id, t.name, t.credit, ROWNUM ROWNUM_ from customer t order by id
) ) where ROWNUM_ <![CDATA[ > ]]> ( #_page# * #_pagesize# )
) where ROWNUM <![CDATA[ <= ]]> #_pagesize#
</select>


Referenced from: commits 51eefc7

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Oct 28, 2010

Anand Chittanuri commented

The "rownum" column in the innermost "select" query can be removed ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.