users@glassfish.java.net

Re: Load entities with CreateNativeQuery

From: <glassfish_at_javadesktop.org>
Date: Sat, 19 May 2007 04:23:32 PDT

As said above, you don't need the object(user) bit, but you can also do

List<User> u=em.createNativeQuery ("select * from Users where xxx", User.class).getResultList();

otherwise i will return a list of arrays with each array containing the separate field values which isn't what you want..
[Message sent by forum member 'jsl123' (jsl123)]

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