SingleColumnRelation (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.cql3

## Class SingleColumnRelation

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

-     public final class SingleColumnRelation
      extends Relation

  Relations encapsulate the relationship between an entity of some kind, and a value (term). For example, > "start" or "colname1" = "somevalue".

- - ### Field Summary

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

      `relationType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SingleColumnRelation(ColumnIdentifier.Raw entity, Operator type, Term.Raw value)` Creates a new relation.
    `SingleColumnRelation(ColumnIdentifier.Raw entity, Term.Raw mapKey, Operator type, Term.Raw value)` Creates a new relation.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SingleColumnRelation` | `createInRelation(ColumnIdentifier.Raw entity, java.util.List<Term.Raw> inValues)`
    `ColumnIdentifier.Raw` | `getEntity()`
    `Term.Raw` | `getMapKey()`
    `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.
    `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`.
    `SingleColumnRelation` | `withNonStrictOperator()`

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

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

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

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

- - ### Constructor Detail

    - #### SingleColumnRelation

          public SingleColumnRelation(ColumnIdentifier.Raw entity,
                                      Term.Raw mapKey,
                                      Operator type,
                                      Term.Raw value)

      Creates a new relation.
      Parameters:
        `entity` - the kind of relation this is; what the term is being compared to.
        `mapKey` - the key into the entity identifying the value the term is being compared to.
        `type` - the type that describes how this entity relates to the value.
        `value` - the value being compared.

    - #### SingleColumnRelation

          public SingleColumnRelation(ColumnIdentifier.Raw entity,
                                      Operator type,
                                      Term.Raw value)

      Creates a new relation.
      Parameters:
        `entity` - the kind of relation this is; what the term is being compared to.
        `type` - the type that describes how this entity relates to the value.
        `value` - the value being compared.

  - ### Method Detail

    - #### createInRelation

          public static SingleColumnRelation createInRelation(ColumnIdentifier.Raw entity,
                                                              java.util.List<Term.Raw> inValues)

    - #### getEntity

          public ColumnIdentifier.Raw getEntity()

    - #### getMapKey

          public Term.Raw getMapKey()

    - #### 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

    - #### withNonStrictOperator

          public SingleColumnRelation withNonStrictOperator()

    - #### toString

          public java.lang.String toString()

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

    - #### 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

Copyright © 2018 The Apache Software Foundation