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

JPA query hints should not be stored in java.util.HashMap #348

Closed
imilina opened this issue Feb 25, 2013 · 4 comments
Closed

JPA query hints should not be stored in java.util.HashMap #348

imilina opened this issue Feb 25, 2013 · 4 comments
Milestone

Comments

@imilina
Copy link

@imilina imilina commented Feb 25, 2013

Currently hints are stored in java.util.HashMap instance. The problem is that this does not permit duplicate keys, which is required for some eclipselink hints, for example (using JPA TypedQuery):

query.setHint("eclipselink.batch.type", "IN");
query.setHint("eclipselink.batch", "person.workAddress");
query.setHint("eclipselink.batch", "person.homeAddress");

If query returns list of persons (with lazy adresses), this hint will tell eclipselink to fetch addresses upon access using single aditional select (one for home, one for work address) with IN clause, preventing N+1 problem.

"eclipselink.join-fetch" and "eclipselink.left-join-fetch" hints would too suffer from the same problem.

@timowest
Copy link
Member

@timowest timowest commented Feb 25, 2013

Fixed now. I accidently used the wrong issue number in the commit message 49f9113

@imilina
Copy link
Author

@imilina imilina commented Feb 26, 2013

Works great, thnx for quick fix.

@imilina imilina closed this Feb 26, 2013
@timowest
Copy link
Member

@timowest timowest commented Feb 26, 2013

I'll close it, when it's released.

@timowest timowest reopened this Feb 26, 2013
@timowest
Copy link
Member

@timowest timowest commented Mar 21, 2013

Released in 3.0.0

@timowest timowest closed this Mar 21, 2013
@timowest timowest added this to the 3.0.0 milestone Apr 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants