Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean existe(Pessoa pessoa) {
- TypedQuery<Pessoa> query = em
- .createQuery(
- "select u from Usuario u where u.NomeUsuario = :pUsuario and u.SenhaUsuario = :pSenha",
- Pessoa.class);
- query.setParameter("pUsuario", pessoa.getNomeUsuario());
- query.setParameter("pSenha", pessoa.getSenhaUsuario());
- try {
- Pessoa resultado = query.getSingleResult();
- } catch (NoResultException ex) {
- return false;
- }
- em.close();
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment