Repository navigation
Conversation
cd8583d to
e925b29
Compare
|
Thank you for this addition! A separate reader is the way to go. However, I wouldn't deprecate Another point I wanted to share about duplicated logic: there are several lines of page, restart and lock handling that are similar to |
e925b29 to
48316ec
Compare
Done in 48316ec.
Indeed, I'm on it! |
|
I started working on a new However:
I don't think I should introduce a third abstraction. However, I'm not sure how to solve the duplication in @fmbenhassine WDYT? Maybe version 7 could merge |
|
No need for a third abstraction. I agree on adopting |
|
While adopting |
Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
…date docs Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
48316ec to
5b8ca9d
Compare
|
I updated this PR assuming #5583 will be merged ( |
|
Rebased, squashed and merged as a1b0946. I omitted a couple unrelated changes that we can apply in a separate PR. Thank you very much for your contribution! |
This PR adds
PageableItemReader, a type-safeRepositoryItemReaderalternative that uses aFunction<Pageable, Slice<?>>instead of the reflection-based strategy for query invocation.It also adds a related
PageableItemReaderBuilder.PageableItemReaderis deliberately designed afterRepositoryItemReaderin its paging, restart, and locking behavior. However, it favors constructor parameters instead of setters for mandatory configuration.In addition, compared to
RepositoryItemReader, there are two improvements:org.springframework.data.domain.Sortat construction time instead of computing it insidedoPageRead()volatilefield modifiers were redundant with the existingReentrantLockLastly, I preferred introducing a dedicated reader rather than enhancing
RepositoryItemReaderto support both use cases (following the rationale at #4484 (comment)). However, if you'd prefer to enhanceRepositoryItemReader, let me know and I'll take care of the changes.