This sample works. Maybe you can see (try) what is different with your 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("select msg from Message msg order by
msg.datetime desc").getResultList();
|
| }
|
|
|
| public void select()
|
| {
|
| if (message!=null) message.setRead(true);
|
| }
|
|
|
| public void delete()
|
| {
|
| if (message!=null)
|
| {
|
| messageList.remove(message);
|
| em.remove(message);
|
| message=null;
|
| }
|
| }
|
|
|
| @Remove @Destroy
|
| public void destroy() {}
|
|
|
| }
|
|
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033363#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...