1 22 package org.jboss.ejb3.test.regression.scopedclassloader; 23 24 import javax.ejb.Stateless ; 25 import javax.persistence.PersistenceContext; 26 import javax.persistence.EntityManager; 27 28 34 @Stateless 35 public class StatelessBean implements StatelessRemote 36 { 37 @PersistenceContext EntityManager manager; 38 39 public ValueObject doit() 40 { 41 return new ValueObject("hello"); 42 } 43 44 public int createCustomer(Customer cust) 45 { 46 manager.persist(cust); 47 return cust.getId(); 48 } 49 50 public Customer findCustomer(int id) 51 { 52 return manager.find(Customer.class, id); 53 } 54 55 public void throwException() throws ScopedException 56 { 57 throw new ScopedException(); 58 } 59 } 60 | Popular Tags |