Interface Restriction
- All Known Subinterfaces:
Restrictions,SingleRestriction
- All Known Implementing Classes:
MultiColumnRestriction,MultiColumnRestriction.EQRestriction,MultiColumnRestriction.INRestriction,MultiColumnRestriction.InRestrictionWithMarker,MultiColumnRestriction.InRestrictionWithValues,MultiColumnRestriction.NotNullRestriction,MultiColumnRestriction.SliceRestriction,SingleColumnRestriction,SingleColumnRestriction.AnnRestriction,SingleColumnRestriction.ContainsRestriction,SingleColumnRestriction.EQRestriction,SingleColumnRestriction.INRestriction,SingleColumnRestriction.InRestrictionWithMarker,SingleColumnRestriction.InRestrictionWithValues,SingleColumnRestriction.IsNotNullRestriction,SingleColumnRestriction.LikeRestriction,SingleColumnRestriction.SliceRestriction,TokenRestriction,TokenRestriction.EQRestriction,TokenRestriction.SliceRestriction
public interface Restriction
Implementation of this class must be immutable.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddFunctionsTo(List<Function> functions) Adds all functions (native and user-defined) used by any component of the restriction to the specified list.voidaddToRowFilter(RowFilter filter, IndexRegistry indexRegistry, QueryOptions options) Adds to the specified row filter the expressions corresponding to thisRestriction.findSupportingIndex(IndexRegistry indexRegistry) Find first supporting index for current restrictionfindSupportingIndexFromQueryPlan(Index.QueryPlan indexQueryPlan) Find the first supporting index for the current restriction from anIndex.QueryPlan.Returns the column definitions in position order.Returns the definition of the first column.Returns the definition of the last column.booleanhasSupportingIndex(IndexRegistry indexRegistry) Check if the restriction is on indexed columns.default booleanbooleanneedsFiltering(Index.Group indexGroup) Returns whether this restriction would need filtering if the specified index group were used.
-
Method Details
-
isOnToken
default boolean isOnToken() -
getFirstColumn
ColumnMetadata getFirstColumn()Returns the definition of the first column.- Returns:
- the definition of the first column.
-
getLastColumn
ColumnMetadata getLastColumn()Returns the definition of the last column.- Returns:
- the definition of the last column.
-
getColumnDefs
List<ColumnMetadata> getColumnDefs()Returns the column definitions in position order.- Returns:
- the column definitions in position order.
-
addFunctionsTo
Adds all functions (native and user-defined) used by any component of the restriction to the specified list.- Parameters:
functions- the list to add to
-
hasSupportingIndex
Check if the restriction is on indexed columns.- Parameters:
indexRegistry- the index registry- Returns:
trueif the restriction is on indexed columns,false
-
findSupportingIndex
Find first supporting index for current restriction- Parameters:
indexRegistry- the index registry- Returns:
indexif the restriction is on indexed columns,null
-
findSupportingIndexFromQueryPlan
Find the first supporting index for the current restriction from anIndex.QueryPlan.- Parameters:
indexQueryPlan- the index query plan- Returns:
indexif the restriction is on indexed columns,null
-
needsFiltering
Returns whether this restriction would need filtering if the specified index group were used.- Parameters:
indexGroup- an index group- Returns:
trueif this would need filtering ifindexGroupwere used,falseotherwise
-
addToRowFilter
Adds to the specified row filter the expressions corresponding to thisRestriction.- Parameters:
filter- the row filter to add expressions toindexRegistry- the index registryoptions- the query options
-