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 |
---|---|
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 |
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 |
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() |
protected ColumnDefinition |
toColumnDefinition(CFMetaData cfm,
ColumnIdentifier.Raw entity)
Converts the specified entity into a column definition.
|
Restriction |
toRestriction(CFMetaData cfm,
VariableSpecifications boundNames)
Converts this
Relation into a Restriction . |
protected abstract Term |
toTerm(java.util.List<? extends ColumnSpecification> receivers,
Term.Raw raw,
java.lang.String keyspace,
VariableSpecifications boundNames)
Converts the specified
Raw into a Term . |
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
Raw terms into a Term s. |
protected Operator relationType
public Operator operator()
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 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 Relation
InvalidRequestException
- if this Relation
is not validprotected 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 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 Raw
InvalidRequestException
- 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 Term
s.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 variablesTerm
s corresponding to the specified Raw
termsInvalidRequestException
- if the Raw
terms are not validprotected final ColumnDefinition toColumnDefinition(CFMetaData cfm, ColumnIdentifier.Raw entity) throws InvalidRequestException
cfm
- the column family meta dataentity
- the entity to convertInvalidRequestException
- if the entity cannot be recognizedCopyright © 2019 The Apache Software Foundation