Hibernate – An Introduction

Hibernate:

  • Hibernate is an open source object/relational mapping tool for Java.
  • It take care of handling Java objects to Database Objects.
  • Hibernate not only takes care of the mapping from Java classes to database tables (and from Java data types to SQL data types), but also provides data query and retrieval facilities and can significantly reduce development time otherwise spent with manual data handling in SQL and JDBC.
  • Hibernates goal is to relieve the developer from 95 percent of common data persistence related programming tasks like insert,select,update,delete operation queries.

Features:

    1. It’s an Powerful object-oriented query language
    2. Native SQL queries.
    3. Support new Criteria queries
    4. Transparent persistence without byte code processing.
    5. Automatic primary key generation
    6. High performance
        • Highly scalable architecture.
        • No “special” database tables.
        • SQL generated at system initialization time.(Optional) Internal connection pooling and PreparedStatement caching
    7. Object / Relational mappings

Three different O/R mapping strategies

        • Multiple-objects to single-row mapping.
        • Polymorphic associations.
        • Bidirectional associations.

Process:

      1. Connection Managment.[Connecting Database]
      2. Transaction Management.[Ability to execute more than one DB statemets]
      3. Object Relational Mapping.[]

Overview:

    1. Hibernate makes use of persistent objects commonly called as POJO (POJO = “Plain Old Java Object”.) along with XML mapping documents for persisting objects to the database layer.
    2. The term POJO refers to a normal Java objects that does not serve any other special role or implement any special interfaces of any of the Java frameworks (EJB, JDBC, DAO, JDO, etc…).
    3. Rather than utilize byte code processing or code generation, Hibernate uses runtime reflection to determine the persistent properties of a class.[reflection is the process by which a computer program can observe (do type introspection) and modify its own structure and behavior at runtime]
    4. The mapping documents are compiled at application startup time and provide the framework with necessary information for a class. Additionally, they are used in support operations, such as generating the database schema or creating stub Java source files. More Info – http://www.allapplabs.com/hibernate/getting_started_with_hibernate_creating_pojo.htm       
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s