public boolean isSoftDeleteThisRecord ( ) { Record recDetailOld = m_recDetail ; Record recDetail = this . getDetailRecord ( Record . findRecordOwner ( this . getOwner ( ) ) ) ; if ( m_recDetail != null ) if ( recDetailOld != m_recDetail ) { recDetail . getRecordOwner ( ) . removeRecord ( recDetail ) ; this . getOwner ( ) . addListener ( new FreeOnFreeHandler ( recDetail ) ) ; } if ( recDetail != null ) { if ( recDetail . getListener ( SubFileFilter . class ) == null ) { recDetail . addListener ( new SubFileFilter ( this . getOwner ( ) ) ) ; } try { recDetail . close ( ) ; if ( ! recDetail . hasNext ( ) ) return false ; // No detail records = hard delete the record. } catch ( DBException ex ) { ex . printStackTrace ( ) ; } } return super . isSoftDeleteThisRecord ( ) ; }
Soft delete this record? Override this to decide whether to soft delete or physically delete the record . Soft delete if there are any detail record otherwise hard delete this record .