Are Hibernate named HQL queries (in annotations) optimised?
Posted
by Graham Lea
on Stack Overflow
See other posts from Stack Overflow
or by Graham Lea
Published on 2010-04-15T00:42:33Z
Indexed on
2010/04/15
0:53 UTC
Read the original article
Hit count: 341
A new colleague has just suggested using named HQL queries in Hibernate with annotations (i.e. @NamedQuery) instead of embedding HQL in our XxxxRepository classes.
What I'd like to know is whether using the annotation provides any advantage except for centralising quueries?
In particular, is there some performances gain, for instance because the query is only parsed once when the class is loaded rather than every time the Repository method is executed?
© Stack Overflow or respective owner