0

Hibernate: I am inserting data into a table T1(a,b) , I want to update 'd' in table T2(a,c,d,e) using foreign key 'a'. How to write the hbm mapping file in both. It's a one-to-one relation.

Table T1(mac_id, cust_id)
Table T2(a,b, mac_id,c, status_id)

I want to update STATUS_ID to "assigned" if MAC_ID I inserted in T1, matches with MAC_ID present in T2.

My foreign key is "MAC_ID".

chiwangc
  • 3,566
  • 16
  • 26
  • 32
Gompa
  • 1
  • 3
  • Welcome do StackOverflow! Please read the http://stackoverflow.com/tour Tell us what have you tried so far to solve the problem. – ericbn May 19 '15 at 12:42
  • I tried using cascade property "save-update". It didn't work. – Gompa May 19 '15 at 12:44
  • Please read documentation : [hibernate associations](http://docs.jboss.org/hibernate/orm/5.0/manual/en-US/html/ch01.html#tutorial-associations) – Bilal BBB May 19 '15 at 13:17

0 Answers0