org.apache.cassandra.cql3

## Class MultiColumnRelation

- java.lang.Object
- - org.apache.cassandra.cql3.Relation
  - - org.apache.cassandra.cql3.MultiColumnRelation

    public class MultiColumnRelation
    extends Relation

A relation using the tuple notation, which typically affects multiple columns. Examples: `- SELECT ... WHERE (a, b, c) > (1, 'a', 10) - SELECT ... WHERE (a, b, c) IN ((1, 2, 3), (4, 5, 6)) - SELECT ... WHERE (a, b) < ? - SELECT ... WHERE (a, b) IN ?`

### Field Summary

### Fields inherited from class org.apache.cassandra.cql3.Relation

`relationType`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static MultiColumnRelation` `createInRelation(java.util.List<ColumnIdentifier.Raw> entities, java.util.List<? extends Term.MultiColumnRaw> inValues)` Creates a multi-column IN relation with a list of IN values or markers.
`static MultiColumnRelation` `createNonInRelation(java.util.List<ColumnIdentifier.Raw> entities, Operator relationType, Term.MultiColumnRaw valuesOrMarker)` Creates a multi-column EQ, LT, LTE, GT, or GTE relation.
`static MultiColumnRelation` `createSingleMarkerInRelation(java.util.List<ColumnIdentifier.Raw> entities, Tuples.INRaw inMarker)` Creates a multi-column IN relation with a marker for the IN values.
`java.util.List<ColumnIdentifier.Raw>` `getEntities()`
`boolean` `isMultiColumn()` Checks if this relation apply to multiple columns.
`protected Restriction` `newContainsRestriction(CFMetaData cfm, VariableSpecifications boundNames, boolean isKey)` Creates a new Contains restriction instance.
`protected Restriction` `newEQRestriction(CFMetaData cfm, VariableSpecifications boundNames)` Creates a new EQ restriction instance.
`protected Restriction` `newINRestriction(CFMetaData cfm, VariableSpecifications boundNames)` Creates a new IN restriction instance.
`protected Restriction` `newSliceRestriction(CFMetaData cfm, VariableSpecifications boundNames, Bound bound, boolean inclusive)` Creates a new Slice restriction instance.
`protected java.util.List<ColumnDefinition>` `receivers(CFMetaData cfm)`
`java.lang.String` `toString()`
`protected Term` `toTerm(java.util.List<? extends ColumnSpecification> receivers, Term.Raw raw, java.lang.String keyspace, VariableSpecifications boundNames)` Converts the specified `Raw` into a `Term`.

### Methods inherited from class org.apache.cassandra.cql3.Relation

`isContains, isContainsKey, isEQ, isIN, isSlice, onToken, operator, toColumnDefinition, toRestriction, toTerms`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Method Detail

#### createNonInRelation

    public static MultiColumnRelation createNonInRelation(java.util.List<ColumnIdentifier.Raw> entities,
                                                          Operator relationType,
                                                          Term.MultiColumnRaw valuesOrMarker)

Creates a multi-column EQ, LT, LTE, GT, or GTE relation. `For example: "SELECT ... WHERE (a, b) > (0, 1)"`

Parameters:
  `entities` - the columns on the LHS of the relation
  `relationType` - the relation operator
  `valuesOrMarker` - a Tuples.Literal instance or a Tuples.Raw marker
Returns:
  a new `MultiColumnRelation` instance

#### createInRelation

    public static MultiColumnRelation createInRelation(java.util.List<ColumnIdentifier.Raw> entities,
                                                       java.util.List<? extends Term.MultiColumnRaw> inValues)

Creates a multi-column IN relation with a list of IN values or markers. For example: "SELECT ... WHERE (a, b) IN ((0, 1), (2, 3))"

Parameters:
  `entities` - the columns on the LHS of the relation
  `inValues` - a list of Tuples.Literal instances or a Tuples.Raw markers
Returns:
  a new `MultiColumnRelation` instance

#### createSingleMarkerInRelation

    public static MultiColumnRelation createSingleMarkerInRelation(java.util.List<ColumnIdentifier.Raw> entities,
                                                                   Tuples.INRaw inMarker)

Creates a multi-column IN relation with a marker for the IN values. For example: "SELECT ... WHERE (a, b) IN ?"

Parameters:
  `entities` - the columns on the LHS of the relation
  `inMarker` - a single IN marker
Returns:
  a new `MultiColumnRelation` instance

#### getEntities

    public java.util.List<ColumnIdentifier.Raw> getEntities()

#### isMultiColumn

    public boolean isMultiColumn()

Description copied from class: `Relation`
Checks if this relation apply to multiple columns.

Overrides:
  `isMultiColumn` in class `Relation`
Returns:
  `true` if this relation apply to multiple columns, `false` otherwise.

#### newEQRestriction

    protected Restriction newEQRestriction(CFMetaData cfm,
                                           VariableSpecifications boundNames)
                                    throws InvalidRequestException

Description copied from class: `Relation`
Creates a new EQ restriction instance.

Specified by:
  `newEQRestriction` in class `Relation`
Parameters:
  `cfm` - the Column Family meta data
  `boundNames` - the variables specification where to collect the bind variables
Returns:
  a new EQ restriction instance.
Throws:
  `InvalidRequestException` - if the relation cannot be converted into an EQ restriction.

#### newINRestriction

    protected Restriction newINRestriction(CFMetaData cfm,
                                           VariableSpecifications boundNames)
                                    throws InvalidRequestException

Description copied from class: `Relation`
Creates a new IN restriction instance.

Specified by:
  `newINRestriction` in class `Relation`
Parameters:
  `cfm` - the Column Family meta data
  `boundNames` - the variables specification where to collect the bind variables
Returns:
  a new IN restriction instance
Throws:
  `InvalidRequestException` - if the relation cannot be converted into an IN restriction.

#### newSliceRestriction

    protected Restriction newSliceRestriction(CFMetaData cfm,
                                              VariableSpecifications boundNames,
                                              Bound bound,
                                              boolean inclusive)
                                       throws InvalidRequestException

Description copied from class: `Relation`
Creates a new Slice restriction instance.

Specified by:
  `newSliceRestriction` in class `Relation`
Parameters:
  `cfm` - the Column Family meta data
  `boundNames` - the variables specification where to collect the bind variables
  `bound` - the slice bound
  `inclusive` - `true` if the bound is included.
Returns:
  a new slice restriction instance
Throws:
  `InvalidRequestException` - if the `Relation` is not valid

#### newContainsRestriction

    protected Restriction newContainsRestriction(CFMetaData cfm,
                                                 VariableSpecifications boundNames,
                                                 boolean isKey)
                                          throws InvalidRequestException

Description copied from class: `Relation`
Creates a new Contains restriction instance.

Specified by:
  `newContainsRestriction` in class `Relation`
Parameters:
  `cfm` - the Column Family meta data
  `boundNames` - the variables specification where to collect the bind variables
  `isKey` - `true` if the restriction to create is a CONTAINS KEY
Returns:
  a new Contains `Restriction` instance
Throws:
  `InvalidRequestException` - if the `Relation` is not valid

#### toTerm

    protected Term toTerm(java.util.List<? extends ColumnSpecification> receivers,
                          Term.Raw raw,
                          java.lang.String keyspace,
                          VariableSpecifications boundNames)
                   throws InvalidRequestException

Description copied from class: `Relation`
Converts the specified `Raw` into a `Term`.

Specified by:
  `toTerm` in class `Relation`
Parameters:
  `receivers` - the columns to which the values must be associated at
  `raw` - the raw term to convert
  `keyspace` - the keyspace name
  `boundNames` - the variables specification where to collect the bind variables
Returns:
  the `Term` corresponding to the specified `Raw`
Throws:
  `InvalidRequestException` - if the `Raw` term is not valid

#### receivers

    protected java.util.List<ColumnDefinition> receivers(CFMetaData cfm)
                                                  throws InvalidRequestException

Throws:
  `InvalidRequestException`

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`