users@glassfish.java.net

Re: Named Query design thoughts

From: <glassfish_at_javadesktop.org>
Date: Wed, 31 Oct 2007 00:58:15 PST

I suffered from this also, and took some idea from JDBC 4.0 to create a nice dynamic proxy that can execute named queries from an interface definition only.
Check it here: http://freddy33.blogspot.com/2007/07/jpa-namedqueries-and-jdbc-40.html

What I will like to have is to actually define the named query on the interface directly like:

public interface MyBeanQueries {
@Query("select o from MyBean o where o.desc = :desc)
public Collection<MyBean> getFromDescription(String desc);
}

I'm almost there. Working on APT to do it.
[Message sent by forum member 'freddy33' (freddy33)]

http://forums.java.net/jive/thread.jspa?messageID=243070