public class CmsSelectQuery extends java.lang.Object implements I_CmsQueryFragment
Modifier and Type | Class and Description |
---|---|
class |
CmsSelectQuery.TableAlias
Helper class which wraps a table alias.
|
Constructor and Description |
---|
CmsSelectQuery()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addClause(I_CmsQueryFragment clause)
Adds another clause to the query.
|
void |
addColumn(I_CmsQueryFragment node)
Adds an expression which should be added as a column in the result set.
|
void |
addColumn(java.lang.String column)
Adds an expression which should be added as a column in the result set.
|
void |
addCondition(I_CmsQueryFragment node)
Adds a new condition to the query.
|
void |
addCondition(java.lang.String fragment,
java.lang.Object... params)
Adds a new condition to the query.
|
void |
addTable(java.lang.String table)
Adds a table to the query's FROM clause.
|
CmsSelectQuery.TableAlias |
addTable(java.lang.String table,
java.lang.String aliasPrefix)
Adds a table the query's FROM clause.
|
I_CmsQueryFragment |
getOrdering()
Returns the fragment for the ORDER BY clause.
|
void |
setOrdering(java.lang.String ordering)
Sets the SQL used for the ORDER BY clause.
|
void |
visit(CmsStatementBuilder builder)
Generates the SQL and parameters and sends them to the statement builder .
|
public CmsSelectQuery()
public void addClause(I_CmsQueryFragment clause)
clause
- the clause to addpublic void addColumn(I_CmsQueryFragment node)
node
- the expression which should be added as a columnpublic void addColumn(java.lang.String column)
column
- the expression which should be added as a columnpublic void addCondition(I_CmsQueryFragment node)
node
- the condition to add to the querypublic void addCondition(java.lang.String fragment, java.lang.Object... params)
fragment
- the condition SQLparams
- the condition parameterspublic void addTable(java.lang.String table)
table
- the table to addpublic CmsSelectQuery.TableAlias addTable(java.lang.String table, java.lang.String aliasPrefix)
table
- the table to addaliasPrefix
- the prefix used to generate the aliaspublic I_CmsQueryFragment getOrdering()
public void setOrdering(java.lang.String ordering)
ordering
- the SQL used for the ORDER BY clausepublic void visit(CmsStatementBuilder builder)
I_CmsQueryFragment
visit
in interface I_CmsQueryFragment
builder
- the statement builderI_CmsQueryFragment.visit(org.opencms.db.CmsStatementBuilder)