1 22 package org.jboss.test.hibernate.ejb; 23 24 import org.jboss.test.hibernate.model.User; 25 import org.jboss.test.hibernate.ProfileService; 26 27 import javax.ejb.SessionBean ; 28 import javax.ejb.EJBException ; 29 import javax.ejb.SessionContext ; 30 import java.rmi.RemoteException ; 31 import java.util.List ; 32 33 import org.hibernate.HibernateException; 34 35 47 public class ProfileBean implements SessionBean 48 { 49 private ProfileService delegate = new ProfileService(); 50 51 55 public User storeUser(User user) throws EJBException 56 { 57 try 58 { 59 return delegate.storeUser(user); 60 } 61 catch(HibernateException e) 62 { 63 throw new EJBException ("Error performing store", e); 64 } 65 } 66 67 71 public User loadUser(long id) throws EJBException 72 { 73 try 74 { 75 return delegate.loadUser(id); 76 } 77 catch(HibernateException e) 78 { 79 throw new EJBException ("Error performing load", e); 80 } 81 } 82 83 87 public User loadUser(Long id) throws EJBException 88 { 89 try 90 { 91 return delegate.loadUser(id); 92 } 93 catch(HibernateException e) 94 { 95 throw new EJBException ("Error performing load", e); 96 } 97 } 98 99 103 public List listUsers() throws EJBException 104 { 105 try 106 { 107 return delegate.listUsers(); 108 } 109 catch(HibernateException e) 110 { 111 throw new EJBException ("Error performing list", e); 112 } 113 } 114 115 118 public void ejbCreate() 119 { 120 } 121 122 public void ejbActivate() throws EJBException , RemoteException 123 { 124 } 125 126 public void ejbPassivate() throws EJBException , RemoteException 127 { 128 } 129 130 public void ejbRemove() throws EJBException , RemoteException 131 { 132 } 133 134 public void setSessionContext(SessionContext ctx) throws EJBException , RemoteException 135 { 136 } 137 } 138 | Popular Tags |