Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexey Kleandrov akleandrov

  • Russia,Saint-Petersburg
View GitHub Profile
View Profile.java
public static String GetEmail(String login)
{
Session session = HibernateSessionFactory.getSessionFactory().openSession();
session.beginTransaction();
Query query = session.createNativeQuery("select * from target_persons where login= ?1", TargetPersonsEntity.class);
TargetPersonsEntity target = (TargetPersonsEntity) query.getSingleResult();
return target.getEmail();
}