Hello,
1 - First of all, the query (simplified as it is quite big) to retrieve the object (parent and children) to be modified:
Code:
select
body0_.BODY_UID as BODY1_7_1_,
body0_.BODY_MEP_CODE as BODY2_7_1_,
............................................
descriptio1_.BODY_UID as BODY5_7_3_,
descriptio1_.BODY_DESC_UID as BODY1_3_,
descriptio1_.BODY_DESC_UID as BODY1_8_0_,
descriptio1_.BODY_UPDATE_DATE as BODY2_8_0_,
descriptio1_.BODY_UPDATE_USER as BODY3_8_0_,
.............................................
from
T_BODY body0_,
T_BODY_DESC descriptio1_
where
body0_.BODY_UID=descriptio1_.BODY_UID(+)
and body0_.BODY_UID=?
(*) I've just paid attention in one thing: Why it queries twice the same column: descriptio1_.BODY_DESC_UID?
2 - The instructions to update the DB:
Code:
select
SEQ_BODY_DESC_UID.nextval
from
dual
Hibernate:
insert into T_BODY_DESC
(BODY_UPDATE_DATE, BODY_UPDATE_USER, BODY_LANG_ISO_CODE, BODY_UID, BODY_SHORT_NAME, BODY_FULL_NAME, BODY_SEARCH_NAME, BODY_MNEMO_CODE, BODY_CODE, BODY_LATIN_CODE, BODY_LATIN_SHORT_NAME, BODY_LATIN_FULL_NAME, BODY_LATIN_SEARCH_NAME, BODY_LONG_NAME, BODY_DESC_UID)
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
You can see it tries to execute an "insert" instead of an update, and in that moment the exception by constraint violated is thrown as two field that must be different for each row are repeated:
Code:
ORA-00001: unique constraint (BODY_DESC2_PK) violated