Class SelectWithOffsetLimitCommand.Builder
java.lang.Object
com.atlassian.confluence.upgrade.dml.SelectWithOffsetLimitCommand.Builder
- Enclosing class:
- SelectWithOffsetLimitCommand
Builds a
SelectWithOffsetLimitCommand
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet the arguments to be substituted into the query.build()
Builds aSelectWithOffsetLimitCommand
Set the content of the "from" clause.Set the content of the "group by" clause.Set the content of the "having" clause.insertInto
(String insertStatement) Set the insert into statement resulting in an "insert into ...limit
(long limit) Set the maximum number of rows returned by the query.offset
(long offset) Set the offset of the results returned by the query.Set the content of the "order by" clause.Set the list of columns to select.Set the content of the "where" clause.
-
Constructor Details
-
Builder
public Builder(com.atlassian.config.db.HibernateConfig hibernateConfig)
-
-
Method Details
-
insertInto
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
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
- See Also:
-
from
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
Set the content of the "where" clause. Optional.- Parameters:
whereClause
- the "where" clause, without the word "where"- Returns:
- this builder
-
groupBy
Set the content of the "group by" clause. Optional.- Parameters:
groupByClause
- the "group by" clause without the words "group by"- Returns:
- this builder
-
having
Set the content of the "having" clause. Optional.- Parameters:
havingClause
- the "having" clause, without the word "having"- Returns:
- this builder
-
orderBy
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
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
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
Set the arguments to be substituted into the query. Optional - defaults to an empty list.- Parameters:
arguments
- the argument list- Returns:
- this builder
-
build
Builds aSelectWithOffsetLimitCommand
- Returns:
- a new
SelectWithOffsetLimitCommand
with the specified fields - Throws:
IllegalArgumentException
- if any required fields were not set
-