Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public HashEntity getAccountByUsername(String username){
- Session session=HibernateUtil.getSessionFactory().openSession();
- session.beginTransaction();
- Query query= session.createQuery("from HashEntity where username=:username");
- query.setString("username", username);
- HashEntity accountEntity= (HashEntity) query.uniqueResult();
- session.getTransaction().commit();
- session.close();
- return accountEntity;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement