public abstract class Relation extends Object implements RelationalOperators
| Modifier and Type | Field and Description |
|---|---|
static Relation |
EMPTY |
static int |
NO_LIMIT |
static Relation |
TRUE |
DUMMY| Constructor and Description |
|---|
Relation() |
| Modifier and Type | Method and Description |
|---|---|
abstract AliasMap |
aliases()
The tables that are used to set up this relation, both in
their aliased form, and with their original physical names.
|
Set<Attribute> |
allKnownAttributes() |
static int |
combineLimits(int limit1,
int limit2) |
abstract Expression |
condition()
An expression that must be satisfied for all tuples in the
relation.
|
static Relation |
createSimpleRelation(ConnectedDB database,
Attribute[] attributes) |
abstract ConnectedDB |
database() |
boolean |
isTrivial() |
abstract boolean |
isUnique() |
abstract Set<Join> |
joinConditions()
Returns the join conditions that must hold between the tables
in the relation.
|
abstract int |
limit()
The limit clause for the SQL result set
|
abstract int |
limitInverse()
The limit clause for the SQL result set describing the inverse relation
|
abstract List<OrderSpec> |
orderSpecs()
The expressions (and ascending/descending flag) used for ordering
the relation.
|
abstract Set<ProjectionSpec> |
projections()
The attributes or expressions that the relation is projected to.
|
abstract Expression |
softCondition()
An expression satisfied by all tuples in the relation.
|
Set<RelationName> |
tables() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitproject, renameColumns, selectpublic static final int NO_LIMIT
public static Relation EMPTY
public static Relation TRUE
public static Relation createSimpleRelation(ConnectedDB database, Attribute[] attributes)
public abstract ConnectedDB database()
public abstract AliasMap aliases()
public abstract Set<Join> joinConditions()
Joinspublic abstract Expression condition()
Expression.TRUE indicates no conditionpublic abstract Expression softCondition()
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.Expression.TRUE indicates no soft conditionpublic abstract Set<ProjectionSpec> projections()
ProjectionSpecspublic abstract boolean isUnique()
public abstract List<OrderSpec> orderSpecs()
public abstract int limit()
public abstract int limitInverse()
public Set<RelationName> tables()
public boolean isTrivial()
true if this is the trivial table (one row, no columns)public static int combineLimits(int limit1,
int limit2)