wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Mapping two tables to one persistent class in hibernate
 
Similar Threads
spring : bind path=" "
Extra column created
One java class & Two tables Hibernate
How to persist an object in Hibernate
Hibernate Join(ORM)