Home arrow Java arrow Hibernate: Understanding Associations
JAVA

Hibernate: Understanding Associations


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.

Author Info:
By: A.P.Rajshekhar
Rating: 5 stars5 stars5 stars5 stars5 stars / 60
December 27, 2005
TABLE OF CONTENTS:
  1. · Hibernate: Understanding Associations
  2. · States: The Life-Cycle of a Persistent Object
  3. · Associations: What are They?
  4. · Associations in the Real World

print this article
SEARCH DEVARTICLES

Hibernate: Understanding Associations
(Page 1 of 4 )

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.


blog comments powered by Disqus
JAVA ARTICLES

- Java Too Insecure, Says Microsoft Researcher
- Google Beats Oracle in Java Ruling
- 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 ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials