Archive | Database RSS feed for this section

Pagination in Hibernate Query API

July 26, 2008

1 Comment

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 [...]

email

Three ways to create query in Hibernate

July 26, 2008

12 Comments

Create Query in Hibernate To create query in the Hibernate ORM framework, there is three different types. The folloing are the three ways to create query instance: 1)session.createQuery() 2)session.createSQLQuery() 3)session.createCriteria() We will look into the details of each category in detail. session.createQuery() The method createQuery() creates Query object using the HQL syntax. Fro example session.createSQLQuery() [...]

How to use datasource in Hibernate application?

July 23, 2008

3 Comments

This article explains how to configure datasource in the JBoss application server and how to use the same datasource in the hibernate configuration file.Before looking into the hibernate configuration, we will start with creating datasource inside JBoss application server. Create MySql datasource in JBoss To create datasource for the MySql database inside the JBoss application [...]

Hibernate Criteria Query Example

July 23, 2008

4 Comments

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?

July 19, 2008

0 Comments

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

July 13, 2008

4 Comments

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. To use the [...]

Hibernate basic configuration example

July 13, 2008

5 Comments

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 [...]

Hibernate Vs EJB 3.0

April 10, 2008

0 Comments

Originally published in DeveloperIQ magazine What is CMP and BMP in EJB? So, why is it that Entity beans alone were found wanting and the specification keeps on changing? Entity beans are of two types. CMP & BMP. CMP stands for Container-Managed Persistence and BMP stands for Bean-managed persistence. Theoretically, the EJB specification does not [...]

Spring and Hibernate ORM Framework Integration

October 16, 2007

31 Comments

1) Introduction Hibernate is a powerful technology for persisting data in any kind of Application. Spring, on the other hand is a dependency injection framework that supports IOC. The beauty of Spring is that it can integrates well with most of the prevailing popular technologies. In this article, we will discuss on how it is [...]

What is Hibernate Caching?

October 2, 2007

10 Comments

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 [...]