Hibernate Criteria Queries

Hibernate Criteria Queries

Hibernate Criteria Queries Hibernate interface org.hibernate.Criteria can be use to query against chosen persistent class to pull data from database and session word as factory for Criteria object. Below is criteria query sample:

Hibernate Named Query

Hibernate Named Query

Hibernate Named Query Hibernate named SQL queries can be defined in mapping file or as annotation and called in same way as named HQL query. Below are examples:

HQL Parameter binding

HQL Parameter binding

HQL Parameter binding Hibernate query language flexible enough to fit all development needs to execute SQL query to get data from table. It supports almost all approach which developer can think of. Below are different approach which HQL supports: Supports … Continue reading

HQL Delete Query hibernate

HQL Delete Query hibernate

HQL Delete Query hibernate You could use HQL to delete data form the table and its almost same as native SQL query except in place on table and column name you have to use class name and its attribute name.

HQL insert Query hibernate

HQL insert Query hibernate

HQL insert Query hibernate You can insert data to the table using HQL unfortunately it does not work as SQL where we could directly insert data using below sample SQL query: