You have the constraint GDMW.CUST_CONT_CMNT.FK_CCNTCMT_CCNT (defined as
on delete restrict) which restrict deletion of GDMW.CUSTOMER_CONTACT object (record in terms of SQL), because there're obects (records in terms of SQL) that refers to it. One way to resolve this problem is to define this constraint as
on delete cascade if it accords your business rules, or if this association mapped in Hibernate, let Hibernate automatically delete all related records with
cascade="delete" attribute in your mapping.
Look what DB2 documentation says:
Quote:
SQL0532N A parent row cannot be deleted because the relationship constraint-name restricts the deletion.
Explanation: An operation attempted to delete a specified row of the parent table but the parent key in the specified row has dependent rows in
the referential constraint constraint-name and the delete rule of NO ACTION or RESTRICT is specified for the relationship.
User Response: Examine the delete rule for all descendent tables to determine and correct the problem. The specific tables involved can be
determined from the relationship constraint-name.
sqlcode: -532
sqlstate: 23001, 23504