5 Replies Latest reply on Mar 29, 2004 5:16 AM by aloubyansky

    cascade-delete performing update instead of delete

    chadlavy

      In my 1:many Entity relationship (see below) I have cascade-delete turned on. I would have expected that testFieldFunctionArg records would be removed from the database. What I am finding, though, is that JBoss is performing an update to NULL of the key fields when I remove a testFieldValidationFunction entity. This fails because the columns it is trying to update are not nullable. Is there a setting somewhere that will force JBoss to perform a DELETE in lui of the UPDATE?

      <ejb-relation >
       <ejb-relation-name>FieldFunction-FieldFunctionArg</ejb-relation-name>
      
       <ejb-relationship-role >
       <ejb-relationship-role-name>field-function-argument-has-field-function</ejb-relationship-role-name>
       <multiplicity>Many</multiplicity>
       <cascade-delete/>
       <relationship-role-source >
       <ejb-name>testFieldFunctionArg</ejb-name>
       </relationship-role-source>
       <cmr-field >
       <cmr-field-name>validationFunction</cmr-field-name>
       </cmr-field>
       </ejb-relationship-role>
      
       <ejb-relationship-role >
       <ejb-relationship-role-name>field-function-has-field-function-arguments</ejb-relationship-role-name>
       <multiplicity>One</multiplicity>
       <relationship-role-source >
       <ejb-name>testFieldValidationFunction</ejb-name>
       </relationship-role-source>
       <cmr-field >
       <cmr-field-name>arguments</cmr-field-name>
       <cmr-field-type>java.util.Collection</cmr-field-type>
       </cmr-field>
       </ejb-relationship-role>
      
       </ejb-relation>