org.objectweb.medor.query.api

Interface QueryNode

All Superinterfaces:
Cloneable, FilteredQueryTree, QueryTree
Known Subinterfaces:
NestQueryNode, UnnestQueryNode
Known Implementing Classes:
AggregateRdbQueryNode, BasicQueryNode, Cartesian, Intersection, JoinProject, Nest, Project, SelectProject, Union, Unnest

public interface QueryNode
extends FilteredQueryTree

Author:
Sebastien Chassande-Barrioz

Method Summary

CalculatedField
addCalculatedField(String name, PType type, Expression exp)
Creates and adds a CalculatedField to the TupleStructure of the QueryNode.
PropagatedField
addPropagatedField(String name, PType type, QueryTreeField anc)
Creates and adds a PropagatedField to the TupleStructure of the QueryNode.
QueryTree[]
getChildren()
It retreives the array of the QueryTree used by this QueryNode.
TupleLoader
getTupleLoader()
Returns the TupleLoader currently associated with this QueryNode.
short
getType()
It retrieves the operation type of the current QueryNode.
boolean
isOuter(QueryTree child)
Indicates whether a row of nulls should be inserted for the given child if the filter condition fails for all rows in that child.
QueryTreeField
removeField(String name)
Removes a Field.
QueryTreeField
replace(QueryTreeField old, QueryTreeField neo)
void
setOuter(QueryTree child, boolean outer)
void
setTupleLoader(TupleLoader loader)
Associates a TupleLoader with this QueryNode.
void
updateCalculatedField(String name, Expression e)
void
updatePropagatedField(String name, QueryTreeField previous)

Methods inherited from interface org.objectweb.medor.query.api.FilteredQueryTree

getQueryFilter, setQueryFilter

Methods inherited from interface org.objectweb.medor.query.api.QueryTree

getDistinct, getName, getOrderBy, getTupleStructure, setDistinct, setOrderBy

Method Details

addCalculatedField

public CalculatedField addCalculatedField(String name,
                                          PType type,
                                          Expression exp)
            throws MedorException
Creates and adds a CalculatedField to the TupleStructure of the QueryNode.

Parameters:
name - is the name of the Field to be added.
type - is the PType of the Field to be added.
exp - is the Expression for calculating the new Field.

Returns:
the newly created CalculatedField

Throws:
MedorException - when a Field with the same name already exists.


addPropagatedField

public PropagatedField addPropagatedField(String name,
                                          PType type,
                                          QueryTreeField anc)
            throws MedorException
Creates and adds a PropagatedField to the TupleStructure of the QueryNode.

Parameters:
name - is the name of the Field to be added. If null, the name is computed from the origin Fields (parameter anc).
type - is the PType of the Field to be added. If null, the type is computed from the origin Fields (parameter anc).
anc - are the origin Fields for the PropagatedField to be created.

Returns:
the newly created PropagatedField

Throws:
MedorException - when a Field with the same name already exists.


getChildren

public QueryTree[] getChildren()
It retreives the array of the QueryTree used by this QueryNode.


getTupleLoader

public TupleLoader getTupleLoader()
Returns the TupleLoader currently associated with this QueryNode. Note that TupleLoaders are only used at evaluation time.


getType

public short getType()
It retrieves the operation type of the current QueryNode.


isOuter

public boolean isOuter(QueryTree child)
Indicates whether a row of nulls should be inserted for the given child if the filter condition fails for all rows in that child.


removeField

public QueryTreeField removeField(String name)
            throws MedorException
Removes a Field.

Parameters:
name - is the name of the Field to be removed.

Returns:
the Field which has been removed, or null if no such Field could be removed.

Throws:
MedorException - when no Field with such name exist.


replace

public QueryTreeField replace(QueryTreeField old,
                              QueryTreeField neo)


setOuter

public void setOuter(QueryTree child,
                     boolean outer)


setTupleLoader

public void setTupleLoader(TupleLoader loader)
Associates a TupleLoader with this QueryNode.


updateCalculatedField

public void updateCalculatedField(String name,
                                  Expression e)
            throws MedorException


updatePropagatedField

public void updatePropagatedField(String name,
                                  QueryTreeField previous)
            throws MedorException