Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public HashEntity getAccountByUsername(String username){
  2. Session session=HibernateUtil.getSessionFactory().openSession();
  3. session.beginTransaction();
  4. Query query= session.createQuery("from HashEntity where username=:username");
  5. query.setString("username", username);
  6. HashEntity accountEntity= (HashEntity) query.uniqueResult();
  7. session.getTransaction().commit();
  8. session.close();
  9. return accountEntity;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement