/** * Sets the 'IF EXISTS' option for the DELETE statement this WHERE clause is part of. * * <p> * * <p>A delete with that option will report whether the statement actually resulted in data * being deleted. The existence check and deletion are done transactionally in the sense that if * multiple clients attempt to delete a given row with this option, then at most one may * succeed. * * <p>Please keep in mind that using this option has a non negligible performance impact and * should be avoided when possible. * * @return the DELETE statement this WHERE clause is part of. */ public Delete ifExists() { return statement.ifExists(); }
/** * Sets the 'IF EXISTS' option for the DELETE statement this WHERE clause * is part of. * <p/> * <p> * A delete with that option will report whether the statement actually * resulted in data being deleted. The existence check and deletion are * done transactionally in the sense that if multiple clients attempt to * delete a given row with this option, then at most one may succeed. * </p> * <p> * Please keep in mind that using this option has a non negligible * performance impact and should be avoided when possible. * </p> * * @return the DELETE statement this WHERE clause is part of. */ public Delete ifExists() { return statement.ifExists(); }
/** * Sets the 'IF EXISTS' option for the DELETE statement this WHERE clause * is part of. * <p/> * <p> * A delete with that option will report whether the statement actually * resulted in data being deleted. The existence check and deletion are * done transactionally in the sense that if multiple clients attempt to * delete a given row with this option, then at most one may succeed. * </p> * <p> * Please keep in mind that using this option has a non negligible * performance impact and should be avoided when possible. * </p> * * @return the DELETE statement this WHERE clause is part of. */ public Delete ifExists() { return statement.ifExists(); }
/** * Sets the 'IF EXISTS' option for the DELETE statement this WHERE clause * is part of. * <p/> * <p> * A delete with that option will report whether the statement actually * resulted in data being deleted. The existence check and deletion are * done transactionally in the sense that if multiple clients attempt to * delete a given row with this option, then at most one may succeed. * </p> * <p> * Please keep in mind that using this option has a non negligible * performance impact and should be avoided when possible. * </p> * * @return the DELETE statement this WHERE clause is part of. */ public Delete ifExists() { return statement.ifExists(); }
private PreparedStatement prepareRemoveStatement(Session session) { return session.prepare(delete() .from(TABLE_NAME) .ifExists() .where(eq(DOMAIN, bindMarker(DOMAIN)))); }
/** * Generate delete where columns = ? CQL. */ public static Delete generateDelete(String table, String[] whereColumns, int whereColumnsMaxIndex, boolean ifExists) { Delete delete = delete().from(table); if (isWhereClause(whereColumns, whereColumnsMaxIndex)) { Delete.Where where = delete.where(); for (int i = 0; i < whereColumns.length && i < whereColumnsMaxIndex; i++) { where.and(eq(whereColumns[i], bindMarker())); } } if (ifExists) { delete = delete.ifExists(); } return delete; }