org.sql.generation.api.grammar.builders.query.pgsql
Interface PgSQLQuerySpecificationBuilder

All Superinterfaces:
AbstractBuilder<QuerySpecification>, QuerySpecificationBuilder

public interface PgSQLQuerySpecificationBuilder
extends QuerySpecificationBuilder

Builder to build query specifications with extra elements that are added by PostgreSQL.

Author:
Stanislav Muhametsin
See Also:
QuerySpecificationBuilder

Method Summary
 PgSQLQuerySpecification createExpression()
          Returns the expression which was being built by this builder.
 PgSQLQuerySpecificationBuilder limit(LimitClause limit)
          Sets the LIMIT value of this SELECT statement
 PgSQLQuerySpecificationBuilder offset(OffsetClause offset)
          Sets the OFFSET value of this SELECT statement.
 PgSQLQuerySpecificationBuilder setFrom(FromBuilder builder)
          Sets the builder for FROM clause of this SELECT statement.
 PgSQLQuerySpecificationBuilder setGroupBy(GroupByBuilder builder)
          Sets the builder for GROUP BY clause of this SELECT statement.
 PgSQLQuerySpecificationBuilder setHaving(BooleanBuilder builder)
          Sets the builder for grouping condition in HAVING clause of this SELECT statement.
 PgSQLQuerySpecificationBuilder setOrderBy(OrderByBuilder builder)
          Sets the builder for ORDER BY clause of this SELECT statement.
 PgSQLQuerySpecificationBuilder setOrderByToFirstColumnIfOffsetOrLimit()
          Helper method to add the first column of this SELECT statement to ORDER BY clause, if LIMIT or OFFSET clause is present.
 PgSQLQuerySpecificationBuilder setSelect(ColumnsBuilder builder)
          Sets the builder for columns in SELECT statement.
 PgSQLQuerySpecificationBuilder setWhere(BooleanBuilder builder)
          Sets the builder for search condition in WHERE clause of this SELECT statement.
 PgSQLQuerySpecificationBuilder trimGroupBy()
          Checks that all selected columns are in GROUP BY clause.
 
Methods inherited from interface org.sql.generation.api.grammar.builders.query.QuerySpecificationBuilder
getFrom, getGroupBy, getHaving, getOrderBy, getSelect, getWhere
 

Method Detail

offset

PgSQLQuerySpecificationBuilder offset(OffsetClause offset)
Sets the OFFSET value of this SELECT statement.

Parameters:
offset - The offset for this SELECT statement.
Returns:
This builder.

limit

PgSQLQuerySpecificationBuilder limit(LimitClause limit)
Sets the LIMIT value of this SELECT statement

Parameters:
limit - The limit (maximum amount of results) for this SELECT statement.
Returns:
This builder.

setOrderByToFirstColumnIfOffsetOrLimit

PgSQLQuerySpecificationBuilder setOrderByToFirstColumnIfOffsetOrLimit()
Helper method to add the first column of this SELECT statement to ORDER BY clause, if LIMIT or OFFSET clause is present. Calling this method on a SELECT * query has no effect.

Returns:
This builder.

createExpression

PgSQLQuerySpecification createExpression()
Description copied from interface: AbstractBuilder
Returns the expression which was being built by this builder.

Specified by:
createExpression in interface AbstractBuilder<QuerySpecification>
Returns:
The expression built by this builder.

trimGroupBy

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

Specified by:
trimGroupBy in interface QuerySpecificationBuilder
Returns:
This builder.

setSelect

PgSQLQuerySpecificationBuilder setSelect(ColumnsBuilder builder)
Description copied from interface: QuerySpecificationBuilder
Sets the builder for columns in SELECT statement.

Specified by:
setSelect in interface QuerySpecificationBuilder
Returns:
This builder.

setFrom

PgSQLQuerySpecificationBuilder setFrom(FromBuilder builder)
Description copied from interface: QuerySpecificationBuilder
Sets the builder for FROM clause of this SELECT statement.

Specified by:
setFrom in interface QuerySpecificationBuilder
Returns:
This builder.

setWhere

PgSQLQuerySpecificationBuilder setWhere(BooleanBuilder builder)
Description copied from interface: QuerySpecificationBuilder
Sets the builder for search condition in WHERE clause of this SELECT statement.

Specified by:
setWhere in interface QuerySpecificationBuilder
Returns:
This builder.

setGroupBy

PgSQLQuerySpecificationBuilder setGroupBy(GroupByBuilder builder)
Description copied from interface: QuerySpecificationBuilder
Sets the builder for GROUP BY clause of this SELECT statement.

Specified by:
setGroupBy in interface QuerySpecificationBuilder
Returns:
This builder.

setHaving

PgSQLQuerySpecificationBuilder setHaving(BooleanBuilder builder)
Description copied from interface: QuerySpecificationBuilder
Sets the builder for grouping condition in HAVING clause of this SELECT statement.

Specified by:
setHaving in interface QuerySpecificationBuilder
Returns:
This builder.

setOrderBy

PgSQLQuerySpecificationBuilder setOrderBy(OrderByBuilder builder)
Description copied from interface: QuerySpecificationBuilder
Sets the builder for ORDER BY clause of this SELECT statement.

Specified by:
setOrderBy in interface QuerySpecificationBuilder
Returns:
This builder.


Copyright © 2010-2011. All Rights Reserved.