Java
  Home arrow Java arrow Page 2 - Introducing Hibernate
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Introducing Hibernate
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 25
    2005-12-06

    Table of Contents:
  • Introducing Hibernate
  • Object Relational Mapping: What is it?
  • Getting Started With Hibernate
  • Hibernate in the Real World

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Introducing Hibernate - Object Relational Mapping: What is it?


    (Page 2 of 4 )

    The process of transformation from a relational approach to an object oriented approach is known as Object Relational Mapping or ORM for short. By the definition it is clear that to understand ORM, the concepts of both relational and object approaches must be understood. So let’s take a look at them. When the context of discussion is the object oriented approach, the following terms always reappear:

    1. Identity
    2. State
    3. Behavior
    4. Type
    5. Association
    6. Class
    7. Encapsulation
    8. Inheritance

    Of these, the last three (class, encapsulation, and inheritance) are well known concepts. So I will be focusing on the first five.

    1. Identity:

    Identity distinguishes an object from all other objects of similar Type. Every object at the time of creation receives an identity. It is the identity that differentiates an object from an Abstract Data Type (ADT).

    2. State:

    The state of an object is the value contained by the object. In other words, the state is the current value associated with the Identity. An object can go through various states throughout its lifetime. The state of an object can only be made visible by examining the behavior of the object.

    3. Behavior:

        The behavior of an object consists of:

        a. The set of operations or methods that an object provides; this is also called Interface.

        b.  The responses the operation provide to the caller; this is also known as messages.

        c. The changes these operations make to the object.

    All of the communication with the object must be done through the interface. The state of an object can be inspected by means of the effects on the behavior. In other words, the returned values of operations and the aftereffects of these operations provide insight into the behavior of the object, which in turn tells us the state of the object.

    4. Type:

    Objects can support interfaces having different specifications. These specifications form the Type of the Interface, which is implemented by the object. Different objects can be of the same type, and such objects can be interacted with through the same Interface. An object can implement multiple Types.

    5. Association:

     An object of one type can be linked with object of another type. This link is known as an Association. Association helps in traversing other objects linked with an object.

    Next, you need to understand is the terms used regularly among the wise ones of the relational world. These terms are:

    1. Relation
    2. Attribute
    3. Domain
    4. Tuple

    Though these terms are from the mathematics world, they are more used in database terminology. Let's examine each of them.

    1. Relation:

    This is a truth statement. In essence, a relation defines all of the attributes involved in a predicate. The meaning of the predicate is defined by it. For example, the following relation means that there exists a Person with Social Security No SSN# and whose name is full_name:

    Person: {SSN#, full_name}

    The other term for relation is table.

    2. Attribute:

    The name that participates in a relation is identified by an attribute. It also specifies the domain from which the values must come. In other words, an attribute of a relationship specifies the name and the valid values that it can contain. For example:

    Person: {SSN#:SSN, full_name:STRING}

    specifies that SSN# is of type SSN and the name is SSN#. The well known term for attribute is column.

    3. Domain:

    It has already been said about domain that it represents the type of values that an attribute can have. Simply put, the domain is the data type. The purpose of the domain is to provide data abstraction. That is, it specifies the possible values of data and the operations upon them. For example in full_name: STRING STRING is the Domain.

    4. Tuple:

    Like relation, a tuple is a truth statement. The only difference is that tuple is a truth statement with respect to a Relation. It has attribute values matching the attributes in the relation and states the condition that is known to be true. Following is a tuple:

    <Person SSN#=”123-55-6547” Name=”John Doe”>

    Now that the terminology of both object oriented and relational approaches have been introduced, it's time to introduce the framework that provides mapping between the approaches -- the Hibernate framework.

    More Java Articles
    More By A.P.Rajshekhar


       · HiWorking with databases is a complex thing if not hard. That is where ORM...
       · simple and easy. Nice work. thanks for the tutorial.
       · Hi Rajashekar, This is very good article about the Hibernate Frame work for me as...
     

    JAVA ARTICLES

    - Deploying Multiple Java Applets as One
    - Deploying Java Applets
    - Understanding Deployment Frameworks
    - Database Programming in Java Using JDBC
    - Extension Interfaces and SAX
    - Entities, Handlers and SAX
    - Advanced SAX
    - Conversions and Java Print Streams
    - Formatters and Java Print Streams
    - Java Print Streams
    - Wildcards, Arrays, and Generics in Java
    - Wildcards and Generic Methods in Java
    - Finishing the Project: Java Web Development ...
    - Generics and Limitations in Java
    - Getting Started with Java Web Development in...







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway