Skip to content

Extend fetchSize support across JPA Item Readers #4506

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

Closed

Conversation

baezzys
Copy link
Contributor

@baezzys baezzys commented Dec 1, 2023

Resolves #4479

@pivotal-cla
Copy link

@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
Copy link

@baezzys Thank you for signing the Contributor License Agreement!

@baezzys baezzys force-pushed the Add_fetchsize_for_queryhint branch 2 times, most recently from c6f5df1 to 26314ad Compare December 3, 2023 14:52
@fmbenhassine
Copy link
Contributor

@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 fmbenhassine added pr-for: feature status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter in: infrastructure labels Dec 19, 2023
@baezzys
Copy link
Contributor Author

baezzys commented Dec 20, 2023

@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 baezzys force-pushed the Add_fetchsize_for_queryhint branch 2 times, most recently from 26314ad to 38649f2 Compare December 20, 2023 04:15
ig-jinwoo

This comment was marked as off-topic.

@fmbenhassine
Copy link
Contributor

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.

@baezzys
Copy link
Contributor Author

baezzys commented Mar 21, 2024

@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 baezzys force-pushed the Add_fetchsize_for_queryhint branch from 38649f2 to c2b5dc4 Compare March 28, 2024 08:14
Enhanced `JpaCursorItemReader`, `JpaCursorItemReaderBuilder`, `JpaPagingItemReader`, and `JpaPagingItemReaderBuilder` with query hints configuration. The inclusion of query hints in both cursor and paging item readers improves query execution strategies, optimizing performance for complex data retrieval scenarios.
@baezzys baezzys force-pushed the Add_fetchsize_for_queryhint branch from c2b5dc4 to 9d3bb29 Compare March 28, 2024 08:19
@baezzys
Copy link
Contributor Author

baezzys commented Mar 28, 2024

@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.

@fmbenhassine
Copy link
Contributor

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

@injae-kim
Copy link
Contributor

Nice work @baezzys !

@fmbenhassine fmbenhassine removed the status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for query hints in JPA item readers
5 participants