public void checkNullableKey(BaseField field, boolean bFirstFieldOnly)
    {
        for (int iKeySeq = 0; iKeySeq < this.getRecord().getKeyAreaCount(); iKeySeq++)
        {
            KeyArea keyArea = this.getRecord().getKeyArea(iKeySeq);
            for (int iKeyFieldSeq = 0; iKeyFieldSeq < keyArea.getKeyFields(); iKeyFieldSeq++)
            {
                if (keyArea.getField(iKeyFieldSeq) == field)
                {
                    if (field.isNullable() == true)
                    {   // Don't allow this key to be null
                        field.setNullable(false);
                        return;
                    }
                }
                if (bFirstFieldOnly)
                    break;
            }
        }
    }
public void checkNullableKey ( BaseField field , boolean bFirstFieldOnly ) { for ( int iKeySeq = 0 ; iKeySeq < this . getRecord ( ) . getKeyAreaCount ( ) ; iKeySeq ++ ) { KeyArea keyArea = this . getRecord ( ) . getKeyArea ( iKeySeq ) ; for ( int iKeyFieldSeq = 0 ; iKeyFieldSeq < keyArea . getKeyFields ( ) ; iKeyFieldSeq ++ ) { if ( keyArea . getField ( iKeyFieldSeq ) == field ) { if ( field . isNullable ( ) == true ) { field . setNullable ( false ) ; return ; } } if ( bFirstFieldOnly ) break ; } } }
This is a special method - If the db doesn't allow null keys,
you must make sure they are not nullable.
<br />This is used on create.
@param field Field to check, if it is in a key and is nullable, set to not nullable.