• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mapping two tables

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

i am new in hibernate.i want to map 2 classes..when i fetch value from one table(class) ,no problem.when i try two map 2 classes,i unable to fetch the data(innerjoin).so please anybody send some sample code to me.

i mean mapping classes...(how to map more than one class).

thanks & regards,
seetharaman
 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Seetharam,

You need to study this link:

http://www.hibernate.org/hib_docs/reference/en/html/mapping.html

There is an excellent example.
If still unsuccessful send you code along with description on my email id.
I will try to solve.
Regards.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Khushwinder Chahal ..i will do it..

thanks & regards,
seetharaman
 
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
Here's a sweet tutorial on mapping two classes to a single table with Hibernate:

Mapping Two Classes to One Table with Hibernate and JPA Tutorial

But I think you might be more interested in mapping associated classes. Here's how to map two classes associated in a one to one manner:

Mapping One to One Associated Classes with Hibernate and JPA

There are other tutorials that cover other type of associations as well.

Happy Hibernating!

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