/** * Sets the 'IF EXISTS' option for this DELETE statement. * * <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. This will configure the statement as non-idempotent, see * {@link com.datastax.driver.core.Statement#isIdempotent()} for more information. * * @return this DELETE statement. */ public Delete ifExists() { this.ifExists = true; setNonIdempotentOps(); return this; }
/** * Adds the provided condition for the deletion. * * <p>Note that while the query builder accept any type of {@code Clause} as conditions, * Cassandra currently only allows equality ones. * * @param condition the condition to add. * @return this {@code Conditions} clause. */ public Conditions and(Clause condition) { statement.setNonIdempotentOps(); conditions.add(condition); checkForBindMarkers(condition); return this; }
/** * Adds the provided clause to this WHERE clause. * * @param clause the clause to add. * @return this WHERE clause. */ public Where and(Clause clause) { clauses.add(clause); statement.maybeAddRoutingKey(clause.name(), clause.firstValue()); if (!hasNonIdempotentOps() && !Utils.isIdempotent(clause)) { statement.setNonIdempotentOps(); } checkForBindMarkers(clause); return this; }
Delete( String keyspace, String table, List<Object> routingKeyValues, List<ColumnMetadata> partitionKey, List<Selector> columns) { super(keyspace, partitionKey, routingKeyValues); this.table = table; this.columns = columns; this.where = new Where(this); this.usings = new Options(this); this.conditions = new Conditions(this); // This is for JAVA-1089, if the query deletes an element in a list, the statement should be // non-idempotent. if (!areIdempotent(columns)) { setNonIdempotentOps(); } }
/** * Sets the 'IF EXISTS' option for this DELETE statement. * <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> * This will configure the statement as non-idempotent, see {@link com.datastax.driver.core.Statement#isIdempotent()} * for more information. * * @return this DELETE statement. */ public Delete ifExists() { this.ifExists = true; setNonIdempotentOps(); return this; }
/** * Sets the 'IF EXISTS' option for this DELETE statement. * <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> * This will configure the statement as non-idempotent, see {@link com.datastax.driver.core.Statement#isIdempotent()} * for more information. * * @return this DELETE statement. */ public Delete ifExists() { this.ifExists = true; setNonIdempotentOps(); return this; }
/** * Sets the 'IF EXISTS' option for this DELETE statement. * <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> * This will configure the statement as non-idempotent, see {@link com.datastax.driver.core.Statement#isIdempotent()} * for more information. * * @return this DELETE statement. */ public Delete ifExists() { this.ifExists = true; setNonIdempotentOps(); return this; }
/** * Adds the provided condition for the deletion. * <p/> * Note that while the query builder accept any type of {@code Clause} * as conditions, Cassandra currently only allows equality ones. * * @param condition the condition to add. * @return this {@code Conditions} clause. */ public Conditions and(Clause condition) { statement.setNonIdempotentOps(); conditions.add(condition); checkForBindMarkers(condition); return this; }
/** * Adds the provided condition for the deletion. * <p/> * Note that while the query builder accept any type of {@code Clause} * as conditions, Cassandra currently only allows equality ones. * * @param condition the condition to add. * @return this {@code Conditions} clause. */ public Conditions and(Clause condition) { statement.setNonIdempotentOps(); conditions.add(condition); checkForBindMarkers(condition); return this; }
/** * Adds the provided condition for the deletion. * <p/> * Note that while the query builder accept any type of {@code Clause} * as conditions, Cassandra currently only allows equality ones. * * @param condition the condition to add. * @return this {@code Conditions} clause. */ public Conditions and(Clause condition) { statement.setNonIdempotentOps(); conditions.add(condition); checkForBindMarkers(condition); return this; }
Delete(String keyspace, String table, List<Object> routingKeyValues, List<ColumnMetadata> partitionKey, List<Selector> columns) { super(keyspace, partitionKey, routingKeyValues); this.table = table; this.columns = columns; this.where = new Where(this); this.usings = new Options(this); this.conditions = new Conditions(this); // This is for JAVA-1089, if the query deletes an element in a list, the statement should be non-idempotent. if (!areIdempotent(columns)) { setNonIdempotentOps(); } }
Delete(String keyspace, String table, List<Object> routingKeyValues, List<ColumnMetadata> partitionKey, List<Selector> columns) { super(keyspace, partitionKey, routingKeyValues); this.table = table; this.columns = columns; this.where = new Where(this); this.usings = new Options(this); this.conditions = new Conditions(this); // This is for JAVA-1089, if the query deletes an element in a list, the statement should be non-idempotent. if (!areIdempotent(columns)) { setNonIdempotentOps(); } }
Delete(String keyspace, String table, List<Object> routingKeyValues, List<ColumnMetadata> partitionKey, List<Selector> columns) { super(keyspace, partitionKey, routingKeyValues); this.table = table; this.columns = columns; this.where = new Where(this); this.usings = new Options(this); this.conditions = new Conditions(this); // This is for JAVA-1089, if the query deletes an element in a list, the statement should be non-idempotent. if (!areIdempotent(columns)) { setNonIdempotentOps(); } }
/** * Adds the provided clause to this WHERE clause. * * @param clause the clause to add. * @return this WHERE clause. */ public Where and(Clause clause) { clauses.add(clause); statement.maybeAddRoutingKey(clause.name(), clause.firstValue()); if (!hasNonIdempotentOps() && !Utils.isIdempotent(clause)) { statement.setNonIdempotentOps(); } checkForBindMarkers(clause); return this; }
/** * Adds the provided clause to this WHERE clause. * * @param clause the clause to add. * @return this WHERE clause. */ public Where and(Clause clause) { clauses.add(clause); statement.maybeAddRoutingKey(clause.name(), clause.firstValue()); if (!hasNonIdempotentOps() && !Utils.isIdempotent(clause)) { statement.setNonIdempotentOps(); } checkForBindMarkers(clause); return this; }
/** * Adds the provided clause to this WHERE clause. * * @param clause the clause to add. * @return this WHERE clause. */ public Where and(Clause clause) { clauses.add(clause); statement.maybeAddRoutingKey(clause.name(), clause.firstValue()); if (!hasNonIdempotentOps() && !Utils.isIdempotent(clause)) { statement.setNonIdempotentOps(); } checkForBindMarkers(clause); return this; }