Table Head (thead) |
---|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Property Details |
|
|
Table Body (tbody) |
---|
id | allowCreationRelatedRecords |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Flag that tells if related records can be created through this relation. The default value of this flag is "false". |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.allowCreationRelatedRecords = true; |
|
|
|
|
Table Body (tbody) |
---|
id | allowParentDeleteWhenHavingRelatedRecords |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Flag that tells if the parent record can be deleted while it has related records. The default value of this flag is "true". |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.allowParentDeleteWhenHavingRelatedRecords = false; |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Flag that tells if related records should be deleted or not when a parent record is deleted. The default value of this flag is "false". |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.deleteRelatedRecords = true; |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
foreignDataSource |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Qualified name of the foreign data source. Contains both the name of the foreign server and the name of the foreign table. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var relation = solutionModel.newRelation('parentToChild', 'db:/example_data |
|
|
|
| ', '/parent_table', 'db:/example_data |
|
|
|
| ', '/child_table', JSRelation.INNER_JOIN);
relation. |
|
|
|
| primaryTableNameanother_parent_table';
relation.primaryServerName = '';
relation.foreignTableName = 'childforeignServerName'';
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=BAA99A23-23B5-4F07-B2F4-C243E58506F4}{tr:id=name}{td}h6.primaryTableName{td}{tr}{tr:id=des}{td}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_des|text=|trigger=button}{sub-section}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_des|trigger=none|class=sIndent}The name of the primary table.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_ret|text=|trigger=button}{sub-section}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_see|text=|trigger=button}{sub-section}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_see|text=|trigger=button}{sub-section}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_sam|text=|trigger=button}{sub-section}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_sam|class=sIndent|trigger=none}{code:language=javascript}
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
initialSort |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| A String which specified a set of sort options for the initial sorting of data retrieved through this relation. Has the form "column_name asc, another_column_name desc, ...". |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.initialSort = 'another_child_table_text asc'; |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| The join type that is performed between the primary table and the foreign table. Can be "inner join" or "left outer join". |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.joinType = JSRelation.LEFT_OUTER_JOIN;
/** @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)) |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| The name of the relation. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var relation = solutionModel.newRelation('parentToChild |
|
|
|
| ', 'example_data', 'parent_table 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.primaryTableName = 'another_ 'db:/example_data/parent_table' |
|
|
|
| ;
relation.primaryServerName =userdb:/example_data/child_table' |
|
|
|
| ;relation.foreignTableName = 'another_child_table'JSRelation.INNER_JOIN);
relation. |
|
|
|
| foreignServerName'user_data';
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=950D4039-A6B7-491D-8791-9757412C6A44}{tr:id=name}{td}h6.getRelationItems{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSRelationItem]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getRelationItems{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_des|text=|trigger=button}{sub-section}{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_des|trigger=none|class=sIndent}Returns an array of JSRelationItem objects representing the relation criteria defined for this relation.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_ret|text=|trigger=button}{sub-section}{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_ret|trigger=none|class=sIndent}[JSRelationItem]\[] -- An array of JSRelationItem instances representing the relation criteria of this relation.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_see|text=|trigger=button}{sub-section}{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_see|text=|trigger=button}{sub-section}{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_sam|text=|trigger=button}{sub-section}{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_sam|class=sIndent|trigger=none}{code:language=javascript}
var criteria = relation.getRelationItems();
for (var i=0; i<criteria.length; i++)
{
var item = criteria[i];
application.output('relation item no. ' + i);
application.output('primary column: ' + item.primaryDataProviderID);
application.output('operator: ' + item.operator);
application.output('foreign column: ' + item.foreignColumnName);
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08}{tr:id=name}{td}h6.newRelationItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSRelationItem]{span}{span:id=iets|style=float: left; font-weight: bold;}newRelationItem{span}{span:id=iets|style=float: left;}\(dataprovider, operator, foreinColumnName){span}{td}{tr}{tr:id=des}{td}{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_des|text=|trigger=button}{sub-section}{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_des|trigger=none|class=sIndent}Creates a new relation item for this relation. The primary dataprovider, the foreign data provider
and one relation operators (like '=' '!=' '>' '<') must be provided.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_prs|trigger=none}dataprovider -- The name of the primary dataprovider.
operator -- The operator used to relate the primary and the foreign dataproviders.
foreinColumnName -- The name of the foreign dataprovider.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_ret|text=|trigger=button}{sub-section}{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_ret|trigger=none|class=sIndent}[JSRelationItem] -- A JSRelationItem instance representing the newly added relation item.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_see|text=|trigger=button}{sub-section}{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_see|text=|trigger=button}{sub-section}{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_sam|text=|trigger=button}{sub-section}{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_sam|class=sIndent|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.newRelationItem('another_parent_table_id', '=', 'another_child_table_parent_id');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}'anotherName';
var firstTab = tabs.newTab('firstTab', 'Child Form', childForm, relation);
firstTab.relationName = relation.name; |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
primaryDataSource |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Qualified name of the primary data source. Contains both the name of the primary server and the name of the primary table. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.primaryDataSource = 'db:/user_data/another_parent_table';
relation.foreignDataSource = 'db:/user_data/another_child_table'; |
|
|
|
|
|