This content has been marked as final.
Show 1 reply
-
1. Re: Query that selects all rows.
cocampo Oct 13, 2006 1:26 PM (in response to jimjamz)First, take a look at this code:
@Stateful @Scope(SESSION) @Name("messageManager") public class MessageManagerBean implements Serializable, MessageManager { @DataModel private List<Message> messageList; @DataModelSelection @Out(required=false) private Message message; @PersistenceContext(type=EXTENDED) private EntityManager em; @Factory("messageList") public void findMessages() { messageList = em.createQuery("from Message msg order by msg.datetime desc").getResultList(); }
As you may see near the end, there is an invocation to the getResultList method, which gives you the list you're looking for.
Second, next time you have a question like this, please take a look at the manual, since this code is in Chapter 1!!!. If you keep asking things like this you will be soon ignored (maybe ppl is already ignoring you).
Please, take your time to read the manual, which is very well documented, read the Wikis (Getting Started, FAQ's, etc.), study the examples, and ONLY THEN come and post your questions (after searching for existing answers to the same problem, of course ;)).
Regards.