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