Class Delete
- java.lang.Object
-
- com.datastax.driver.core.Statement
-
- com.datastax.driver.core.RegularStatement
-
- com.datastax.driver.core.querybuilder.BuiltStatement
-
- com.datastax.driver.core.querybuilder.Delete
-
public class Delete extends BuiltStatement
A built DELETE statement.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDelete.BuilderAn in-construction DELETE statement.static classDelete.ConditionsConditions for a DELETE statement.static classDelete.OptionsThe options of a DELETE statement.static classDelete.SelectionAn column selection clause for an in-construction DELETE statement.static classDelete.WhereThe WHERE clause of a DELETE statement.
-
Field Summary
-
Fields inherited from class com.datastax.driver.core.Statement
idempotent, NULL_PAYLOAD_VALUE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeleteifExists()Sets the 'IF EXISTS' option for this DELETE statement.Delete.ConditionsonlyIf()Adds a conditions clause (IF) to this statement.Delete.ConditionsonlyIf(Clause condition)Adds a conditions clause (IF) to this statement.Delete.Optionsusing()Returns the options for this DELETE statement.Delete.Optionsusing(Using using)Adds a new options for this DELETE statement.Delete.Wherewhere()Returns a Where statement for this query without adding clause.Delete.Wherewhere(Clause clause)Adds a WHERE clause to this statement.-
Methods inherited from class com.datastax.driver.core.querybuilder.BuiltStatement
escapeId, getKeyspace, getNamedValues, getObject, getObject, getQueryString, getRoutingKey, getValues, hasValues, isIdempotent, setForceNoValues, toString, usesNamedValues
-
Methods inherited from class com.datastax.driver.core.RegularStatement
getQueryString, hasValues, requestSizeInBytes
-
Methods inherited from class com.datastax.driver.core.Statement
disableTracing, enableTracing, getConsistencyLevel, getDefaultTimestamp, getFetchSize, getHost, getLastHost, getNowInSeconds, getOutgoingPayload, getPartitioner, getReadTimeoutMillis, getRetryPolicy, getSerialConsistencyLevel, isBatchIdempotent, isLWT, isTracing, setConsistencyLevel, setDefaultTimestamp, setFetchSize, setHost, setIdempotent, setLastHost, setNowInSeconds, setOutgoingPayload, setPagingState, setPagingState, setPagingStateUnsafe, setReadTimeoutMillis, setRetryPolicy, setSerialConsistencyLevel
-
-
-
-
Method Detail
-
where
public Delete.Where where(Clause clause)
Adds a WHERE clause to this statement.This is a shorter/more readable version for
where().and(clause).- Parameters:
clause- the clause to add.- Returns:
- the where clause of this query to which more clause can be added.
-
where
public Delete.Where where()
Returns a Where statement for this query without adding clause.- Returns:
- the where clause of this query to which more clause can be added.
-
onlyIf
public Delete.Conditions onlyIf(Clause condition)
Adds a conditions clause (IF) to this statement.This is a shorter/more readable version for
onlyIf().and(condition).This will configure the statement as non-idempotent, see
Statement.isIdempotent()for more information.- Parameters:
condition- the condition to add.- Returns:
- the conditions of this query to which more conditions can be added.
-
onlyIf
public Delete.Conditions onlyIf()
Adds a conditions clause (IF) to this statement.This will configure the statement as non-idempotent, see
Statement.isIdempotent()for more information.- Returns:
- the conditions of this query to which more conditions can be added.
-
using
public Delete.Options using(Using using)
Adds a new options for this DELETE statement.- Parameters:
using- the option to add.- Returns:
- the options of this DELETE statement.
-
using
public Delete.Options using()
Returns the options for this DELETE statement.Chain this with
Delete.Options.and(Using)to add options.- Returns:
- the options of this DELETE statement.
-
ifExists
public Delete ifExists()
Sets the 'IF EXISTS' option for this DELETE statement.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.
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
Statement.isIdempotent()for more information.- Returns:
- this DELETE statement.
-
-