MultiColumnRelation (apache-cassandra API)
Date: 2014-10-21

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 ?

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.cassandra.cql3.Relation

      `Relation.Type`

  - ### Field Summary

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

      `relationType`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static MultiColumnRelation` | `createInRelation(java.util.List<ColumnIdentifier> 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> entities, Relation.Type relationType, Term.MultiColumnRaw valuesOrMarker)` Creates a multi-column EQ, LT, LTE, GT, or GTE relation.
    `static MultiColumnRelation` | `createSingleMarkerInRelation(java.util.List<ColumnIdentifier> entities, Tuples.INRaw inMarker)` Creates a multi-column IN relation with a marker for the IN values.
    `java.util.List<ColumnIdentifier>` | `getEntities()`
    `Tuples.INRaw` | `getInMarker()` For IN relations, returns the single marker for the IN values if there is one, otherwise null.
    `java.util.List<? extends Term.MultiColumnRaw>` | `getInValues()` For IN relations, returns the list of Tuples.Literal instances or Tuples.Raw markers.
    `Term.MultiColumnRaw` | `getValue()` For non-IN relations, returns the Tuples.Literal or Tuples.Raw marker for a single tuple.
    `boolean` | `isMultiColumn()`
    `java.lang.String` | `toString()`

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

      `operator`

    - ### 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> entities,
                                                Relation.Type 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

    - #### createInRelation

          public static MultiColumnRelation createInRelation(java.util.List<ColumnIdentifier> 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

    - #### createSingleMarkerInRelation

          public static MultiColumnRelation createSingleMarkerInRelation(java.util.List<ColumnIdentifier> 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

    - #### getEntities

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

    - #### getValue

          public Term.MultiColumnRaw getValue()

      For non-IN relations, returns the Tuples.Literal or Tuples.Raw marker for a single tuple.

    - #### getInValues

          public java.util.List<? extends Term.MultiColumnRaw> getInValues()

      For IN relations, returns the list of Tuples.Literal instances or Tuples.Raw markers. If a single IN marker was used, this will return null;

    - #### getInMarker

          public Tuples.INRaw getInMarker()

      For IN relations, returns the single marker for the IN values if there is one, otherwise null.

    - #### isMultiColumn

          public boolean isMultiColumn()

      Specified by:
        `isMultiColumn` in class `Relation`

    - #### toString

          public java.lang.String toString()

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

Copyright © 2014 The Apache Software Foundation