No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
A Tuple is fancy word for something “taped together from bits and pieces of other stuff”. This is very useful when it comes to | A Tuple is a fancy word for something “taped together from bits and pieces of other stuff”. This is very useful when it comes to building result sets that are not necessarily something that exists in your model - like sums or collecting names and addresses together even if they are stored in different classes. | ||
Tuples are what an | Tuples are what an SQL server returns when you omit the “*” and write explicit stuff in the select part. In fact, the columns in the select part are the tuple definition as far as the SQL server is concerned. | ||
OCL operators that create tuples are | OCL operators that create tuples are: | ||
* [[OCLOperators groupBy|GroupBy]] | * [[OCLOperators groupBy|GroupBy]] | ||
* [[OCLOperators collect|Collect]] | * [[OCLOperators collect|Collect]] | ||
Line 12: | Line 12: | ||
So what do I get back? A Tuple | So what do I get back? A Tuple | ||
The tuple consists of a type with a generated name and specific properties. The properties are | The tuple consists of a type with a generated name and specific properties. The properties are Attribute1 and List. | ||
The code below shows how to access the tuple result in code: | The code below shows how to access the tuple result in code: | ||
[[Category:OCLOperators]] | [[Category:OCLOperators]] |
Revision as of 08:39, 6 March 2023
A Tuple is a fancy word for something “taped together from bits and pieces of other stuff”. This is very useful when it comes to building result sets that are not necessarily something that exists in your model - like sums or collecting names and addresses together even if they are stored in different classes.
Tuples are what an SQL server returns when you omit the “*” and write explicit stuff in the select part. In fact, the columns in the select part are the tuple definition as far as the SQL server is concerned.
OCL operators that create tuples are:
Example
IElement elem = ocl.Evaluate(“Class1.allinstances.class2.class3->groupby(x|x.Attribute1)”);
So what do I get back? A Tuple
The tuple consists of a type with a generated name and specific properties. The properties are Attribute1 and List.
The code below shows how to access the tuple result in code: