*
The moose likes Object Relational Mapping and the fly likes Hibernate Join(ORM) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Join(ORM)" Watch "Hibernate Join(ORM)" New topic
Author

Hibernate Join(ORM)

Kalpesh K Rawal
Greenhorn

Joined: Nov 23, 2005
Posts: 4
Can i map 2 tables in a singel class?if not then how can achive it?
Vikram Takkar
Greenhorn

Joined: Oct 27, 2005
Posts: 12
i dont think that you can map 2 tables in single class ... you can map one table in one class and you can have more than one class mapping in one file but its not the good programming practice.. you should implement class-per-file mechanism....

i m giving this reply up to my knowledge ..this may b correct or may not be..


Vikram Takkar<br />Programmer
Naveen Mishra
Ranch Hand

Joined: Nov 20, 2005
Posts: 75
U can certainly do it man !!!

just go through the following link...


http://www.gloegl.de/blog/archives/hibernate-hql-and-outer-join-fetching/
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

If you are using Hibernate3 then you can. Naveen Mishra's example doesn't map two tables to one class (though it does return data from two tables via HQL) - if you want the same behaviour via a mapping read the Hibernate documentation about the <join /> element.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate Join(ORM)
 
Similar Threads
Can the color for the disabled item be changed
WA #1.....word association
Private methods
URGENT - NEED HELP - Block Code
error in Marcus Green 2.