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

Implements @QueryHints or similar #320

Closed
manuelserradev opened this issue Apr 21, 2023 · 8 comments
Closed

Implements @QueryHints or similar #320

manuelserradev opened this issue Apr 21, 2023 · 8 comments
Assignees
Milestone

Comments

@manuelserradev
Copy link
Contributor

To process large amount of data is sometime needed to provide additional configuration for the underlying JDBC driver, eg. to disable full resultsets cache in ram.

This is particularly useful to enable cursor "streaming" on the dbms side: eg. getting-results-based-on-a-cursor.

Usually this is implemented with @QueryHints annotations in spring or .withHint methods on Panache repositories.

    return findAll()
        .withHint(QueryHints.HINT_FETCH_SIZE, 50)
        .withHint(QueryHints.HINT_READONLY, true)
        .stream()
        .map(this::detach);

I strongly think that this feature greatly fits JPAStreamer as it permits streaming at all layers involved.

@julgus
Copy link
Member

julgus commented Apr 24, 2023

Thank you for the suggestion! I will take a closer look.

@manuelserradev
Copy link
Contributor Author

manuelserradev commented Apr 24, 2023

I think I can try drafting a PR if you find it valuable. I was thinking of expanding StreamConfiguration capabilities...

@julgus
Copy link
Member

julgus commented Apr 24, 2023

Yes, that would definitely be valuable. Expanding the StreamConfiguration sounds like a good way to go!

@julgus
Copy link
Member

julgus commented Apr 24, 2023

@minborg could you also share your view on this?

@julgus
Copy link
Member

julgus commented May 19, 2023

Sorry for not paying attention to your draft sooner! Completely missed it. I've left a comment regarding missing JavaDocs, other than that it looks great. Thank you for helping out!

Before I can merge your changes I need you to sign a Contributor Licence Agreement. We have described why and how that is done here: https://github.com/speedment/jpa-streamer/blob/master/CONTRIBUTING.md.

@julgus
Copy link
Member

julgus commented May 23, 2023

I just merged your changes into the development branch. I cannot say for sure when we will make the next official release but most likely within the next month. Your name is now also on the list of contributors.

Thanks again for your valuable input and contribution!

@julgus julgus modified the milestones: 3.0.2, 3.0.1 May 23, 2023
julgus added a commit that referenced this issue May 23, 2023
@julgus
Copy link
Member

julgus commented May 23, 2023

Almost forgot! We need to document this feature in our docs to make sure anyone who searches for "query hints" can find it. I made an attempt to write something up. Do you mind checking my commit to see if it needs any changes or additions in your opinion?

@manuelserradev
Copy link
Contributor Author

LGTM!

@julgus julgus closed this as completed May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants