• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

hibernate + mapping a class more than once

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 686
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"/>

 
reply
    Bookmark Topic Watch Topic
  • New Topic