aspose file tools*
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
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: 418
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

 
jQuery in Action, 2nd edition
 
subject: Mapping two tables to one persistent class in hibernate