참조 :
http://openframework.or.kr/JSPWiki/Wiki.jsp?page=Javacanhibernate7
http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Session.html

1. HQL 사용하기.

 Query

createQuery(String queryString)
          Create a new instance of
Query for the given HQL query string.

 

2. Criteria API 사용하기.

 Criteria

createCriteria(Class persistentClass)
          Create a new
Criteria instance, for the given entity class, or a superclass of an entity class.

 Criteria

createCriteria(Class persistentClass, String alias)
          Create a new
Criteria instance, for the given entity class, or a superclass of an entity class, with the given alias.

 Criteria

createCriteria(String entityName)
          Create a new
Criteria instance, for the given entity name.

 Criteria

createCriteria(String entityName, String alias)
          Create a new
Criteria instance, for the given entity name, with the given alias.

 

3. 그냥 SQL 문 날리기.

 SQLQuery

createSQLQuery(String queryString)
          Create a new instance of
SQLQuery for the given SQL query string.