org.apache.cassandra.cql3.statements
Class UpdateStatement
java.lang.Object
org.apache.cassandra.cql3.statements.ParsedStatement
org.apache.cassandra.cql3.statements.CFStatement
org.apache.cassandra.cql3.statements.ModificationStatement
org.apache.cassandra.cql3.statements.UpdateStatement
- All Implemented Interfaces:
- CQLStatement
public class UpdateStatement
- extends ModificationStatement
An UPDATE
statement parsed from a CQL query statement.
Constructor Summary |
UpdateStatement(CFName name,
java.util.List<ColumnIdentifier> columnNames,
java.util.List<Term> columnValues,
Attributes attrs)
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.Map<ColumnIdentifier,Operation> columns,
java.util.List<Relation> whereClause,
Attributes attrs)
Creates a new UpdateStatement from a column family name, columns map, consistency
level, and key term. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
UpdateStatement
public UpdateStatement(CFName name,
java.util.Map<ColumnIdentifier,Operation> columns,
java.util.List<Relation> whereClause,
Attributes attrs)
- Creates a new UpdateStatement from a column family name, columns map, consistency
level, and key term.
- Parameters:
name
- column family being operated oncolumns
- a map of column name/values pairswhereClause
- the where clauseattrs
- additional attributes for statement (CL, timestamp, timeToLive)
UpdateStatement
public UpdateStatement(CFName name,
java.util.List<ColumnIdentifier> columnNames,
java.util.List<Term> columnValues,
Attributes attrs)
- Creates a new UpdateStatement from a column family name, a consistency level,
key, and lists of column names and values. It is intended for use with the
alternate update format,
INSERT
.
- Parameters:
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)
getMutations
public java.util.List<IMutation> getMutations(ClientState clientState,
java.util.List<java.nio.ByteBuffer> variables)
throws org.apache.cassandra.thrift.InvalidRequestException
- Convert statement into a list of mutations to apply on the server
- Specified by:
getMutations
in class ModificationStatement
- Parameters:
clientState
- current client statusvariables
- value for prepared statement markers
- Returns:
- list of the mutations
- Throws:
org.apache.cassandra.thrift.InvalidRequestException
- on invalid requests
prepare
public ParsedStatement.Prepared prepare(CFDefinition.Name[] boundNames)
throws org.apache.cassandra.thrift.InvalidRequestException
- Specified by:
prepare
in class ModificationStatement
- Throws:
org.apache.cassandra.thrift.InvalidRequestException
prepare
public ParsedStatement.Prepared prepare()
throws org.apache.cassandra.thrift.InvalidRequestException
- Specified by:
prepare
in class ParsedStatement
- Throws:
org.apache.cassandra.thrift.InvalidRequestException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2012 The Apache Software Foundation