Class SelectWithOffsetLimitCommand.Builder
- java.lang.Object
-
- com.atlassian.confluence.upgrade.dml.SelectWithOffsetLimitCommand.Builder
-
- Enclosing class:
- SelectWithOffsetLimitCommand
public static class SelectWithOffsetLimitCommand.Builder extends Object
Builds aSelectWithOffsetLimitCommand
-
-
Constructor Summary
Constructors Constructor Description Builder(com.atlassian.config.db.HibernateConfig hibernateConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SelectWithOffsetLimitCommand.Builder
arguments(Object... arguments)
Set the arguments to be substituted into the query.SelectWithOffsetLimitCommand
build()
Builds aSelectWithOffsetLimitCommand
SelectWithOffsetLimitCommand.Builder
from(String fromClause)
Set the content of the "from" clause.SelectWithOffsetLimitCommand.Builder
groupBy(String groupByClause)
Set the content of the "group by" clause.SelectWithOffsetLimitCommand.Builder
having(String havingClause)
Set the content of the "having" clause.SelectWithOffsetLimitCommand.Builder
insertInto(String insertStatement)
Set the insert into statement resulting in an "insert into ...SelectWithOffsetLimitCommand.Builder
limit(long limit)
Set the maximum number of rows returned by the query.SelectWithOffsetLimitCommand.Builder
offset(long offset)
Set the offset of the results returned by the query.SelectWithOffsetLimitCommand.Builder
orderBy(String orderByClause)
Set the content of the "order by" clause.SelectWithOffsetLimitCommand.Builder
select(Iterable<String> selectColumns)
SelectWithOffsetLimitCommand.Builder
select(String... selectColumns)
Set the list of columns to select.SelectWithOffsetLimitCommand.Builder
where(String whereClause)
Set the content of the "where" clause.
-
-
-
Method Detail
-
insertInto
public SelectWithOffsetLimitCommand.Builder insertInto(String insertStatement)
Set the insert into statement resulting in an "insert into ... select" type of query- Parameters:
insertStatement
- the insert string including the table name and optionally the columns without the words "insert into"- Returns:
- this builder
-
select
public SelectWithOffsetLimitCommand.Builder select(String... selectColumns)
Set the list of columns to select. The default value results in aselect *
- Parameters:
selectColumns
- a list of columns to select- Returns:
- this builder
-
select
public SelectWithOffsetLimitCommand.Builder select(Iterable<String> selectColumns)
- See Also:
select(String...)
-
from
public SelectWithOffsetLimitCommand.Builder from(String fromClause)
Set the content of the "from" clause. This includes the table and any joins. Calling this is required.- Parameters:
fromClause
- the from clause, without the word "from"- Returns:
- this builder
- Throws:
IllegalArgumentException
- if the from clause is blank
-
where
public SelectWithOffsetLimitCommand.Builder where(String whereClause)
Set the content of the "where" clause. Optional.- Parameters:
whereClause
- the "where" clause, without the word "where"- Returns:
- this builder
-
groupBy
public SelectWithOffsetLimitCommand.Builder groupBy(String groupByClause)
Set the content of the "group by" clause. Optional.- Parameters:
groupByClause
- the "group by" clause without the words "group by"- Returns:
- this builder
-
having
public SelectWithOffsetLimitCommand.Builder having(String havingClause)
Set the content of the "having" clause. Optional.- Parameters:
havingClause
- the "having" clause, without the word "having"- Returns:
- this builder
-
orderBy
public SelectWithOffsetLimitCommand.Builder orderBy(String orderByClause)
Set the content of the "order by" clause. Calling this is required.- Parameters:
orderByClause
- the "order by" clause, without the words "order by"- Returns:
- this builder
- Throws:
IllegalArgumentException
- if the "order by" clause is blank
-
offset
public SelectWithOffsetLimitCommand.Builder offset(long offset)
Set the offset of the results returned by the query. Optional - defaults to 0.- Parameters:
offset
- the numeric offset, starting at 0- Returns:
- this builder
-
limit
public SelectWithOffsetLimitCommand.Builder limit(long limit)
Set the maximum number of rows returned by the query. Optional - defaults to returning all rows.- Parameters:
limit
- the maximum number of rows to return- Returns:
- this builder
-
arguments
public SelectWithOffsetLimitCommand.Builder arguments(Object... arguments)
Set the arguments to be substituted into the query. Optional - defaults to an empty list.- Parameters:
arguments
- the argument list- Returns:
- this builder
-
build
public SelectWithOffsetLimitCommand build()
Builds aSelectWithOffsetLimitCommand
- Returns:
- a new
SelectWithOffsetLimitCommand
with the specified fields - Throws:
IllegalArgumentException
- if any required fields were not set
-
-