spring-batch icon indicating copy to clipboard operation
spring-batch copied to clipboard

Extend fetchSize support across JPA Item Readers

Open baezzys opened this issue 1 year ago • 5 comments
trafficstars

Resolves #4479

baezzys avatar Dec 01 '23 20:12 baezzys

@baezzys Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

pivotal-cla avatar Dec 03 '23 14:12 pivotal-cla

@baezzys Thank you for signing the Contributor License Agreement!

pivotal-cla avatar Dec 03 '23 14:12 pivotal-cla

@baezzys Thank you for the PR! I added an inline comment on how we should address this feature request. Could please take a look? If you agree, please update the PR and it should be good to merge. Thank you upfront.

fmbenhassine avatar Dec 19 '23 15:12 fmbenhassine

@fmbenhassine Thanks for checking out my PR. But I can't seem to find the inline comment you're talking about. Can you point me in the right direction?

baezzys avatar Dec 20 '23 04:12 baezzys

The JPA reader should not depend on APIs from a specific implementation (ie import org.hibernate.jpa.AvailableHints;), it should be implementation agnostic. The way the requested feature should be implemented is by adding a Map<String, Object> hintValues for hints (similar to Map<String, Object> parameterValues for query parameters) and set those hints on the query with query#setHint in doOpen. The user can then specify all the hints supported by the provider and pass them as a Map to the JPA reader.

fmbenhassine avatar Mar 19 '24 10:03 fmbenhassine

@fmbenhassine Thank you for your review and feedback! I'll update the PR to use Map<String, Object> hintValues for setting hints, ensuring the JPA reader remains implementation-agnostic.

baezzys avatar Mar 21 '24 10:03 baezzys

@fmbenhassine I've updated the PR to include a Map<String, Object> hintValues for hints, similar to our approach with query parameters. This change ensures our JPA reader is implementation-agnostic, allowing users to specify provider-supported hints directly.

I hope this update aligns with your guidance. Please let me know if there are any further adjustments needed.

baezzys avatar Mar 28 '24 08:03 baezzys

Thank you for the update, LGTM now 👍 Rebased and merged as 5a261fa7c6945de9c3dc85145473c0fa3ac4321b. Thank you for your contribution!

fmbenhassine avatar Apr 02 '24 13:04 fmbenhassine

Nice work @baezzys !

injae-kim avatar Apr 02 '24 13:04 injae-kim