• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate + mapping a class more than once

 
Rafael Fagundes
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!

At the system that I�m workin on, it�s necessary to map a class more than once - this means: one class -> 2 tables. I found out how to do it on
http://www.hibernate.org/hib_docs/v3/reference/en/html/mapping.html#mapping-entityname

My problem is: at the save operation both tables should be updated, but it successfuly happens only with the first table (declarted at my hbm.xml file). It�s not working for the second table. Doe�s somebody knows what�s happing or if there is some tag attribute tha should be configurated?

Thank�s for your help.
Rafael.

PS: Sorry for my bad english!
 
Jignesh Patel
Ranch Hand
Posts: 626
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you follow up further as mentioned in example:

<set name="history" inverse="true"
order-by="effectiveEndDate desc">
<key column="currentContractId"/>
<one-to-many entity-name="HistoricalContract"/>
</set>



and
<many-to-one name="currentContract"
column="currentContractId"
entity-name="CurrentContract"/>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic