com.onewebsql.query
Class Subselect

java.lang.Object
  extended by com.onewebsql.query.Exp
      extended by com.onewebsql.query.AExp
          extended by com.onewebsql.query.Subselect
All Implemented Interfaces:
Expression, TableReference

public class Subselect
extends AExp
implements TableReference

Represents a subquery (SELECT .... FROM (SELECT ....))


Field Summary
protected  SelectQuery query
          Subquery
 
Fields inherited from class com.onewebsql.query.AExp
expression, value
 
Fields inherited from class com.onewebsql.query.Exp
brackets, left, operator, right
 
Fields inherited from interface com.onewebsql.query.Expression
COMMA, DOT, LB, QUESTION_MARK, RB, SPACE
 
Constructor Summary
Subselect(SelectQuery query)
          Constructor.
 
Method Summary
 AExp alias(String tableAlias, String columnAlias)
          Returns an expression which represents a reference to the expression using the specified table/column alias.
 void build(StringBuilder sb, String schemaName, List<Value> objs, DBAdapter adapter)
          Builds the text of the query (or a part of it) represented by this object.
 List<Column> getColumns()
          Returns the list of columns retrieved by this subquery.
 
Methods inherited from class com.onewebsql.query.AExp
add, add, add, add, add, add, add, add, add, all, any, between, between, between, between, between, between, between, between, between, between, between, between, between, br, div, div, div, div, div, div, div, div, div, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, equals, exp, exp, exp, exp, exp, exp, exp, exp, exp, exp, exp, exp, exp, exp, exp, exp, exp, exp, fun, fun, ge, ge, ge, ge, ge, ge, ge, ge, ge, ge, ge, ge, ge, getValue, gt, gt, gt, gt, gt, gt, gt, gt, gt, gt, gt, gt, gt, hashCode, ilike, ilike, in, in, inIds, inIds, inValues, le, le, le, le, le, le, le, le, le, le, le, le, le, like, like, lt, lt, lt, lt, lt, lt, lt, lt, lt, lt, lt, lt, lt, mul, mul, mul, mul, mul, mul, mul, mul, mul, ne, ne, ne, ne, ne, ne, ne, ne, ne, ne, ne, ne, ne, ne, ne, ne, neg, some, sub, sub, sub, sub, sub, sub, sub, sub, sub, toString
 
Methods inherited from class com.onewebsql.query.Exp
aliasColumn, aliasTable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

query

protected SelectQuery query
Subquery

Constructor Detail

Subselect

public Subselect(SelectQuery query)
Constructor.

Parameters:
query - subquery
Method Detail

getColumns

public List<Column> getColumns()
Returns the list of columns retrieved by this subquery.

Specified by:
getColumns in interface TableReference
Returns:
list of columns retrieved by this subquery

build

public void build(StringBuilder sb,
                  String schemaName,
                  List<Value> objs,
                  DBAdapter adapter)
Description copied from interface: Expression
Builds the text of the query (or a part of it) represented by this object.

Specified by:
build in interface Expression
Overrides:
build in class AExp
Parameters:
sb - StringBuilder to build the query text
schemaName - name of the database schema used to build the query
objs - an accumulator list to which query parameters are appended
adapter - database adapter which builds builds query in a way specific to the database engine

alias

public AExp alias(String tableAlias,
                  String columnAlias)
Description copied from class: Exp
Returns an expression which represents a reference to the expression using the specified table/column alias.

Overrides:
alias in class AExp
Parameters:
tableAlias - table alias
columnAlias - column alias
Returns:
aliased expression


Copyright © 2011-2013 e-point SA. All Rights Reserved.