Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate 1 Class - 2 Tables

 
Ally Cavs
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic