use of org.apache.derby.iapi.sql.dictionary.ColPermsDescriptor in project derby by apache.
the class SYSCOLPERMSRowFactory method orPermissions.
/**
* Or a set of permissions in with a row from this catalog table
*
* @param row an existing row
* @param perm a permission descriptor of the appropriate class for this PermissionsCatalogRowFactory class.
* @param colsChanged An array with one element for each column in row. It is updated to
* indicate which columns in row were changed
*
* @return The number of columns that were changed.
*
* @exception StandardException standard error policy
*/
public int orPermissions(ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged) throws StandardException {
ColPermsDescriptor colPerms = (ColPermsDescriptor) perm;
FormatableBitSet existingColSet = (FormatableBitSet) row.getColumn(COLUMNS_COL_NUM).getObject();
FormatableBitSet newColSet = colPerms.getColumns();
boolean changed = false;
for (int i = newColSet.anySetBit(); i >= 0; i = newColSet.anySetBit(i)) {
if (!existingColSet.get(i)) {
existingColSet.set(i);
changed = true;
}
}
if (changed) {
colsChanged[COLUMNS_COL_NUM - 1] = true;
return 1;
}
return 0;
}
Aggregations