public abstract class Relation
extends java.lang.Object
| Modifier and Type | Field and Description | 
|---|---|
| protected Operator | relationType | 
| Constructor and Description | 
|---|
| Relation() | 
| Modifier and Type | Method and Description | 
|---|---|
| abstract java.util.List<? extends Term.Raw> | getInValues()Returns the list of raw IN values for this relation, or null if this is not an IN relation. | 
| abstract Term.Raw | getValue()Returns the raw value for this relation, or null if this is an IN relation. | 
| boolean | isContains()Checks if the operator of this relation is a  CONTAINS. | 
| boolean | isContainsKey()Checks if the operator of this relation is a  CONTAINS_KEY. | 
| boolean | isEQ()Checks if the operator of this relation is a  EQ. | 
| boolean | isIN()Checks if the operator of this relation is a  IN. | 
| boolean | isLIKE() | 
| boolean | isMultiColumn()Checks if this relation apply to multiple columns. | 
| boolean | isSlice()Checks if the operator of this relation is a  Slice(GT, GTE, LTE, LT). | 
| protected abstract Restriction | newContainsRestriction(CFMetaData cfm,
                      VariableSpecifications boundNames,
                      boolean isKey)Creates a new Contains restriction instance. | 
| protected abstract Restriction | newEQRestriction(CFMetaData cfm,
                VariableSpecifications boundNames)Creates a new EQ restriction instance. | 
| protected abstract Restriction | newINRestriction(CFMetaData cfm,
                VariableSpecifications boundNames)Creates a new IN restriction instance. | 
| protected abstract Restriction | newIsNotRestriction(CFMetaData cfm,
                   VariableSpecifications boundNames) | 
| protected abstract Restriction | newLikeRestriction(CFMetaData cfm,
                  VariableSpecifications boundNames,
                  Operator operator) | 
| protected abstract Restriction | newSliceRestriction(CFMetaData cfm,
                   VariableSpecifications boundNames,
                   Bound bound,
                   boolean inclusive)Creates a new Slice restriction instance. | 
| boolean | onToken()Checks if this relation is a token relation (e.g. | 
| Operator | operator() | 
| abstract Relation | renameIdentifier(ColumnDefinition.Raw from,
                ColumnDefinition.Raw to)Renames an identifier in this Relation, if applicable. | 
| Restriction | toRestriction(CFMetaData cfm,
             VariableSpecifications boundNames)Converts this  Relationinto aRestriction. | 
| Relation | toSuperColumnAdapter()Required for SuperColumn compatibility, creates an adapter Relation that remaps all restrictions required for
 SuperColumn tables. | 
| protected abstract Term | toTerm(java.util.List<? extends ColumnSpecification> receivers,
      Term.Raw raw,
      java.lang.String keyspace,
      VariableSpecifications boundNames)Converts the specified  Rawinto aTerm. | 
| protected java.util.List<Term> | toTerms(java.util.List<? extends ColumnSpecification> receivers,
       java.util.List<? extends Term.Raw> raws,
       java.lang.String keyspace,
       VariableSpecifications boundNames)Converts the specified  Rawterms into aTerms. | 
protected Operator relationType
public Operator operator()
public abstract Term.Raw getValue()
public abstract java.util.List<? extends Term.Raw> getInValues()
public boolean isMultiColumn()
true if this relation apply to multiple columns, false otherwise.public boolean onToken()
token(a) = token(1)).
true if this relation is a token relation, false otherwise.public final boolean isContains()
CONTAINS.true  if the operator of this relation is a CONTAINS, false
 otherwise.public final boolean isContainsKey()
CONTAINS_KEY.true  if the operator of this relation is a CONTAINS_KEY, false
 otherwise.public final boolean isIN()
IN.true  if the operator of this relation is a IN, false
 otherwise.public final boolean isEQ()
EQ.true  if the operator of this relation is a EQ, false
 otherwise.public final boolean isLIKE()
public final boolean isSlice()
Slice (GT, GTE, LTE, LT).true if the operator of this relation is a Slice, false otherwise.public final Restriction toRestriction(CFMetaData cfm, VariableSpecifications boundNames) throws InvalidRequestException
Relation into a Restriction.cfm - the Column Family meta databoundNames - the variables specification where to collect the bind variablesRestriction corresponding to this RelationInvalidRequestException - if this Relation is not validpublic Relation toSuperColumnAdapter()
protected abstract Restriction newEQRestriction(CFMetaData cfm, VariableSpecifications boundNames) throws InvalidRequestException
cfm - the Column Family meta databoundNames - the variables specification where to collect the bind variablesInvalidRequestException - if the relation cannot be converted into an EQ restriction.protected abstract Restriction newINRestriction(CFMetaData cfm, VariableSpecifications boundNames) throws InvalidRequestException
cfm - the Column Family meta databoundNames - the variables specification where to collect the bind variablesInvalidRequestException - if the relation cannot be converted into an IN restriction.protected abstract Restriction newSliceRestriction(CFMetaData cfm, VariableSpecifications boundNames, Bound bound, boolean inclusive) throws InvalidRequestException
cfm - the Column Family meta databoundNames - the variables specification where to collect the bind variablesbound - the slice boundinclusive - true if the bound is included.InvalidRequestException - if the Relation is not validprotected abstract Restriction newContainsRestriction(CFMetaData cfm, VariableSpecifications boundNames, boolean isKey) throws InvalidRequestException
cfm - the Column Family meta databoundNames - the variables specification where to collect the bind variablesisKey - true if the restriction to create is a CONTAINS KEYRestriction instanceInvalidRequestException - if the Relation is not validprotected abstract Restriction newIsNotRestriction(CFMetaData cfm, VariableSpecifications boundNames) throws InvalidRequestException
InvalidRequestExceptionprotected abstract Restriction newLikeRestriction(CFMetaData cfm, VariableSpecifications boundNames, Operator operator) throws InvalidRequestException
InvalidRequestExceptionprotected abstract Term toTerm(java.util.List<? extends ColumnSpecification> receivers, Term.Raw raw, java.lang.String keyspace, VariableSpecifications boundNames) throws InvalidRequestException
Raw into a Term.receivers - the columns to which the values must be associated atraw - the raw term to convertkeyspace - the keyspace nameboundNames - the variables specification where to collect the bind variablesTerm corresponding to the specified RawInvalidRequestException - if the Raw term is not validprotected final java.util.List<Term> toTerms(java.util.List<? extends ColumnSpecification> receivers, java.util.List<? extends Term.Raw> raws, java.lang.String keyspace, VariableSpecifications boundNames) throws InvalidRequestException
Raw terms into a Terms.receivers - the columns to which the values must be associated atraws - the raw terms to convertkeyspace - the keyspace nameboundNames - the variables specification where to collect the bind variablesTerms corresponding to the specified Raw termsInvalidRequestException - if the Raw terms are not validpublic abstract Relation renameIdentifier(ColumnDefinition.Raw from, ColumnDefinition.Raw to)
from - the old identifierto - the new identifierCopyright © 2018 The Apache Software Foundation