File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 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

 
 
subject: Mapping two tables to one persistent class in hibernate