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 [...]
Archive | July, 2008
Three ways to create query in Hibernate
July 26, 2008
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 Initialization callback methods while creating Spring bean?
July 24, 2008
Initialization callback methods Springframework provides flexibility to initialize its Beans using the user defined methods. There is some scenario where application developer want to initialize the beans properties after setting all the values. The following example program demonstrates by defining a custom method to initialize the calues. Spring’s managed bean has to implement InitializingBean from [...]
StringBuilder class in Java 5.0
July 24, 2008
java.lang.StringBuilder StringBuilder class is introduced in Java 5.0 version. This class is replacement for the existing StringBuffer class. If you look into the operations of the both the classes, there is no difference. If you are using StringBuilder, no guarantee of synchronization. This is the only difference with StringBuffer class. It is recommended that this [...]
Writing simple ANT build script
July 24, 2008
Apache Ant Example This article explains how to write a very basic ANT build script. This does not explain indepth knowledge on building your project using ANT script. But, this writeup will be more useful for the beginners who haben’t writen any ANT script before. Before start writing the script, lets look into how to [...]
Implement Internationalization and Localization in JSF
July 24, 2008
Internationalization and Localization Internationalization and Localization are important features for an web based application. Internationalization is implementing the features in your application to support multiple languages. Localization is creating text in a specific language that is presented through an internationalized application The following example program demonstrates very simple program for implementing this concepts. if you [...]
Chain Of Responsibility Pattern In Java
July 24, 2008
Chain Of Responsibility Pattern Overview: A method called in one class will move up a class hierarchy until a method is found that can properly handle the call.It consists of a source of command objects and a series of processing objects.Each processing object contains a set of logic that describes the types of command objects [...]
EJB 3.0 and WebServices
July 24, 2008
This article discusses how an enterprise bean can act as a Web-Service component. Since Web-Services itself is a vast technology, the first part of the article discusses more about Web-Services. Specifically, the first part of the article discusses what Web-Services are, its unique features among other related technologies, its architecture, and the various base components [...]
Comparing Objects in Java
July 24, 2008
Comparing Objects in Java In Java comparing two value object is not straight forward. Here we will see how we can compare two value objects in Java. For that first we will create a value object called “MyValueObject”. This value object contains two properties. 1) firstName 2) lastName. Both the properties are of type string. [...]
How to use datasource in Hibernate application?
July 23, 2008
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 [...]






July 26, 2008
1 Comment