You update not with the persist method but with the merge method:

So you can do


  | @Name("customerAction")
  | @Scope(<PUT SCOPE HERE>)
  | @Stateful
  | public class CustomerAction {
  | 
  | 
  |     @PersistenceContext(....);
  |     private EntityManager em;
  | 
  |     @DataModel
  |     private List<Customers> customers;
  |     
  |     @DataModelSelection 
  |     private Customers customer;
  |     
  |     @Factory("customers")      
  |     public void find()
  |     {
  |             
  |                     customers = em.createQuery("select c"+
  |                                                                     "from 
Customers c " +
  |                                                                     "where 
c.userId = :userId")
  |                                                                     
.setParameter("userId", user.getUserId())
  |                                                                     
.getResultList();
  |             
  |     }       
  | 
  |     public void update() {
  | 
  |               em.merge(customer)
  |     }
  | }
  | 
  | 
  | 



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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4092178
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to