permaculture playing cards*
The moose likes Object Relational Mapping and the fly likes Mapping two tables to one persistent class in hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Mapping two tables to one persistent class in hibernate" Watch "Mapping two tables to one persistent class in hibernate" New topic
Author

Mapping two tables to one persistent class in hibernate

Raj Kumar Bindal
Ranch Hand

Joined: Apr 15, 2006
Posts: 417
Can we map two tables with one persistent class in hibernate?

If yes, please let me know how can we do that.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Something like this:


You end up with a class mapped like this:



Here's a little tutorial on the topic:

Mapping One Class to Two Tables

-Cameron McKenzie

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mapping two tables to one persistent class in hibernate
 
Similar Threads
Extra column created
One java class & Two tables Hibernate
How to persist an object in Hibernate
spring : bind path=" "
Hibernate Join(ORM)