Pradeep's Blog

Google

Monday, March 27, 2006

How to use Hibernate

As mentioned in my earlier blog hibernate is used to persist data stored in the objects into a data base. For this to happen there are three things that are needed. One a java data classes (whose object’s properties we want to persist).Two an xml file mapping this class to the respective table, and also the properties of the class into appropriate classes. This file tells Hibernate how & which data to store. The third thing that we need is an xml file that configures Hibernate. The purpose of this file is to tell Hibernate what database it has to use, mapping file information, and other defaults.

Once these three are ready, we can use another class to populate the data, then hibernate can be used to in synchronise the object’s properties into their mapped columns in the database.

0 Comments:

Post a Comment

<< Home