1 package org.jboss.tutorial.extended.bean; 2 3 import javax.ejb.Local ; 4 import javax.ejb.Remote ; 5 import javax.ejb.Stateless ; 6 import javax.persistence.EntityManager; 7 import javax.persistence.PersistenceContext; 8 9 14 @Stateless 15 @Remote (StatelessRemote.class) 16 @Local (StatelessLocal.class) 17 public class StatelessSessionBean implements StatelessLocal, StatelessRemote 18 { 19 @PersistenceContext EntityManager em; 20 21 public void update(Customer c) 22 { 23 c.setName("Bill Jr."); 24 } 25 26 public Customer find(long id) 27 { 28 System.out.println("*** Stateless find"); 29 return em.find(Customer.class, id); 30 } 31 } 32 | Popular Tags |