The Object Relational Mapping (ORM) is a technique that maps the data represented in object
type into relational model with a database schema. The Hibernate is an open source ORM tool
for Java; it maps Java Objects into database objects such as tables. Hibernate also provides
powerful querying tool that does the reverse process, converting database objects into Java objects.
It simplifies the database interactions very much; otherwise the developers have to write complex
JDBC statements. It is object oriented so that the developers can enjoy the features of Object
Oriented Programming System (OOPS) features in handling data on any database.
Hibernate provides transparent persistence and Object-Oriented Query Language which is
independent of any database. Hibernate supports native SQL queries as well.
The Chapter 1 (Getting Ready) make you get ready to work with Hibernate. It explains the
installation procedure of Hibernate and other required supporting software tools such Java,
Database, and Integrated Development Environment (IDE). This chapter introduces you the need
of Hibernate and its architecture. It describes how to download and install supporting software
components to work with Hibernate programs. The database MySQL is used for database
interaction examples. However, the users may use other RDBMS databases, with minor changes
in programs. The procedure for other databases is also given in this chapter. Like this, the user
is not compelled to use only Tomcat as Application server and Eclipse as Java IDE.
The Chapter 2 (Persisting Student Data with Hibernate: Demo) demonstrates a complete
working example with Hibernate. It explains how to insert one record of Student information into
database table using Hibernate. Based on this example, this chapter explains briefly about the
configuration details and required setups to work with Hibernate such as Creating database user,
Creating Java Project in Eclipse, Setting up the required Hibernate and other library files with
Eclipse, and Defining Hibernate configurations. The configurations are to be followed for examples
shown in other chapters. The Hibernate API used this chapter are not explained in this chapter
itself, but explained in the next chapters in detail.
The Chapter 3 (Hibernate Session) introduces working with Hibernate Sessions. All data
definition and manipulation should be done in Hibernate through Session. Any object should be
present in the Session before it is interacted with database. The Hibernate Session Factory acts
a database connection pool and Hibernate Session acts a Connection, if it is compared with JDBC.
The Hibernate Session Factory is used to provide Hibernate Session(s), which are used to do
relational mappings of objects such as definition and manipulation of data with database.