Child pages
  • QBJoin

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Divcache
Div
iddescription
HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Row (tr)
Table Cell (td)
QBColumns
Table Cell (td)
columns
Get columns from query
Table Row (tr)
Table Cell (td)
QBJoins
Table Cell (td)joins
styleindexdisplay: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.

true
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable
idclass

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Property SummaryGet all the columns of the datasource that can be used for this query (select or where clause)Get the joins clause of this table based clause. Table Row (tr)

Table Cell (td)
QBLogicalCondition
Table Cell (td)on
Table Cell (td)parent
Get the on clause for the join. Table Row (tr)
Table Cell (td)
QBTableClause
Get query builder parent table clause, this may be a query or a join clause. Table Row (tr)
Table Cell (td)
QBSelect
Table Cell (td)root
Get query builder parent. HTML Table

Colgroup Tag
Col
width80px
Col
Table Head (thead) Table Row (tr)styleservoy sSummary Table Row (tr)
Table Cell (td)
QBColumn
Table Cell (td)getColumn(name)
12%30%58%height: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
QBColumn
Table Cell (td)getColumn(columnTableAlias, name)
3Methods SummaryGet a column from the table.Get a column from the table with given alias. HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Details
Table Body (tbody)
idcolumns
Table Row (tr)
idname
Table Cell (td)

columns

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get columns from query
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBColumns
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
foundset.getQuery().columns
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idjoins
Table Row (tr)
idname
Table Cell (td)

joins

Table Row (tr)
iddes
Table Cell (td) Div
classsIndent
.Returns the datasource for this.Returns the join type, one of IQueryBuilderJoin#LEFT_OUTER_JOIN, IQueryBuilderJoin#INNER_JOIN, IQueryBuilderJoin#RIGHT_OUTER_JOIN, IQueryBuilderJoin#FULL_JOINReturns the table alias for this.

propertyservoy sDetail2100%height:30px2Property Detailscolumnsname

columns

dessIndentGet all the columns of the datasource that can be used for this query (select or where clause)ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow joinsname

joins

dessIndentGet the joins clause of this table based clause.

Joins added to this clause will be based on this table clauses table. Table Row (tr)idtdret

Returns

divsIndentclients

classid

Supported Clients

sIndent
QBJoins Table Row (tr)SmartClient,WebClient,NGClientsam

Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
foundset.getQuery().joins
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idon
Table Row (tr)
idname
Table Cell (td)

on

Table Row (tr)
iddes
Table Cell (td) Div
classsIndent
sIdentjavascriptlastDetailRow onname

on

dessIndentGet the on clause for the join.
Table Row (tr)idret

Table Cell (td)

Returns

divsIndentclients

classtd

Supported Clients

sIndent
QBLogicalCondition Table Row (tr)
idsam
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idparent
Table Row (tr)
idname
Table Cell (td)

parent

Table Row (tr)
iddes
Table Cell (td) Div
classsIndent
SmartClient,WebClient,NGClientsam

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/person>} */
var query = databaseManager.createSelect('db:/example_data/person')
/** @type {QBJoin<db:/example_data/person>} */
var join1 = query.joins.add('db:/example_data/person')
join1.on.add(query.columns.parent_person_id.eq(join1.columns.person_id))
/** @type {QBJoin<db:/example_data/person>} */
var join2 = query.joins.add('db:/example_data/person')
join2.on.add(join1.columns.parent_person_id.eq(join2.columns.person_id))

query.where.add(join2.columns.name.eq('john'))
foundset.loadRecords(query)
sIdentjavascriptlastDetailRow&nbsp;parentname

parent

dessIndentGet query builder parent table clause, this may be a query or a join clause.
Table Row (tr)idret

Table Cell (td)

Returns

divsIndentclients

classid

Supported Clients

sIndent
QBTableClause Table Row (tr)SmartClient,WebClient,NGClientsam

Table Cell (td)

Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idroot
Table Row (tr)
idname
Table Cell (td)

root

Table Row (tr)
iddes
Table Cell (td) Div
classsIndent

Sample

Div
classsIndent
Code Block
languagejavascript
/** @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)
sIdentjavascriptlastDetailRow&nbsp;rootname

root

dessIndentGet query builder parent.
Table Row (tr)idtdret

Returns

divsIndentclients

classid

Supported Clients

sIndent
QBSelect Table Row (tr)SmartClient,WebClient,NGClientsam

Table Cell (td)

Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idgetColumn-String
Table Row (tr)
idname
Table Cell (td)

getColumn

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBColumn
Span
stylefont-weight: bold;
getColumn
Span
(name)
Table Row (tr)
iddes
Table Cell (td) Div
classsIndent

Sample

Div
classsIndent
Code Block
languagejavascript
/** @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)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
HTML Table
idfunction
classservoy sDetail
sIdentjavascriptlastDetailRow&nbsp;

functionservoy sDetail2100%height:30px2Methods DetailsgetColumnname

getColumn(name)

dessIndentGet a column from the table.
Table Row (tr)idprs

Table Cell (td)class

Parameters

DivsIndent{String} name - the name of column to get Table Row (tr)idtdret

Returns

divsIndentclients

classtd

Supported Clients

sIndent
QBColumn Table Row (tr)
idsam
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBColumn
Span
stylefont-weight: bold;
getColumn
SpanSmartClient,WebClient,NGClientsam

Sample

Div
classsIndent
Code Block
languagejavascript
foundset.getQuery().getColumn('orderid')
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetColumn-String_String
Table Row (tr)
idname
Table Cell (td)

getColumn

sIdentjavascriptlastDetailRow&nbsp;getColumnname

getColumn(columnTableAlias, name)

tr

id Table Cell (td) DivclassdessIndentGet a column from the table with given alias.
The alias may be of the main table or any level deep joined table. Table Row (tr)idprs

Table Cell (td)

Parameters

Divclass

sIndent{String} columnTableAlias - the alias for the table
{String} name - the name of column to getret

tr

Returns

idsIndentclients

ret

Table Cell (td)

Returns

Div
classsIndent
QBColumn
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
foundset.getQuery().getColumn('orderid', 'opk')
Table Row (tr)
classlastDetailRow
Table Cell (td) 

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow&nbsp;
getDataSourcename

getDataSource()

dessIndentReturns the datasource for this.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow&nbsp;
getJoinTypename

getJoinType()

dessIndentReturns the join type, one of IQueryBuilderJoin#LEFT_OUTER_JOIN, IQueryBuilderJoin#INNER_JOIN, IQueryBuilderJoin#RIGHT_OUTER_JOIN, IQueryBuilderJoin#FULL_JOINret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow&nbsp;
getTableAliasname

getTableAlias()

dessIndentReturns the table alias for this.ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow&nbsp;