public boolean isModified ( boolean bNonKeyOnly ) { int fieldCount = this . getFieldCount ( ) ; // BaseField Count for ( int fieldSeq = DBConstants . MAIN_FIELD ; fieldSeq < fieldCount + DBConstants . MAIN_FIELD ; fieldSeq ++ ) { BaseField field = this . getField ( fieldSeq ) ; if ( field . isModified ( ) ) if ( ! field . isVirtual ( ) ) // If not public and has been modified... { boolean bSkip = false ; if ( bNonKeyOnly ) { KeyArea index = this . getKeyArea ( - 1 ) ; for ( int i = DBConstants . MAIN_KEY_FIELD ; i < index . getKeyFields ( ) ; i ++ ) { if ( field == index . getField ( i ) ) { bSkip = true ; // Skip this one break ; } } } if ( ! bSkip ) return true ; // A field has been changed } } return false ; // No Changes YET }
Have any fields Changed?