public class UpdateStatement extends ModificationStatement
UPDATE
statement parsed from a CQL query statement.ModificationStatement.Type
ParsedStatement.Prepared
type
cfName
Constructor and Description |
---|
UpdateStatement(CFName name,
Attributes attrs,
java.util.List<ColumnIdentifier> columnNames,
java.util.List<Term.Raw> columnValues)
Creates a new UpdateStatement from a column family name, a consistency level,
key, and lists of column names and values.
|
UpdateStatement(CFName name,
java.util.List<Pair<ColumnIdentifier,Operation.RawUpdate>> operations,
java.util.List<Relation> whereClause,
Attributes attrs)
Creates a new UpdateStatement from a column family name, columns map, consistency
level, and key term.
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<IMutation> |
getMutations(java.util.List<java.nio.ByteBuffer> variables,
boolean local,
ConsistencyLevel cl,
long now)
Convert statement into a list of mutations to apply on the server
|
ParsedStatement.Prepared |
prepare() |
ParsedStatement.Prepared |
prepare(ColumnSpecification[] boundNames) |
java.lang.String |
toString() |
protected void |
validateConsistency(ConsistencyLevel cl) |
checkAccess, execute, executeInternal, getTimestamp, getTimeToLive, isSetTimestamp, readRows, setTimestamp, validate
columnFamily, keyspace, prepareKeyspace
getBoundsTerms, setBoundTerms
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBoundsTerms
public UpdateStatement(CFName name, java.util.List<Pair<ColumnIdentifier,Operation.RawUpdate>> operations, java.util.List<Relation> whereClause, Attributes attrs)
name
- column family being operated onoperations
- a map of column operations to performwhereClause
- the where clauseattrs
- additional attributes for statement (CL, timestamp, timeToLive)public UpdateStatement(CFName name, Attributes attrs, java.util.List<ColumnIdentifier> columnNames, java.util.List<Term.Raw> columnValues)
INSERT
.name
- column family being operated oncolumnNames
- list of column namescolumnValues
- list of column values (corresponds to names)attrs
- additional attributes for statement (CL, timestamp, timeToLive)protected void validateConsistency(ConsistencyLevel cl) throws InvalidRequestException
validateConsistency
in class ModificationStatement
InvalidRequestException
public java.util.Collection<IMutation> getMutations(java.util.List<java.nio.ByteBuffer> variables, boolean local, ConsistencyLevel cl, long now) throws RequestExecutionException, RequestValidationException
getMutations
in class ModificationStatement
variables
- value for prepared statement markerslocal
- if true, any requests (for collections) performed by getMutation should be done locally only.cl
- the consistency to use for the potential reads involved in generating the mutations (for lists set/delete operations)now
- the current timestamp in microseconds to use if no timestamp is user provided.InvalidRequestException
- on invalid requestsRequestExecutionException
RequestValidationException
public ParsedStatement.Prepared prepare(ColumnSpecification[] boundNames) throws InvalidRequestException
prepare
in class ModificationStatement
InvalidRequestException
public ParsedStatement.Prepared prepare() throws InvalidRequestException
prepare
in class ParsedStatement
InvalidRequestException
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2013 The Apache Software Foundation