/** * Remove an association row * * @param executionEngine the {@link ExecutionEngine} used to run the query * @param associationKey represents the association * @param rowKey represents a row in an association */ public void removeAssociationRow( ExecutionEngine executionEngine, AssociationKey associationKey, RowKey rowKey) { Object[] relationshipValues; if (associationKey.getMetadata().getRowKeyIndexColumnNames().length > 0) { int length = associationKey.getMetadata().getRowKeyIndexColumnNames().length; relationshipValues = new Object[length]; String[] indexColumnNames = associationKey.getMetadata().getRowKeyIndexColumnNames(); for (int i = 0; i < indexColumnNames.length; i++) { for (int j = 0; j < rowKey.getColumnNames().length; j++) { if (indexColumnNames[i].equals(rowKey.getColumnNames()[j])) { relationshipValues[i] = rowKey.getColumnValues()[j]; } } } } else { relationshipValues = getEntityKey(associationKey, rowKey).getColumnValues(); } Object[] queryValues = ArrayHelper.concat(associationKey.getEntityKey().getColumnValues(), relationshipValues); executionEngine.execute(removeAssociationRowQuery, params(queryValues)); }
public SerializableRowKey(RowKey key) { columnNames = key.getColumnNames(); columnValues = key.getColumnValues(); }