KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > extended > bean > StatelessSessionBean


1 package org.jboss.tutorial.extended.bean;
2
3 import javax.ejb.Local JavaDoc;
4 import javax.ejb.Remote JavaDoc;
5 import javax.ejb.Stateless JavaDoc;
6 import javax.persistence.EntityManager;
7 import javax.persistence.PersistenceContext;
8
9 /**
10  * comment
11  *
12  * @author <a HREF="mailto:bill@jboss.org">Bill Burke</a>
13  */

14 @Stateless JavaDoc
15 @Remote JavaDoc(StatelessRemote.class)
16 @Local JavaDoc(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