private boolean isOrdered(FieldDescriptor[] flds, String[] pkFieldNames)
    {
        if((flds.length > 1 && pkFieldNames == null) || flds.length != pkFieldNames.length)
        {
            throw new PersistenceBrokerException("pkFieldName length does not match number of defined PK fields." +
                    " Expected number of PK fields is " + flds.length + ", given number was " +
                    (pkFieldNames != null ? pkFieldNames.length : 0));
        }
        boolean result = true;
        for(int i = 0; i < flds.length; i++)
        {
            FieldDescriptor fld = flds[i];
            result = result && fld.getPersistentField().getName().equals(pkFieldNames[i]);
        }
        return result;
    }
private boolean isOrdered ( FieldDescriptor [ ] flds , String [ ] pkFieldNames ) { if ( ( flds . length > 1 && pkFieldNames == null ) || flds . length != pkFieldNames . length ) { throw new PersistenceBrokerException ( "pkFieldName length does not match number of defined PK fields." + " Expected number of PK fields is " + flds . length + ", given number was " + ( pkFieldNames != null ? pkFieldNames . length : 0 ) ) ; } boolean result = true ; for ( int i = 0 ; i < flds . length ; i ++ ) { FieldDescriptor fld = flds [ i ] ; result = result && fld . getPersistentField ( ) . getName ( ) . equals ( pkFieldNames [ i ] ) ; } return result ; }
Checks length and compare order of field names with declared PK fields in metadata.