Skip to content

Instantly share code, notes, and snippets.

@akleandrov
Created September 1, 2016 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akleandrov/6a4382bf79b6ca09d2a129a6116c5517 to your computer and use it in GitHub Desktop.
Save akleandrov/6a4382bf79b6ca09d2a129a6116c5517 to your computer and use it in GitHub Desktop.
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();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment