Clouds
Home

Hibernate 2.0 Introduction

Hibernate Mapping Declaration

Hibernate Development Code

Hibernate Generator

Inheritence Mapping

Hibernate Tutorial


Object Relational Mapping

  • Object-relational mapping is used to map object-oriented programming objects to relational databases managed by Oracle, DB2, Sybase, and other relational database managers
  • Object-relational mapping is the process of transforming between object and relational databases.

Introduction To Hibernate

  • Hibernate is java-based middleware designed to complete the Object Relational mapping (ORM).
  • Hibernate is a free, open source Java package that makes it easy to work with relational databases.
  • Hibernate provides a solution to map database tables to a class.
  • It copies the database data to a class. In the other direction it supports to save objects to the database. In this process the object is transformed to one or more tables.

Hibernate Architecture

Hibernate Interfaces

Session Factory

The SessionFactory configures hibernate for application using supplied configuration file (hibernate.properties or hibernate.cfg.xml) and allows for session object to be instantiated.

Hibernate Session

When the session object is instantiated, a connection is made to the database.

Transaction

The Transaction interface lets you make insure that any error occurs between the start and end of the transaction will cause all the transaction fail.

Query

The Query interface lets you query the database for objects.

Hibernate Development Environment

Install jar files as hierarchy given below

+projectapp
    +lib
      antlr.jar
      cglib.jar
      asm.jar
      asm-attrs.jars
      commons-collections.jar
      commons-logging.jar
      hibernate2.jar
      jta.jar
      dom4j.jar
      log4j.jar

Hibernate Application Example

Project hierarchy
    +lib
    +src
      +persist (Object to be persist)
        User.java
        User.hbm.xml
      +util
        HibernateUtil.java
        hibernate.properties
        PersistUserToDatabase.java


NEXT: Hibernate Mapping Declaration >>>>


Home Clouds