org.openrdf.sail.rdbms.algebra
Class SelectQuery

java.lang.Object
  extended by org.openrdf.query.algebra.QueryModelNodeBase
      extended by org.openrdf.sail.rdbms.algebra.base.RdbmsQueryModelNodeBase
          extended by org.openrdf.sail.rdbms.algebra.SelectQuery
All Implemented Interfaces:
Cloneable, QueryModelNode, TupleExpr

public class SelectQuery
extends RdbmsQueryModelNodeBase
implements TupleExpr

An SQL query.

Author:
James Leigh

Nested Class Summary
static class SelectQuery.OrderElem
           
 
Constructor Summary
SelectQuery()
           
 
Method Summary
 void addFilter(SqlExpr sql)
           
 void addJoin(SelectQuery right)
           
 void addLeftJoin(SelectQuery right)
           
 void addOrder(SqlExpr order, boolean isAscending)
           
 void addSqlSelectVar(SelectProjection node)
           
 SelectQuery clone()
          Returns a (deep) clone of this query model node.
 String getBindingName(ColumnVar var)
           
 Set<String> getBindingNames()
          Gets the names of the bindings that are, or can be, returned by this tuple expression when it is evaluated.
 List<SqlExpr> getFilters()
           
 FromItem getFrom()
           
 FromItem getFromItem(String alias)
           
 Integer getLimit()
           
 Integer getOffset()
           
 List<SelectQuery.OrderElem> getOrderElems()
           
 Collection<ColumnVar> getProjections()
           
 SelectProjection getSelectProjection(String name)
           
 Collection<SelectProjection> getSqlSelectVar()
           
 ColumnVar getVar(String varName)
           
 Map<String,ColumnVar> getVarMap()
           
 Collection<ColumnVar> getVars()
           
 boolean hasSqlSelectVar(SelectProjection node)
           
 boolean isComplex()
           
 boolean isDistinct()
           
 void removeFilter(SqlExpr sqlExpr)
           
 void replaceChildNode(QueryModelNode current, QueryModelNode replacement)
          Default implementation of QueryModelNode.replaceChildNode(QueryModelNode, QueryModelNode) that throws an IllegalArgumentException indicating that current is not a child node of this node.
 void setBindingNames(Map<String,String> bindingNames)
           
 void setDistinct(boolean b)
           
 void setFrom(FromItem from)
           
 void setLimit(Integer limit)
           
 void setOffset(Integer offset)
           
 void setSqlSelectVar(Collection<SelectProjection> projections)
           
<X extends Exception>
void
visit(RdbmsQueryModelVisitorBase<X> visitor)
           
<X extends Exception>
void
visitChildren(QueryModelVisitor<X> visitor)
          Dummy implementation of QueryModelNode.visitChildren(org.openrdf.query.algebra.QueryModelVisitor) that does nothing.
 
Methods inherited from class org.openrdf.sail.rdbms.algebra.base.RdbmsQueryModelNodeBase
visit
 
Methods inherited from class org.openrdf.query.algebra.QueryModelNodeBase
getParentNode, getSignature, replaceWith, setParentNode, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openrdf.query.algebra.QueryModelNode
getParentNode, getSignature, replaceWith, setParentNode, toString, visit
 

Constructor Detail

SelectQuery

public SelectQuery()
Method Detail

isDistinct

public boolean isDistinct()

setDistinct

public void setDistinct(boolean b)

isComplex

public boolean isComplex()

getFrom

public FromItem getFrom()

setFrom

public void setFrom(FromItem from)

getOrderElems

public List<SelectQuery.OrderElem> getOrderElems()

addOrder

public void addOrder(SqlExpr order,
                     boolean isAscending)

getOffset

public Integer getOffset()

setOffset

public void setOffset(Integer offset)

getLimit

public Integer getLimit()

setLimit

public void setLimit(Integer limit)

getBindingName

public String getBindingName(ColumnVar var)

getBindingNames

public Set<String> getBindingNames()
Description copied from interface: TupleExpr
Gets the names of the bindings that are, or can be, returned by this tuple expression when it is evaluated.

Specified by:
getBindingNames in interface TupleExpr
Returns:
A set of binding names.

setBindingNames

public void setBindingNames(Map<String,String> bindingNames)

getSqlSelectVar

public Collection<SelectProjection> getSqlSelectVar()

setSqlSelectVar

public void setSqlSelectVar(Collection<SelectProjection> projections)

getSelectProjection

public SelectProjection getSelectProjection(String name)

replaceChildNode

public void replaceChildNode(QueryModelNode current,
                             QueryModelNode replacement)
Description copied from class: QueryModelNodeBase
Default implementation of QueryModelNode.replaceChildNode(QueryModelNode, QueryModelNode) that throws an IllegalArgumentException indicating that current is not a child node of this node.

Specified by:
replaceChildNode in interface QueryModelNode
Overrides:
replaceChildNode in class QueryModelNodeBase
Parameters:
current - The current child node.
replacement - The new child node.

visitChildren

public <X extends Exception> void visitChildren(QueryModelVisitor<X> visitor)
                   throws X extends Exception
Description copied from class: QueryModelNodeBase
Dummy implementation of QueryModelNode.visitChildren(org.openrdf.query.algebra.QueryModelVisitor) that does nothing. Subclasses should override this method when they have child nodes.

Specified by:
visitChildren in interface QueryModelNode
Overrides:
visitChildren in class QueryModelNodeBase
Throws:
X extends Exception

clone

public SelectQuery clone()
Description copied from interface: QueryModelNode
Returns a (deep) clone of this query model node. This method recursively clones the entire node tree, starting from this nodes.

Specified by:
clone in interface QueryModelNode
Specified by:
clone in interface TupleExpr
Overrides:
clone in class QueryModelNodeBase
Returns:
A deep clone of this query model node.

visit

public <X extends Exception> void visit(RdbmsQueryModelVisitorBase<X> visitor)
           throws X extends Exception
Specified by:
visit in class RdbmsQueryModelNodeBase
Throws:
X extends Exception

hasSqlSelectVar

public boolean hasSqlSelectVar(SelectProjection node)

addSqlSelectVar

public void addSqlSelectVar(SelectProjection node)

getProjections

public Collection<ColumnVar> getProjections()

getVars

public Collection<ColumnVar> getVars()

getVar

public ColumnVar getVar(String varName)

addFilter

public void addFilter(SqlExpr sql)

addJoin

public void addJoin(SelectQuery right)

addLeftJoin

public void addLeftJoin(SelectQuery right)

getFromItem

public FromItem getFromItem(String alias)

getFilters

public List<SqlExpr> getFilters()

removeFilter

public void removeFilter(SqlExpr sqlExpr)

getVarMap

public Map<String,ColumnVar> getVarMap()


Copyright © 2001-2008 Aduna. All Rights Reserved.