How to use named parameters and named query in Hibernate?

hibernate-thumbnail

Named Parameters in Hibernate Query There is two types of query parameters binding in the Hibernate Query. One is positioned parameter and another one is named parameter. But, hibernate recommend to use the named parameters since it is more flexible and powerful compare to the positioned parameter. Here we will look into the named parameter […]

Pagination in Hibernate Query API

hibernate-thumbnail

Pagination in Hibernate Query API Pagination is the very common problem for the most of the eneterprise applications.When we are retrieving thousands of records from the database, it is not good idea to retrieve all the records at the same time. So, we have to implement some sort of pagination concept in your application to […]

Three ways to create query in Hibernate

hibernate-thumbnail

Create Query in Hibernate To create query in the Hibernate ORM framework, there is three different types. The following are the three ways to create query instance: session.createQuery() session.createSQLQuery() session.createCriteria() We will look into the details of each category in detail. also read: Introduction to Hibernate Hibernate Interview Questions Interceptors in Hibernate Hibernate Books session.createQuery() […]

Hibernate Criteria Query API / HQL Example

hibernate-thumbnail

Hibernate Criteria Example Criteria APIs in the hibernate framework is useful for creating the dynamic query to execute.It is an alternative way to write the queries without using HQL. The queries are generated at runtime and excuted on the fly. Application developer need not worry about writing the query in hand, he/she just need to […]

How to Configure hibernate using XML files?

hibernate-thumbnail

Hibernate Configuration Using XML files for configuring hibernate application is the most widely used approach. This is simple one and less whanges needed in the future. There is two types of configuration we can do using XML files. one is non-managed environment and another one is for managed environment. Here we will explain about the […]

Batch insert in Hibernate

hibernate-thumbnail

This example program shows how to insert multiple rows using the batch processing in hibernate. when there are thousand of rows to be persisted, everytime iterating and inserting will cause the memory problem. Hibernate stores all the persisted objects in the memory. To avoid this problem use batch processing in the hibernate. also read: Introduction […]

Hibernate basic configuration example

hibernate-thumbnail

Hibernate Configuration This example demonstrates how to configure hibernate framework for running a simple standalone program. Here the sample program uses programmatic configuration to set all the properties required for running hibernate. Also the example uses derby as the database to connect and update the values. This is not the big change, you only have […]

What is Hibernate Caching?

hibernate_orm

1. Introduction While working with Hibernate web applications we will face so many problems in its performance due to database traffic. That to when the database traffic is very heavy . Actually hibernate is well used just because of its high performance only. So some techniques are necessary to maintain its performance. Hibernate Caching is […]

Interceptors in Hibernate Framework

hibernate-thumbnail

1) Introduction This article deals with Hibernate Interceptors. Hibernate is an open-source project that provides ORM solution. For more information about Hibernate, novice readers are encouraged to read the article An Introduction to Hibernate on javabeat before reading this article. Situations may demand to perform some set of pre-requisite/post-requisite operations before/after the core functional logic. […]

What is hibernate framework?

hibernate-thumbnail

1) Introduction Persistent data can be seen anywhere in an application. Managing persistent data is one of the few challenges that modern technologies/products are facing. A solution called Object-Relational Mapping (ORM) has gained major popularity over the past few years. ORM is a piece of software/product for the representation and conversion of data between the […]