public final class SingleColumnRelation extends Relation
<key> > "start" or "colname1" = "somevalue"
.relationType
Constructor and Description |
---|
SingleColumnRelation(ColumnIdentifier entity,
Operator type,
Term.Raw value)
Creates a new relation.
|
SingleColumnRelation(ColumnIdentifier entity,
Term.Raw mapKey,
Operator type,
Term.Raw value)
Creates a new relation.
|
Modifier and Type | Method and Description |
---|---|
static SingleColumnRelation |
createInRelation(ColumnIdentifier entity,
java.util.List<Term.Raw> inValues) |
boolean |
equals(java.lang.Object o) |
ColumnIdentifier |
getEntity() |
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.
|
Term.Raw |
getMapKey() |
Term.Raw |
getValue()
Returns the raw value for this relation, or null if this is an IN relation.
|
int |
hashCode() |
protected Restriction |
newContainsRestriction(TableMetadata table,
VariableSpecifications boundNames,
boolean isKey)
Creates a new Contains restriction instance.
|
protected Restriction |
newEQRestriction(TableMetadata table,
VariableSpecifications boundNames)
Creates a new EQ restriction instance.
|
protected Restriction |
newINRestriction(TableMetadata table,
VariableSpecifications boundNames)
Creates a new IN restriction instance.
|
protected Restriction |
newIsNotRestriction(TableMetadata table,
VariableSpecifications boundNames) |
protected Restriction |
newLikeRestriction(TableMetadata table,
VariableSpecifications boundNames,
Operator operator) |
protected Restriction |
newSliceRestriction(TableMetadata table,
VariableSpecifications boundNames,
Bound bound,
boolean inclusive)
Creates a new Slice restriction instance.
|
Relation |
renameIdentifier(ColumnIdentifier from,
ColumnIdentifier to)
Renames an identifier in this Relation, if applicable.
|
java.lang.String |
toCQLString()
Returns a CQL representation of this relation.
|
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() |
isContains, isContainsKey, isEQ, isIN, isLIKE, isMultiColumn, isSlice, onToken, operator, toRestriction, toString, toTerms
public SingleColumnRelation(ColumnIdentifier entity, Term.Raw mapKey, Operator type, Term.Raw value)
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.public SingleColumnRelation(ColumnIdentifier entity, Operator type, Term.Raw value)
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.public Term.Raw getValue()
Relation
public java.util.List<? extends Term.Raw> getInValues()
Relation
getInValues
in class Relation
public static SingleColumnRelation createInRelation(ColumnIdentifier entity, java.util.List<Term.Raw> inValues)
public ColumnIdentifier getEntity()
public Term.Raw getMapKey()
protected Term toTerm(java.util.List<? extends ColumnSpecification> receivers, Term.Raw raw, java.lang.String keyspace, VariableSpecifications boundNames) throws InvalidRequestException
Relation
Raw
into a Term
.toTerm
in class Relation
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 Raw
InvalidRequestException
- if the Raw
term is not validpublic SingleColumnRelation withNonStrictOperator()
public Relation renameIdentifier(ColumnIdentifier from, ColumnIdentifier to)
Relation
renameIdentifier
in class Relation
from
- the old identifierto
- the new identifierpublic java.lang.String toCQLString()
Relation
toCQLString
in class Relation
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
protected Restriction newEQRestriction(TableMetadata table, VariableSpecifications boundNames)
Relation
newEQRestriction
in class Relation
table
- the table meta databoundNames
- the variables specification where to collect the bind variablesprotected Restriction newINRestriction(TableMetadata table, VariableSpecifications boundNames)
Relation
newINRestriction
in class Relation
table
- the table meta databoundNames
- the variables specification where to collect the bind variablesprotected Restriction newSliceRestriction(TableMetadata table, VariableSpecifications boundNames, Bound bound, boolean inclusive)
Relation
newSliceRestriction
in class Relation
table
- the table meta databoundNames
- the variables specification where to collect the bind variablesbound
- the slice boundinclusive
- true
if the bound is included.protected Restriction newContainsRestriction(TableMetadata table, VariableSpecifications boundNames, boolean isKey) throws InvalidRequestException
Relation
newContainsRestriction
in class Relation
table
- the table 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 Restriction newIsNotRestriction(TableMetadata table, VariableSpecifications boundNames) throws InvalidRequestException
newIsNotRestriction
in class Relation
InvalidRequestException
protected Restriction newLikeRestriction(TableMetadata table, VariableSpecifications boundNames, Operator operator)
newLikeRestriction
in class Relation
Copyright © 2009-2021 The Apache Software Foundation