Tenho uma função que pega um objeto da lista.
public Users getUser(Long id)
{
Session session = null;
try
{
session = SessionFactory.currentSession();
return (Users) session.load(Users.class, id);
}
catch (ObjectNotFoundException onfe)
{
return null;
}
catch (HibernateException e)
{
System.err.println("Hibernate Exception" + e.getMessage());
throw new RuntimeException(e);
}
}
Quando pego o parametro no Action, ele fala que não é aplicavel a esse tipo de argumento. Estou usando certo???
Esse Long é o mesmo long que esse?
public Users getUser(Long id)
long idUser = Long.parseLong(request.getParameter(“user”));
try {
user = ControlUsers.getInstance().getUser(idUser);
} catch (HibernateException e) {
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(
"error.user.notFound"));
throw new RuntimeException(e);
}
Obrigado.