public void initSharedRecord ( Record record ) { FieldListener listener = null ; try { BaseField field = record . getSharedRecordTypeKey ( ) ; field . addListener ( listener = new InitOnceFieldHandler ( null ) ) ; field . setData ( new Integer ( 0 ) , true , DBConstants . INIT_MOVE ) ; field . setData ( new Integer ( 0 ) , true , DBConstants . INIT_MOVE ) ; if ( field != null ) if ( field . getDataClass ( ) == Integer . class ) { for ( int i = 1 ; ; i ++ ) { Integer intData = new Integer ( i ) ; field . setData ( intData ) ; record . addNew ( ) ; Record recShared = record . getTable ( ) . getCurrentTable ( ) . getRecord ( ) ; if ( recShared == null ) break ; if ( recShared == record ) break ; if ( recShared . getField ( field . getFieldName ( ) ) . getValue ( ) != i ) break ; this . disableAllListeners ( recShared ) ; } } } catch ( DBException ex ) { ex . printStackTrace ( ) ; } finally { if ( listener != null ) record . removeListener ( listener , true ) ; } }
InitSharedRecord Method .