|
Hi,
I have a requirement where i have to establish a one-to-one relationship between tables CUSTOMER<-1--1->CORPORATE_EMPLOYEE<1--1>LOGIN_CREDENTIALS table
I tried with <one-to-one> in Customer.hbm and <many to one> with "unique=true" in CorporateEmployee.hbm as both the table are related via Foreigh key. CUSTOMER.CUSTOMER_ID is present as foreign key in CORPORATE_EMPLOYEE table CORPORATE_EMPLOYEE.EMPLOYEE_ID is present in LOGIN_CREDENTIALS as a foreign key.
So If i want to save a Customer object, Is there a way that i say save(customer) which automatically saves CorporateEmployee and LoginCredentials as well ?
Iam new to hibernate and struggling with this issue for the past few days. If any body has worked on this part can you please help ? Please bear with me if this question sounds so trivial.
Regards,
|