org.sql.generation.api.grammar.builders.query
Interface QuerySpecificationBuilder

All Superinterfaces:
AbstractBuilder<QuerySpecification>
All Known Subinterfaces:
PgSQLQuerySpecificationBuilder

public interface QuerySpecificationBuilder
extends AbstractBuilder<QuerySpecification>

This builder builds a single SELECT query. It acts as an aggregator for ColumnsBuilder for columns in SELECT, FromBuilder for tables in FROM clause, BooleanBuilder for search condition in WHERE clause, GroupByBuilder for GROUP BY clause, another BooleanBuilder for grouping conditions in HAVING clause, and finally OrderByBuilder for ORDER BY clause.

Author:
Stanislav Muhametsin
See Also:
QuerySpecification

Method Summary
 FromBuilder getFrom()
          Gets the builder for FROM clause of this SELECT statement.
 GroupByBuilder getGroupBy()
          Gets the builder for GROUP BY clause of this SELECT statement.
 BooleanBuilder getHaving()
          Gets the builder for grouping condition in HAVING clause of this SELECT statement.
 OrderByBuilder getOrderBy()
          Gets the builder for ORDER BY clause of this SELECT statement.
 ColumnsBuilder getSelect()
          Gets the builder for columns in this SELECT statement.
 BooleanBuilder getWhere()
          Gets the builder for search condition in WHERE clause of this SELECT statement.
 QuerySpecificationBuilder setFrom(FromBuilder builder)
          Sets the builder for FROM clause of this SELECT statement.
 QuerySpecificationBuilder setGroupBy(GroupByBuilder builder)
          Sets the builder for GROUP BY clause of this SELECT statement.
 QuerySpecificationBuilder setHaving(BooleanBuilder builder)
          Sets the builder for grouping condition in HAVING clause of this SELECT statement.
 QuerySpecificationBuilder setOrderBy(OrderByBuilder builder)
          Sets the builder for ORDER BY clause of this SELECT statement.
 QuerySpecificationBuilder setSelect(ColumnsBuilder builder)
          Sets the builder for columns in SELECT statement.
 QuerySpecificationBuilder setWhere(BooleanBuilder builder)
          Sets the builder for search condition in WHERE clause of this SELECT statement.
 QuerySpecificationBuilder trimGroupBy()
          Checks that all selected columns are in GROUP BY clause.
 
Methods inherited from interface org.sql.generation.api.grammar.builders.AbstractBuilder
createExpression
 

Method Detail

getSelect

ColumnsBuilder getSelect()
Gets the builder for columns in this SELECT statement.

Returns:
The builder for columns in this SELECT statement.

getFrom

FromBuilder getFrom()
Gets the builder for FROM clause of this SELECT statement.

Returns:
The builder for FROM clause of this SELECT statement.

getWhere

BooleanBuilder getWhere()
Gets the builder for search condition in WHERE clause of this SELECT statement.

Returns:
The builder for search condition in WHERE clause of this SELECT statement.

getGroupBy

GroupByBuilder getGroupBy()
Gets the builder for GROUP BY clause of this SELECT statement.

Returns:
The builder for GROUP BY clause of this SELECT statement.

getHaving

BooleanBuilder getHaving()
Gets the builder for grouping condition in HAVING clause of this SELECT statement.

Returns:
The builder for grouping condition in HAVING clause of this SELECT statement.

getOrderBy

OrderByBuilder getOrderBy()
Gets the builder for ORDER BY clause of this SELECT statement.

Returns:
The builder for ORDER BY clause of this SELECT statement.

trimGroupBy

QuerySpecificationBuilder trimGroupBy()
Checks that all selected columns are in GROUP BY clause. If they are not, it adds them as last columns of GROUP BY clause.

Returns:
This builder.

setSelect

QuerySpecificationBuilder setSelect(ColumnsBuilder builder)
Sets the builder for columns in SELECT statement.

Returns:
This builder.

setFrom

QuerySpecificationBuilder setFrom(FromBuilder builder)
Sets the builder for FROM clause of this SELECT statement.

Returns:
This builder.

setWhere

QuerySpecificationBuilder setWhere(BooleanBuilder builder)
Sets the builder for search condition in WHERE clause of this SELECT statement.

Returns:
This builder.

setGroupBy

QuerySpecificationBuilder setGroupBy(GroupByBuilder builder)
Sets the builder for GROUP BY clause of this SELECT statement.

Returns:
This builder.

setHaving

QuerySpecificationBuilder setHaving(BooleanBuilder builder)
Sets the builder for grouping condition in HAVING clause of this SELECT statement.

Returns:
This builder.

setOrderBy

QuerySpecificationBuilder setOrderBy(OrderByBuilder builder)
Sets the builder for ORDER BY clause of this SELECT statement.

Returns:
This builder.


Copyright © 2010-2011. All Rights Reserved.