title: hibernate HQL Query select
body: <p>i wanna transfer this code SQL to HQL
  i try this code but it dosn't work</p>
  
  <pre><code>public Admin connect(String login, String password)
  {
  SessionFactory sessionFactory =createSessionFactory();
  Session session = sessionFactory.getCurrentSession();
      session.beginTransaction();
    Admin admin=(Admin) session.createQuery(from admin where login_admin='"+login+"' and password_admin='"+password+"');
      session.getTransaction().commit();
  
      return admin;
  </code></pre>
  
  <p>my class</p>
  
  <pre><code>public class Admin extends personne implements java.io.Serializable {
  private String loginAdmin;
  private String passwordAdmin;}
  </code></pre>
  
  <p>sorry for my bad english</p>