title: Java service and hql queries - wavemaker 6.5
body: <p>Trying to figure out how to use wavemaker to run an hql query.
  I don't have much expirience with java but I would like to be able to write a query and run it via the java code.
  to do it, should I use the java service? If not, then how?</p>
  
  <p>I've seen this code:</p>
  
  <pre><code>import org.hibernate.Query;
  import org.hibernate.Session;
  import org.hibernate.Transaction;
  
  Session session = sessionFactory.openSession();
  Transaction tx = session.beginTransaction();
  
  Query query = session.createQuery("select and so on..");
  // set parameter values, e.g.
  // query.setString("name", "Matthias");
  List result = query.list();
  
  tx.commit();
  session.close();
  </code></pre>
  
  <p>Can someone explain the classes like session and transaction so I can understand the process?
  How do I display the result list and is it updated in my db?</p>