Hidden |
---|
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE |
For more information see Relations
HTML Table |
---|
|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Constants Summery |
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#INNER_JOIN Constant for set/get the joinType of a JSRelation. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#LEFT_OUTER_JOIN Constant for set/get the joinType of a JSRelation. |
|
|
|
HTML Table |
---|
|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Property Summery |
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#deleteRelatedRecords Flag that tells if related records should be deleted or not when a parent record is deleted. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#initialSort A String which specified a set of sort options for the initial sorting of data retrieved through this relation. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#joinType The join type that is performed between the primary table and the foreign table. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#name The name of the relation. |
|
|
|
HTML Table |
---|
|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Summery |
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#getRelationItems() Returns an array of JSRelationItem objects representing the relation criteria defined for this relation. |
|
|
Table Body (tbody) |
---|
Table Row (tr) |
---|
Table Cell (td) |
---|
#newRelationItem(dataprovider, operator, foreinColumnName) Creates a new relation item for this relation. |
|
|
|
HTML Table |
---|
id | constant |
---|
class | servoy sDetail |
---|
|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Constants Details |
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
INNER_JOIN |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Constant for set/get the joinType of a JSRelation. It is also used in solutionModel.newRelation(...). |
|
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.joinType = JSRelation.LEFT_OUTER_JOIN;
|
|
|
|
|
Table Body (tbody) |
---|
id | LEFT_OUTER_JOIN |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
LEFT_OUTER_JOIN |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Constant for set/get the joinType of a JSRelation. It is also used in solutionModel.newRelation(...). |
|
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.joinType = JSRelation.LEFT_OUTER_JOIN;
|
|
|
|
|
|
HTML Table |
---|
id | property |
---|
class | servoy sDetail |
---|
|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Property Details |
|
Table Body (tbody) |
---|
id | allowCreationRelatedRecords |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
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', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.allowCreationRelatedRecords = true;
|
|
|
|
|
Table Body (tbody) |
---|
id | allowParentDeleteWhenHavingRelatedRecords |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
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', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.allowParentDeleteWhenHavingRelatedRecords = false;
|
|
|
|
|
Table Body (tbody) |
---|
id | deleteRelatedRecords |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
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', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.deleteRelatedRecords = true;
|
|
|
|
|
Table Body (tbody) |
---|
id | foreignDataSource |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
foreignDataSource |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
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', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.primaryDataSource = 'db:/user_data/another_parent_table';
relation.foreignDataSource = 'db:/user_data/another_child_table';
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
initialSort |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
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', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.initialSort = 'another_child_table_text asc';
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
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', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.joinType = JSRelation.LEFT_OUTER_JOIN;
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
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.name = 'anotherName';
var firstTab = tabs.newTab('firstTab', 'Child Form', childForm, relation);
firstTab.relationName = relation.name;
|
|
|
|
|
Table Body (tbody) |
---|
id | primaryDataSource |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
primaryDataSource |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
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', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.primaryDataSource = 'db:/user_data/another_parent_table';
relation.foreignDataSource = 'db:/user_data/another_child_table';
|
|
|
|
|
|
HTML Table |
---|
id | function |
---|
class | servoy sDetail |
---|
|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
Table Body (tbody) |
---|
id | getRelationItems |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getRelationItems |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getRelationItems |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns an array of JSRelationItem objects representing the relation criteria defined for this relation. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns JSRelationItem[] – An array of JSRelationItem instances representing the relation criteria of this relation. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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);
}
|
|
|
|
|
Table Body (tbody) |
---|
id | newRelationItem |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
newRelationItem |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| newRelationItem |
Span |
---|
| (dataprovider, operator, foreinColumnName) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Creates a new relation item for this relation. The primary dataprovider, the foreign data provider and one relation operators (like '=' '!=' '>' '<') must be provided. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} dataprovider – The name of the primary dataprovider. {String} operator – The operator used to relate the primary and the foreign dataproviders. {String} foreinColumnName – The name of the foreign dataprovider. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns JSRelationItem – A JSRelationItem instance representing the newly added relation item. |
|
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.newRelationItem('another_parent_table_id', '=', 'another_child_table_parent_id');
|
|
|
|
|
|