Child pages
  • QBWhereCondition

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
{div:style=display:none} DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.\\ \\ Enter additional information related to this 'class' inside the \{div} macro with 'id=description'{div} {div:id=description}{div}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[String]\[]{td}{td}[#conditionnames] Get the names for the conditions in the query where\-clause.{td}{tr}{tbody}{tbody}{tr}{td}[QBTableClause]{td}{td}[#parent] Get query builder parent table clause, this may be a query or a join clause.{td}{tr}{tbody}{tbody}{tr}{td}[QBSelect]{td}{td}[#root] Get query builder parent.{td}{tr}{tbody}{table}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[QBWhereCondition]{td}{td}[#add]\(condition) Add a condition to the AND or OR condition list.{td}{tr}{tbody}{tbody}{tr}{td}[QBWhereCondition]{td}{td}[#add]\(name, condition) Add a named condition to the AND or OR condition list.{td}{tr}{tbody}{tbody}{tr}{td}[QBWhereCondition]{td}{td}[#clear]\() Clear the conditions in the query where\-clause.{td}{tr}{tbody}{tbody}{tr}{td}[QBCondition]{td}{td}[#getCondition]\() Get a named condition in the query where\-clause.{td}{tr}{tbody}{tbody}{tr}{td}[QBWhereCondition]{td}{td}[#remove]\() Remove a named condition from the AND or OR condition list.{td}{tr}{tbody}{table}\\ {table:id=property|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=conditionnames}{tr:id=name}{td}h6.conditionnames{td}{tr}{tr:id=des}{td}{div:class=sIndent}
Wiki Markup
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Property SummaryGet the names for the conditions in the query where-clause.Get query builder parent table clause, this may be a query or a join clause.Get query builder parent.

servoy sSummary12%30%58%height: 30px;3Methods SummaryAdd a condition to the AND or OR condition list.Add a named condition to the AND or OR condition list.Clear the conditions in the query where-clause.Get a named condition in the query where-clause.Remove a named condition from the AND or OR condition list.

propertyservoy sDetail2100%height:30px2Property Detailsconditionnamesname

conditionnames

dessIndent
Get the names for the conditions in the query where
\
-clause.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]\[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var q = foundset.getQuery() for (var c in q.where.conditionnames) { var cond = q.where.getCondition(c) } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=parent}{tr:id=name}{td}h6.parent{td}{tr}{tr:id=des}{td}{div:class=sIndent}
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowparentname

parent

dessIndent
Get query builder parent table clause, this may be a query or a join clause.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBTableClause]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} /** @type {QBSelect<db:/example_data/person>} */ var query = databaseManager.createSelect('db:/example_data/person') query.where.add(query.joins.person_to_parent.joins.person_to_parent.columns.name.eq('john')) foundset.loadRecords(query) {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=root}{tr:id=name}{td}h6.root{td}{tr}{tr:id=des}{td}{div:class=sIndent}
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowrootname

root

dessIndent
Get query builder parent.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBSelect]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} /** @type {QBSelect<db:/example_data/order_details>} */ var subquery = databaseManager.createSelect('db:/example_data/order_details') /** @type {QBSelect<db:/example_data/orders>} */ var query = databaseManager.createSelect('db:/example_data/orders') query.where.add(query .or .add(query.columns.order_id.not.isin([1, 2, 3])) .add(query.exists( subquery.where.add(subquery.columns.orderid.eq(query.columns.order_id)).root )) ) foundset.loadRecords(query) {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ {table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=add-QBCondition}{tr:id=name}{td}h6.add{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBWhereCondition]{span}{span:style=font-weight: bold;}add{span}{span}\(condition){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

functionservoy sDetail2100%height:30px2Methods Detailsaddname

add(condition)

dessIndent
Add a condition to the AND or OR condition list.
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[QBCondition]} condition -- the condition to add {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBWhereCondition]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} /** @type {QBSelect<db:/example_data/orders>} */ var query = databaseManager.createSelect('db:/example_data/orders') query.where.add(query.columns.orderdate.isNull) {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=add-String_QBCondition}{tr:id=name}{td}h6.add{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBWhereCondition]{span}{span:style=font-weight: bold;}add{span}{span}\(name, condition){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
prs

Parameters

sIndentconditionthe condition to add
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowaddname

add(name, condition)

dessIndent
Add a named condition to the AND or OR condition list.
{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} name -- the name of the condition \{[QBCondition]} condition -- the condition to add {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBWhereCondition]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} /** @type {QBSelect<db:/example_data/orders>} */ var query = databaseManager.createSelect('db:/example_data/orders') query.where.add("mycond", query.columns.orderdate.isNull) {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=clear}{tr:id=name}{td}h6.clear{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBWhereCondition]{span}{span:style=font-weight: bold;}clear{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
prs

Parameters

sIndentnamethe name of the conditionconditionthe condition to add
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowclearname

clear()

dessIndent
Clear the conditions in the query where
\
-clause.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBWhereCondition]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} /** @type {QBSelect<db:/example_data/orders>} */ var query = databaseManager.createSelect('db:/example_data/orders') query.where.clear() {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getCondition}{tr:id=name}{td}h6.getCondition{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBCondition]{span}{span:style=font-weight: bold;}getCondition{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowgetConditionname

getCondition(name)

dessIndent
Get a named condition in the query where
\
-clause
.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBCondition]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var q = foundset.getQuery() for (var c in q.where.conditionnames) { var cond = q.where.getCondition(c) } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=remove}{tr:id=name}{td}h6.remove{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[QBWhereCondition]{span}{span:style=font-weight: bold;}remove{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}
.
prs

Parameters

sIndentnameThe condition name.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
removename

remove(name)

dessIndent
Remove a named condition from the AND or OR condition list.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[QBWhereCondition]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} /** @type {QBSelect<db:/example_data/orders>} */ var query = databaseManager.createSelect('db:/example_data/orders') query.where.remove("mycond") {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
prs

Parameters

sIndentnameThe condition name.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow