[jboss-user] [EJB 3.0] - Re: error in your SQL syntax

waynebaylor do-not-reply at jboss.com
Mon Jun 11 09:26:49 EDT 2007


You can't use "normal" SQL in the createQuery method, you have to use JPA QL. 

So, try this:

List<User> users = em.createQuery("from "+User.class).getResultList();

You'll get a list of User objects and you can filter out the usernames from that.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4053097#4053097

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4053097



More information about the jboss-user mailing list