public class SQLSelectBuilder extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SQLSelectBuilder.OrderDirection
The direction of an sort order in SQL order by clause.
|
Constructor and Description |
---|
SQLSelectBuilder(java.lang.String table) |
Modifier and Type | Method and Description |
---|---|
void |
addGroupBy(java.lang.String column) |
void |
addJoin(JoinClause clause) |
void |
addOrderBy(java.lang.String column,
SQLSelectBuilder.OrderDirection direction) |
void |
addSelectColumn(java.lang.String column) |
void |
addSelectColumns(java.lang.String[] columns) |
void |
addWhereClause(WhereClause clause) |
void |
clearWhereClauses()
clear the currently set list of where clauses
|
long |
getRecordCount(org.springframework.jdbc.core.JdbcTemplate template) |
long |
getRecordCount(org.springframework.jdbc.core.JdbcTemplate template,
java.lang.String type) |
java.lang.Object[] |
getValues() |
int[] |
getValueTypes() |
int |
getWhereClauseCount() |
void |
setLimits(Limits limits) |
void |
setMaxItems(int maxItems) |
void |
setStartItem(int startItem) |
java.lang.String |
toSQLString() |
java.lang.String |
toSQLString(java.lang.String type) |
public SQLSelectBuilder(java.lang.String table)
table
- public void clearWhereClauses()
public int getWhereClauseCount()
public void addJoin(JoinClause clause)
clause
- public void addGroupBy(java.lang.String column)
column
- public void setStartItem(int startItem)
startItem
- the startItem to set, negative value disables limitpublic void setMaxItems(int maxItems)
maxItems
- the maxItems to set, negative value disables limitpublic long getRecordCount(org.springframework.jdbc.core.JdbcTemplate template)
template
- to use for retrievalpublic long getRecordCount(org.springframework.jdbc.core.JdbcTemplate template, java.lang.String type)
template
- type
- public int[] getValueTypes()
public java.lang.Object[] getValues()
public java.lang.String toSQLString()
public java.lang.String toSQLString(java.lang.String type)
type
- Limits
public void addOrderBy(java.lang.String column, SQLSelectBuilder.OrderDirection direction)
column
- null column name is accepted, though it equals to random sort orderdirection
- public void addWhereClause(WhereClause clause)
clause
- public void addSelectColumn(java.lang.String column)
column
- public void addSelectColumns(java.lang.String[] columns)
columns
- Copyright © 2015 Tampere University of Technology, Pori Department.