Forums Register Login

hibernate + mapping a class more than once

+Pie Number of slices to send: Send
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!
+Pie Number of slices to send: Send
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"/>

 
Come have lunch with me Arthur. Adventure will follow. This tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1822 times.
Similar Threads
Hibernate - how to modify value before Hibernate stores it?
Retrieving SQL generated value
cascading classes and tables (how to update ?)
One java class & Two tables Hibernate
single bean reference
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:31:44.