public class RelationImpl extends Relation
DUMMY
Constructor and Description |
---|
RelationImpl(ConnectedDB database,
AliasMap aliases,
Expression condition,
Expression softCondition,
Set<Join> joinConditions,
Set<ProjectionSpec> projections,
boolean isUnique,
List<OrderSpec> orderSpecs,
int limit,
int limitInverse) |
Modifier and Type | Method and Description |
---|---|
AliasMap |
aliases()
The tables that are used to set up this relation, both in
their aliased form, and with their original physical names.
|
Expression |
condition()
An expression that must be satisfied for all tuples in the
relation.
|
ConnectedDB |
database() |
boolean |
isUnique() |
Set<Join> |
joinConditions()
Returns the join conditions that must hold between the tables
in the relation.
|
int |
limit()
The limit clause for the SQL result set
|
int |
limitInverse()
The limit clause for the SQL result set describing the inverse relation
|
List<OrderSpec> |
orderSpecs()
The expressions (and ascending/descending flag) used for ordering
the relation.
|
Relation |
project(Set<? extends ProjectionSpec> projectionSpecs)
Applies the projection operator to this relation.
|
Set<ProjectionSpec> |
projections()
The attributes or expressions that the relation is projected to.
|
Relation |
renameColumns(ColumnRenamer renames)
Applies the rename operator to this relation.
|
Relation |
select(Expression selectCondition)
Applies the selection operator to this relation.
|
Expression |
softCondition()
An expression satisfied by all tuples in the relation.
|
String |
toString() |
allKnownAttributes, combineLimits, createSimpleRelation, isTrivial, tables
public RelationImpl(ConnectedDB database, AliasMap aliases, Expression condition, Expression softCondition, Set<Join> joinConditions, Set<ProjectionSpec> projections, boolean isUnique, List<OrderSpec> orderSpecs, int limit, int limitInverse)
public ConnectedDB database()
public AliasMap aliases()
Relation
public Expression condition()
Relation
condition
in class Relation
Expression.TRUE
indicates no conditionpublic Expression softCondition()
Relation
Expression.TRUE
does not change the contents of
the relation. It is thus just an optional condition that can
be used for optimization, but can be dropped or ignored if
convenient. Typically, there is other Java code that ensures the
condition regardless of whether it is present here or not.
We use this in particular for adding IS NOT NULL constraints
on all nullable columns that need to have a non-NULL value to form a
triple or binding.softCondition
in class Relation
Expression.TRUE
indicates no soft conditionpublic Set<Join> joinConditions()
Relation
joinConditions
in class Relation
Join
spublic Set<ProjectionSpec> projections()
Relation
projections
in class Relation
ProjectionSpec
spublic int limit()
Relation
public int limitInverse()
Relation
limitInverse
in class Relation
public List<OrderSpec> orderSpecs()
Relation
orderSpecs
in class Relation
public Relation select(Expression selectCondition)
RelationalOperators
Applies the selection operator to this relation. The new relation will contain only the tuples for which the expression evaluates to true.
Selection on attributes that don't exist in the relation are considered to be always false and will cause an empty relation.
selectCondition
- A boolean expressionpublic Relation renameColumns(ColumnRenamer renames)
RelationalOperators
Applies the rename operator to this relation.
Renames of attributes that don't exist in the relation are ignored.
renames
- A map from original to replacement namespublic Relation project(Set<? extends ProjectionSpec> projectionSpecs)
RelationalOperators
Applies the projection operator to this relation.
The new relation will contain only the attributes given as the argument.
projectionSpecs
- A set of ProjectionSpec
instances