Child pages
  • QBJoins

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)
QBTableClause
Table Cell (td)parent
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

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Property SummaryGet 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

idclassservoy sSummaryid

Colgroup Tag
Col
width80px
Col
Table Head (thead) Table Row (tr)style Table Row (tr)
Table Cell (td)
QBJoin
Table Cell (td)add(dataSource)
servoy sSummary12%30%58%height: 30px;
Table Head (th)
colspan2
Method Summary
3Methods SummaryAdd a join with join type IQueryBuilderJoin#LEFT_OUTER_JOIN and no alias for the joining table. Table Row (tr)
Table Cell (td)
QBJoin
Table Cell (td)add(dataSource, joinType)
Table Row (tr)
Table Cell (td)
QBJoin
Table Cell (td)add(dataSource, joinType, alias)
Add a join with no alias for the joining table.Add a join clause from the parent query builder part to the specified data source. Table Row (tr)
Table Cell (td)
QBJoin
Table Cell (td)add(dataSourceOrRelation, alias)
Add a join based on relation or add a manual join.

HTML Table

propertyclass Colgroup Tag Colcolspanservoy sDetail2width100%

Col
Table Head (thead) Table Row (tr)styleheight:30px; Table Head (th)colspan2Property Details Table Body (tbody)ididparent Table Row (tr)nametd

parent

Table Row (tr)id

des Table Cell (td) DivclasssIndentGet query builder parent table clause, this may be a query or a join clause. Table Row (tr)idtdret

Returns

divsIndentclients

classtd

Supported Clients

sIndent
QBTableClause Table Row (tr)
idsam
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
SmartClient,WebClient,NGClientsam

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

classtd

Supported Clients

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

add

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBJoin
Span
stylefont-weight: bold;
add
Span
(dataSource)
Table Row (tr)
iddes
Table Cell (td) Div
classsIndent
SmartClient,WebClient,NGClientsam

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 Detailsaddname

add(dataSource)

dessIndentAdd a join with join type IQueryBuilderJoin#LEFT_OUTER_JOIN and no alias for the joining table.
Table Row (tr)idprs

Table Cell (td)

Parameters

div

classsIndent{String} dataSource - data source Table Row (tr)idret

Table Cell (td)

Returns

divsIndentclients

classtd

Supported Clients

sIndent
QBJoin Table Row (tr)
idsam
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idadd-String_Number
Table Row (tr)
idname
Table Cell (td)

add

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBJoin
Span
stylefont-weight: bold;
add
SpanSmartClient,WebClient,NGClientsam

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
 /** @type {QBJoin<db:/example_data/order_details>} */
	var join = query.joins.add('db:/example_data/order_details', JSRelation.INNER_JOIN, 'odetail')
	join.on.add(join.columns.orderid.eq(query.columns.orderid))
 // to add a join based on a relation, use the relation name
 var join2 = query.joins.add('orders_to_customers', 'cust')
	query.where.add(join2.columns.customerid.eq(999))
	foundset.loadRecords(query)
sIdentjavascriptlastDetailRow&nbsp;addname

add(dataSource, joinType)

Table Row (tr)id Table Cell (td) Divclass

dessIndentAdd a join with no alias for the joining table. Table Row (tr)idtdprs

Parameters

Divclass

sIndent{String} dataSource - data source
{Number} joinType - Table Row (tr)idjoin type, one of JSRelation.LEFT_OUTER_JOIN, JSRelation.INNER_JOIN, JSRelation.RIGHT_OUTER_JOIN, JSRelation.FULL_JOINtdret

Returns

divsIndentclients

classid

Supported Clients

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

Table Cell (td)

Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idadd-String_Number_String
Table Row (tr)
idname
Table Cell (td)

add

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBJoin
Span
stylefont-weight: bold;
add
Span

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
 /** @type {QBJoin<db:/example_data/order_details>} */
	var join = query.joins.add('db:/example_data/order_details', JSRelation.INNER_JOIN, 'odetail')
	join.on.add(join.columns.orderid.eq(query.columns.orderid))
 // to add a join based on a relation, use the relation name
 var join2 = query.joins.add('orders_to_customers', 'cust')
	query.where.add(join2.columns.customerid.eq(999))
	foundset.loadRecords(query)
sIdentjavascriptlastDetailRow&nbsp;addname

add(dataSource, joinType, alias)

tr

idclassdes Table Cell (td) DivsIndentAdd a join clause from the parent query builder part to the specified data source. Table Row (tr)idtdprsclass

Parameters

DivsIndent{String} dataSource - data source
{Number} joinType - join type, one of IQueryBuilderJoin#LEFT_OUTER_JOIN, IQueryBuilderJoin#INNER_JOIN, IQueryBuilderJoin#RIGHT_OUTER_JOIN, IQueryBuilderJoin#FULL_JOIN
{String} alias - Table Row (tr)idthe alias for joining tableret

Table Cell (td)

Returns

divsIndentclients

classid

Supported Clients

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

Table Cell (td)

Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idadd-String_String
Table Row (tr)
idname
Table Cell (td)

add

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBJoin
Span
stylefont-weight: bold;
add
Span

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
 /** @type {QBJoin<db:/example_data/order_details>} */
	var join = query.joins.add('db:/example_data/order_details', JSRelation.INNER_JOIN, 'odetail')
	join.on.add(join.columns.orderid.eq(query.columns.orderid))
 // to add a join based on a relation, use the relation name
 var join2 = query.joins.add('orders_to_customers', 'cust')
	query.where.add(join2.columns.customerid.eq(999))
	foundset.loadRecords(query)
sIdentjavascriptlastDetailRow&nbsp;addname

add(dataSourceOrRelation, alias)

tr

idclassdes Table Cell (td) DivsIndentAdd a join based on relation or add a manual join.
When dataSourceOrRelation is a relation name, a join will be added based on the relation.
Table Row (tr)id When dataSourceOrRelation is a data source, an empty join will be added with join type IQueryBuilderJoin#LEFT_OUTER_JOIN.prs

Table Cell (td)

Parameters

Divclass

sIndent{String} dataSourceOrRelation - data source
{String} alias - Table Row (tr)idthe alias for joining tabletdret

Returns

divsIndentclients

classtd

Supported Clients

sIndent
QBJoin Table Row (tr)
idsam
Table Row (tr)
classlastDetailRow
Table Cell (td) SmartClient,WebClient,NGClientsam

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
 /** @type {QBJoin<db:/example_data/order_details>} */
	var join = query.joins.add('db:/example_data/order_details', JSRelation.INNER_JOIN, 'odetail')
	join.on.add(join.columns.orderid.eq(query.columns.orderid))
 // to add a join based on a relation, use the relation name
 var join2 = query.joins.add('orders_to_customers', 'cust')
	query.where.add(join2.columns.customerid.eq(999))
	foundset.loadRecords(query)
sIdentjavascriptlastDetailRow&nbsp;getJoinsname

getJoins()

dessIndentret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow&nbsp;