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

JPAQueryFactory does not support query hint indexes. #3621

Open
jeonjonghyeok opened this issue Nov 6, 2023 · 5 comments
Open

JPAQueryFactory does not support query hint indexes. #3621

jeonjonghyeok opened this issue Nov 6, 2023 · 5 comments

Comments

@jeonjonghyeok
Copy link

jeonjonghyeok commented Nov 6, 2023

Why the new feature should be added

I'm currently using the JPAQueryFactory feature well.

However, there are requirements.
An explicit INDEX hint is required within the SELECT query.

Since there is no function to set query index hint, we are using SQLQueryFactory to force mismatched tables to match inefficiently.
I would be really happy if there was a function to insert /*+ INDEX() */ right after the SELECT query.

It would be nice to add an index hint using JPAQuery's setHint() method.

How the new feature should work

AbstractCommonQueryContract 클래스의 applyHint(String hintName, Object value) 메소드에 enum 추가
HINT_DATABASE:
applyDatabaseHint();

MutableQueryOptions.addDatabaseHint(String hint)

@velo
Copy link
Contributor

velo commented Nov 23, 2023

Well, if you are using hibernate, sadly you are out of luck.

But, if using eclipse links, you can jpaQuery.setHint(QueryHints.HINT, "INDEX()");

https://eclipse.dev/eclipselink/api/2.6/org/eclipse/persistence/config/QueryHints.html#HINT

I know no alternatives for hibernate, sorry.

You might want to try it on querydsl 5.1
https://github.com/OpenFeign/querydsl

@jherkel
Copy link

jherkel commented Dec 6, 2023

@velo Could you enable "issues" for your fork? I would like to create one issue (regression) for querydsl-apt module.

@velo
Copy link
Contributor

velo commented Dec 6, 2023

Ops, done!

@velo
Copy link
Contributor

velo commented Dec 13, 2023

@velo Could you enable "issues" for your fork? I would like to create one issue (regression) for querydsl-apt module.

@jherkel did you managed to raise the issue?

@jeonjonghyeok
Copy link
Author

jeonjonghyeok commented Mar 3, 2024

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

3 participants