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: 338

Filed under:
|
|
|
|

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

Related posts about hibernate

Related posts about named

  • How to allow bind in app armor?

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    Question: I did setup bind9 as described here: http://ubuntuforums.org/showthread.php?p=12149576#post12149576 Now I have a little problem with apparmor: If I switch it off, it works. If apparmor runs, it doesn't work, and I get the following dmesg output: [ 23.809767] type=1400 audit(1344097913… >>> More

  • MAMP + Python MySQLDB - trouble installing

    as seen on Server Fault - Search for 'Server Fault'
    I'm currently running the latest version of MAMP on my Snow Leopard OSX, and I'm trying to install MySQLDB. Downloaded: MySQL-python-1.2.3c1 I went into the setup_posix.py and adjusted the location of the mysql_config to the one in MAMP: mysql_config.path = "/Applications/MAMP/Library/bin/mysql_config" When… >>> More

  • Building Awesome WM

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    Hello, I am following these steps in order to build Awesome window manager on 10.04 I am building 3.4 while the tutorial is for 3.1 I installed all of the specified dependencies including cairo. After running cd awesome-3.4 && make I get the following missing dependencies error: Running… >>> More

  • Building Awesome WM

    as seen on Server Fault - Search for 'Server Fault'
    Hello, I am following these steps in order to build Awesome window manager on 10.04 I am building 3.4 while the tutorial is for 3.1 I installed all of the specified dependencies including cairo. EDIT I ran: sudo apt-get install libxcb-xtest0-dev libxcb-property1-dev libxdg-basedir-dev libstartup-notification0-dev… >>> More

  • Building Awesome WM

    as seen on Super User - Search for 'Super User'
    Hello, I am following these steps in order to build Awesome window manager on 10.04 I am building 3.4 while the tutorial is for 3.1 I installed all of the specified dependencies including cairo. EDIT I ran: sudo apt-get install libxcb-xtest0-dev libxcb-property1-dev libxdg-basedir-dev libstartup-notification0-dev… >>> More