Types of Hibernate Query API's

Hibernate provides three different ways to retrieve data: 
  • The Criteria API: The Criteria interface allows to create and execute object-oriented queries. It is powerful alternative to the HQL but has own limitations. Criteria Query is used mostly in case of multi criteria search screens, where HQL is not very effective. 
  • The Hibernate Query LanguageHQL is an object-oriented query language.Syntax has similarities to SQL. Not working against tables and columns, but objects
  • Native SQL QueriesNative SQL is handwritten SQL for all database operations like create, update, delete and select. Hibernate Native Query also supports stored procedures. Hibernate allows you to run Native SQL Query for all the database operations, so you can use your existing handwritten sql with Hibernate, this also helps you in migrating your SQL/JDBC based application to Hibernate. 

Search:

Recent Posts