• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Associations

 
Ramachandra Reddy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what are uni & bi direcitonal associations?
how we can configure in hbm files?
Can any give full examples or link for all the the associations?
Thanks in advance
[ April 30, 2008: Message edited by: RAMACHANDRA REDDY ]
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, if a Team has Players, and the team can tell you its players, but players can't tell you what team they are on, then we can say the relationship is uni-directional.

If both the team could tell you it's players, and the players could also tell you the teams we're on, we'd call it a bi-directional relationship.

In Java code, this is implemented simply through setter and getters. At the database level, it can be foreign keys or join tables.

There are many mapping types that exists, to show each one would require a book. My signature links will take you to a site that shows you a variety of mappings with Hibernate, including one-to-one, one-to-many, many-to-many and even inheritance mapping from Java classes to the database.

Good luck!

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic