/** * Convenience method for finding a specific row (as defined by the cursor) * where the index entries match the given values. See {@link * IndexCursor#findRowByEntry(Object...)} for details on the entryValues. * * @param index the index to search * @param entryValues the column values for the index's columns. * @return the matching row or {@code null} if a match could not be found. */ public static Row findRowByEntry(Index index, Object... entryValues) throws IOException { return createCursor(index).findRowByEntry(entryValues); }
Table tbl = db.getSystemTable("MSysRelationships"); IndexCursor crsr = CursorBuilder.createCursor(tbl.getIndex("szRelationship")); Row r = crsr.findRowByEntry(relationshipName); if (r != null) { while (r != null) { tbl.deleteRow(r); r = crsr.findRowByEntry(relationshipName); if (crsr.findFirstRow(rowPattern)) { Integer relationshipsId = crsr.getCurrentRow().getInt("Id"); r = crsr.findRowByEntry(relationshipsId, relationshipName); if (r != null) { Integer relationshipId = r.getInt("Id"); tbl = db.getSystemTable("MSysACEs"); crsr = CursorBuilder.createCursor(tbl.getIndex("ObjectId")); r = crsr.findRowByEntry(relationshipId); while (r != null) { tbl.deleteRow(r); r = crsr.findRowByEntry(relationshipId);