Java
  Home arrow Java arrow Hibernate: Understanding Associations
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  
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

Hibernate: Understanding Associations
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 24
    2005-12-27

    Table of Contents:
  • Hibernate: Understanding Associations
  • States: The Life-Cycle of a Persistent Object
  • Associations: What are They?
  • Associations 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


    Hibernate: Understanding Associations


    (Page 1 of 4 )

    This article, the third in our series on Hibernate, focuses on the life-cycle states of persistent objects and associations. These concepts are put to work with continued development of an application that was created in the first two articles of this series.

    Relationships between entities form the crux of the relational approach. This must be well reflected by an ORM framework. In the world of the object-oriented approach, relations between objects are represented by associations. So the task of any ORM framework is to create a mapping between the relationships and the associations. This mapping is known as an association. The term is the same as that of the object oriented approach.

    But before going into the depths of associations and how they affect queries, one must understand the life-cycle of the persistent object. This is necessary because queries depend on the current state of the object. Most of the logical errors occur due to operations tried on the persistent objects without keeping their current state in mind. In short, most of the "gotchas" in Hibernate can be corollated with the developer overlooking the state. 

    Hence this discussion will focus on both the life-cycle states of persistent objects and associations. The first section will deal with the life-cycle of the persistent object. In the second section I will discuss associations. The third section will put the concepts to work, as I will extend the application which was being developed during previous parts to include one more table with a many to one relationship with the order table. Now that the agenda has been disclosed, l will get right into the topic.

    More Java Articles
    More By A.P.Rajshekhar


       · A relational database design without relationhips is difficult to design and...
     

    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 2 hosted by Hostway
    Stay green...Green IT