private void deleteCollections(Object obj, List listCds) throws PersistenceBrokerException
    {
        // get all members of obj that are collections and delete all their elements
        Iterator i = listCds.iterator();

        while (i.hasNext())
        {
            CollectionDescriptor cds = (CollectionDescriptor) i.next();
            if(cds.getCascadingDelete() != ObjectReferenceDescriptor.CASCADE_NONE)
            {
                if(cds.isMtoNRelation())
                {
                    // if this is a m:n mapped table, remove entries from indirection table
                    mtoNBroker.deleteMtoNImplementor(cds, obj);
                }
                /*
                if cascading delete is on, delete all referenced objects.
                NOTE: User has to take care to populate all referenced objects before delete
                the main object to avoid referential constraint violation
                 */
                if (cds.getCascadingDelete() == ObjectReferenceDescriptor.CASCADE_OBJECT)
                {
                    Object col = cds.getPersistentField().get(obj);
                    if (col != null)
                    {
                        Iterator colIterator = BrokerHelper.getCollectionIterator(col);
                        while (colIterator.hasNext())
                        {
                            doDelete(colIterator.next(), false);
                        }
                    }
                }
            }
        }
    }
private void deleteCollections ( Object obj , List listCds ) throws PersistenceBrokerException { Iterator i = listCds . iterator ( ) ; while ( i . hasNext ( ) ) { CollectionDescriptor cds = ( CollectionDescriptor ) i . next ( ) ; if ( cds . getCascadingDelete ( ) != ObjectReferenceDescriptor . CASCADE_NONE ) { if ( cds . isMtoNRelation ( ) ) { mtoNBroker . deleteMtoNImplementor ( cds , obj ) ; } if ( cds . getCascadingDelete ( ) == ObjectReferenceDescriptor . CASCADE_OBJECT ) { Object col = cds . getPersistentField ( ) . get ( obj ) ; if ( col != null ) { Iterator colIterator = BrokerHelper . getCollectionIterator ( col ) ; while ( colIterator . hasNext ( ) ) { doDelete ( colIterator . next ( ) , false ) ; } } } } } }
Deletes collections of objects poiting to <b>obj</b>.
All object which have a FK poiting to this object (Via CollectionDescriptors)
will be deleted if auto-delete is true <b>AND</b>
the member field containing the object reference if NOT null.

@param obj Object which we will delete collections for
@param listCds list of ObjectReferenceDescriptors
@throws PersistenceBrokerException if some goes wrong - please see the error message for details