This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate 1 Class - 2 Tables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate 1 Class - 2 Tables" Watch "Hibernate 1 Class - 2 Tables" New topic
Author

Hibernate 1 Class - 2 Tables

Ally Cavs
Ranch Hand

Joined: Aug 25, 2008
Posts: 89
Hi Guys

I am using the hibernate xml mapping files to map object to a DB table. I have a invoice class along with its xml mapping file. The invoice class maps to invoice table

But now I need to map to a second table. the reason is for authorization. So users would create an invoice. But instead of been created on the invoice table. I want the information persisted to a pre authorised invoice table.
Then a manager reviews invoices, authorises upon which the invoice is copied over to the invoice table for further processing and removed from the pre authorised table.

The only solutions i see is using joins but this essentially maps different attributes of the invoice object to different tables. These 2 tables need to be identical. There are reasons to why i simply cant add an additional field called authorize. I need the 2 tables

Thanks
Alan
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Hibernate 1 Class - 2 Tables
 
jQuery in Action, 3rd edition