That's a really nice solution. It's unfortunate that something similar isn't included in the Java EE standard.
I currently do not use a lot of named queries anyway because the limitations of the api forces me to generate many query strings dynamically. There is a lot of improvements to be done in this area.
[Message sent by forum member 'woel' (woel)]
http://forums.java.net/jive/thread.jspa?messageID=243087