package org.jboss.test.hibernate.ejb;
import org.jboss.test.hibernate.model.User;
import org.jboss.test.hibernate.ProfileService;
import javax.ejb.SessionBean;
import javax.ejb.EJBException;
import javax.ejb.SessionContext;
import java.rmi.RemoteException;
import java.util.List;
import org.hibernate.HibernateException;
public class ProfileBean implements SessionBean
{
private ProfileService delegate = new ProfileService();
public User storeUser(User user) throws EJBException
{
try
{
return delegate.storeUser(user);
}
catch(HibernateException e)
{
throw new EJBException("Error performing store", e);
}
}
public User loadUser(long id) throws EJBException
{
try
{
return delegate.loadUser(id);
}
catch(HibernateException e)
{
throw new EJBException("Error performing load", e);
}
}
public User loadUser(Long id) throws EJBException
{
try
{
return delegate.loadUser(id);
}
catch(HibernateException e)
{
throw new EJBException("Error performing load", e);
}
}
public List listUsers() throws EJBException
{
try
{
return delegate.listUsers();
}
catch(HibernateException e)
{
throw new EJBException("Error performing list", e);
}
}
public void ejbCreate()
{
}
public void ejbActivate() throws EJBException, RemoteException
{
}
public void ejbPassivate() throws EJBException, RemoteException
{
}
public void ejbRemove() throws EJBException, RemoteException
{
}
public void setSessionContext(SessionContext ctx) throws EJBException, RemoteException
{
}
}