QBSelect
Overview
QBSelect
is a wrapper for building SQL SELECT
queries in Servoy, providing a flexible API to add conditions, sorting, grouping, joins, and parameters to SQL-based queries. Through structured access to clauses like where
, groupBy
, and joins
, QBSelect
supports complex query construction and parameterized queries.
For detailed query building, see Query Builder in the Servoy documentation.
Properties Summarized
Get the aggregates clause from a query, used for aggregates that are not tied to a column.
Create an AND-condition to add conditions to.
Create an case searched expression.
Get all the columns of the datasource that can be used for this query (select or where clause)
Specifies a comment of the query.
Get the functions clause from a query, used for functions that are not tied to a column.
Get the group by clause from a query
Get the having-part of the query, used to add conditions.
Get the joins clause of this table based clause.
Create an OR-condition to add conditions to.
Get the named parameters from a query.
Get query builder parent table clause, this may be a query or a join clause.
Get the result part of the query, used to add result columns or values.
Get query builder parent.
Get the sorting part of the query.
Get the where-part of the query, used to add conditions.
Methods Summarized
Clear the having-part of the query.
Get an exists-condition from a subquery
Get a column from the table.
Get a column from the table with given alias.
Performs a sql query with a query builder object.
Performs a sql query with a query builder object.
Returns the datasource for this.
Returns a foundset object for a specified pk base query.
Get or create a parameter for the query, this used to parameterize queries.
Returns the internal SQL of the QBSelect.
Returns the internal SQL of the QBSelect.
Returns the parameters for the internal SQL of the QBSelect.
Returns the parameters for the internal SQL of the QBSelect.
Returns the table alias for this.
Create an inlined value.
Create an inlined value converted to the type of the column.
Create an inlined (quoted) value.
Create an negated condition.
Create an negated condition.
Properties Detailed
aggregates
Get the aggregates clause from a query, used for aggregates that are not tied to a column.
Type QBAggregates
Sample
and
Create an AND-condition to add conditions to.
Type QBLogicalCondition
Sample
case
Create an case searched expression.
Type QBCase
Sample
columns
Get all the columns of the datasource that can be used for this query (select or where clause)
Type QBColumns
Sample
comment
Specifies a comment of the query.
Type String
Sample
functions
Get the functions clause from a query, used for functions that are not tied to a column.
Type QBFunctions
Sample
groupBy
Get the group by clause from a query
Type QBGroupBy
Sample
having
Get the having-part of the query, used to add conditions. The conditions added here are AND-ed.
Type QBLogicalCondition
Sample
joins
Get the joins clause of this table based clause. Joins added to this clause will be based on this table clauses table.
Type QBJoins
Sample
or
Create an OR-condition to add conditions to.
Type QBLogicalCondition
Sample
params
Get the named parameters from a query.
Type QBParameters
Sample
parent
Get query builder parent table clause, this may be a query or a join clause.
Type QBTableClause
Sample
result
Get the result part of the query, used to add result columns or values.
Type QBResult
Sample
root
Get query builder parent.
Type QBSelect
Sample
sort
Get the sorting part of the query.
Type QBSorts
Sample
where
Get the where-part of the query, used to add conditions. The conditions added here are AND-ed.
Type QBLogicalCondition
Sample
Methods Detailed
clearHaving()
Clear the having-part of the query.
Returns: QBSelect
Sample
exists(query)
Get an exists-condition from a subquery
Parameters
Object query the sub query
Returns: QBCondition
Sample