title: Java Hibernate HQL to Hibernate Criteria
body: <p>I have a class that uses Hibernate HQL queries. I would like to change these into Hibernate Criteria queries.
  However, Hibernate Criteria is a lot harder for me to understand than HQL, even with tutorials. Could someone show me how one of the queries would look like using Hibernate Criteria/Filters?</p>
  
  <pre><code>Configuration configuration = new Configuration();
          configuration.configure().setProperty("hibernate.show_sql", "false");
  ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings(
                                    configuration.getProperties()).buildServiceRegistry();
  SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(serviceRegistry);
  
  Session session =sessionFactory.openSession();
  Transaction tx = session.beginTransaction();
  Query query = session.createQuery("from TABLENAME WHERE IDObject1= :idObjectA" +
                "AND IDObject2= :idObjectB AND IDSettingOption = :idSettingOption");
  query.setParameter("idObjectA", idObjectB);
  query.setParameter("idObjectB", idObjectB);
  query.setParameter("idSettingOption", idSettingOption);
  
  List results = query.list();
  </code></pre>
  
  <p>Thanks in advance!</p>