saffron.ext
Class ExtentRel

java.lang.Object
  |
  +--saffron.rel.Rel
        |
        +--saffron.ext.ExtentRel

public class ExtentRel
extends Rel

ExtentRel represents all of the instances of a particular class (including subtypes).

It cannot be implemented as such, but can often be transformed into an expression which can. For example, in

JavaReflectConnection reflect;
 select
 from reflect.fields as field
 join reflect.classes as clazz
 on field.getDeclaringClass() == clazz &&
     clazz.getPackage().getName().equals("java.lang");
the field and clazz are constrained by join and filter conditions so that we can enumerate the required fields.

todo: Why is this not just a TableAccess?

See Also:
ExtentTable

Nested Class Summary
 
Nested classes inherited from class saffron.rel.Rel
 
Field Summary
private  Table table
           
 
Fields inherited from class saffron.rel.Rel
cluster, digest, id, rowType
 
Constructor Summary
ExtentRel(Cluster cluster, Type rowType, Table table)
          Creates an ExtentRel.
 
Method Summary
 Object clone()
           
protected  Type deriveRowType()
           
 void explain(PlanWriter pw)
           
protected  Table getTable()
          If this relational expression represents an access to a table, returns that table, otherwise returns null.
 boolean isDistinct()
          Returns whether the same value will not come out twice.
 
Methods inherited from class saffron.rel.Rel
childrenAccept, computeDigest, computeSelfCost, getChildExps, getCluster, getConvention, getCorelVariable, getEnvironment, getId, getInput, getInputs, getOrCreateCorelVariable, getParentEnv, getQualifier, getQuery, getRelTypeName, getRows, getRowType, getType, getVariablesStopped, implement, implementExp, implementExps, implementFieldAccess, implementSelf, isAccessTo, onRegister, recomputeDigest, register, registerCorelVariable, replaceInput, setCorelVariable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

table

private Table table
Constructor Detail

ExtentRel

public ExtentRel(Cluster cluster,
                 Type rowType,
                 Table table)
Creates an ExtentRel.

Pre-condition:
rowType != null, table != null
Method Detail

clone

public Object clone()
Specified by:
clone in class Rel

explain

public void explain(PlanWriter pw)
Overrides:
explain in class Rel

deriveRowType

protected Type deriveRowType()
Specified by:
deriveRowType in class Rel

isDistinct

public boolean isDistinct()
Description copied from class: Rel
Returns whether the same value will not come out twice. Default value is false, derived classes should override.

Overrides:
isDistinct in class Rel

getTable

protected Table getTable()
Description copied from class: Rel
If this relational expression represents an access to a table, returns that table, otherwise returns null.

Overrides:
getTable in class Rel

SourceForge.net_Logo