Hi all,
I have two tables: MastRec and OutpRec which both extended from class PKMastRec and have one to one relationship with this mapping on OutpRec.hbm.xml:
<one-to-one name="mastRec" class="com.mitrais.kms.service.MastRec" cascade="all" outer-join="auto"/>
I want the relationship behaves like this:
Every creation and modification on table OutpRec will affect table MastRec.
I create a test case for record creation on table OutpRec, but unfortunately it did not behave properly. Every record creation on table OutpRec will UPDATE (not CREATE) record on MastRec.
The log is:
Hibernate: insert into KMS_SERV_OUTP_REC (NEW_CASE, SUBJECTIVE, OBJECTIVE, ASSES_DESC_1, ICD_CODE_1, ASSES_DESC_2, ICD_CODE_2, ASSES_DESC_3, ICD_CODE_3, PLAN, DISMISSAL_CODE, BED_REST, MR_NO, MR_DATE, MR_TYPE, MR_SEQ) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: update KMS_SERV_MAST_REC set ACTION_CODE=?, ACTV_GRP_ID=?, ACTV_ID=?, DOCTOR_ID=?, STAFF_ID=?, ICD_CODE=?, CREATED_BY=?, CREATED_DATE=?, LAST_UPD_BY=?, LAST_UPD_DATE=? where MR_NO=? and MR_DATE=? and MR_TYPE=? and MR_SEQ=?
Does anyone know how to solve this problem?
Regards,
-Made Eka-
|