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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Feb 25, 2013

Member

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

Member

timowest commented Feb 25, 2013

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

@imilina

This comment has been minimized.

Show comment
Hide comment
@imilina

imilina Feb 26, 2013

Works great, thnx for quick fix.

imilina commented Feb 26, 2013

Works great, thnx for quick fix.

@imilina imilina closed this Feb 26, 2013

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Feb 26, 2013

Member

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

Member

timowest commented Feb 26, 2013

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

@timowest timowest reopened this Feb 26, 2013

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Mar 21, 2013

Member

Released in 3.0.0

Member

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