1 22 package org.jboss.ejb3.test.secondary; 23 24 25 import javax.ejb.Remote ; 26 import javax.ejb.Stateless ; 27 import javax.persistence.EntityManager; 28 import javax.persistence.PersistenceContext; 29 import javax.persistence.PersistenceContext; 30 import javax.persistence.PersistenceContext; 31 32 38 @Stateless 39 @Remote (EntityTest.class) 40 public class EntityTestBean implements EntityTest 41 { 42 @PersistenceContext 43 private EntityManager manager; 44 45 public Customer createCustomer() 46 { 47 Customer c = new Customer(); 48 c.setName("Bill"); 49 c.setStreet("Landsdown Street"); 50 c.setCity("Boston"); 51 c.setState("MA"); 52 c.setZip("02114"); 53 manager.persist(c); 54 return c; 55 } 56 57 public Customer findByCustomerId(Long id) 58 { 59 return manager.find(Customer.class, id); 60 } 61 } 62 | Popular Tags |