Skip to content

Commit da015ec

Browse files
committed
added more operators for the on condition
1 parent 7cdd967 commit da015ec

File tree

3 files changed

+232
-30
lines changed

3 files changed

+232
-30
lines changed

spec/v1/CSN-Interop-Effective.schema.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,10 +1080,10 @@ definitions:
10801080
10811081
The `on` condition is constructed by triples of:
10821082
- Reference to the target element (ID) as array with 2 items
1083-
- Equals Operator "="
1083+
- Equals Operator "=" or Smaller Equals Operator "<=" or Bigger Equals Operator ">="
10841084
- Reference to the local element (ID) as array with 1 item OR a constant value (`val`)
10851085
1086-
The first and third entry MAY be reversed but the `=` operator MUST be in the middle.
1086+
The first and third entry MAY be reversed but the `=`, `<=` or `>=` operator MUST be in the middle.
10871087
The target element reference MUST have two array items. The first item is the association name and the second item is the target element name.
10881088
The local element reference MUST have one array item, which is the local element name.
10891089
@@ -1095,11 +1095,15 @@ definitions:
10951095
oneOf:
10961096
- $ref: "#/definitions/StructuredElementReference"
10971097
- $ref: "#/definitions/EqualsOperator"
1098+
- $ref: "#/definitions/SmallerEqualsOperator"
1099+
- $ref: "#/definitions/BiggerEqualsOperator"
10981100
- $ref: "#/definitions/AndOperator"
10991101
- $ref: "#/definitions/OnValue"
11001102
minItems: 3
11011103
examples:
11021104
- [{ "ref": ["to_Connection", "AirlineID"] }, "=", { "ref": ["AirlineID"] }]
1105+
- [{ "ref": ["to_Connection", "FlightDate"] }, "<=", { "ref": ["FlightDate"] }]
1106+
- [{ "ref": ["to_Connection", "FlightDate"] }, ">=", { "ref": ["FlightDate"] }]
11031107
- [
11041108
{ "ref": ["to_Connection", "AirlineID"] },
11051109
"=",
@@ -1429,6 +1433,20 @@ definitions:
14291433
The operator "="
14301434
const: "="
14311435

1436+
SmallerEqualsOperator:
1437+
title: Smaller Equals Operator
1438+
type: string
1439+
description: |-
1440+
The operator "<="
1441+
const: "<="
1442+
1443+
BiggerEqualsOperator:
1444+
title: Bigger Equals Operator
1445+
type: string
1446+
description: |-
1447+
The operator ">="
1448+
const: ">="
1449+
14321450
AndOperator:
14331451
title: AND Operator
14341452
type: string

src/generated/spec-v1/schemas/csn-interop-effective.schema.json

Lines changed: 152 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3231,7 +3231,7 @@
32313231
},
32323232
"on": {
32333233
"type": "array",
3234-
"description": "The property `on` holds a sequence of operators and operands to describe the join condition, similar to an SQL expression.\n\nThe `on` condition is constructed by triples of:\n- Reference to the target element (ID) as array with 2 items\n- Equals Operator \"=\"\n- Reference to the local element (ID) as array with 1 item OR a constant value (`val`)\n\nThe first and third entry MAY be reversed but the `=` operator MUST be in the middle.\nThe target element reference MUST have two array items. The first item is the association name and the second item is the target element name.\nThe local element reference MUST have one array item, which is the local element name.\n\nIn case of composite references / IDs, any number of \"triples\" can be combined with the `and` operator in between.\n\nSee also: (../primer.md#on-condition) and [CAP documentation](https://cap.cloud.sap/docs/cds/csn#assoc-on).",
3234+
"description": "The property `on` holds a sequence of operators and operands to describe the join condition, similar to an SQL expression.\n\nThe `on` condition is constructed by triples of:\n- Reference to the target element (ID) as array with 2 items\n- Equals Operator \"=\" or Smaller Equals Operator \"<=\" or Bigger Equals Operator \">=\"\n- Reference to the local element (ID) as array with 1 item OR a constant value (`val`)\n\nThe first and third entry MAY be reversed but the `=`, `<=` or `>=` operator MUST be in the middle.\nThe target element reference MUST have two array items. The first item is the association name and the second item is the target element name.\nThe local element reference MUST have one array item, which is the local element name.\n\nIn case of composite references / IDs, any number of \"triples\" can be combined with the `and` operator in between.\n\nSee also: (../primer.md#on-condition) and [CAP documentation](https://cap.cloud.sap/docs/cds/csn#assoc-on).",
32353235
"items": {
32363236
"oneOf": [
32373237
{
@@ -3240,6 +3240,12 @@
32403240
{
32413241
"$ref": "#/definitions/EqualsOperator"
32423242
},
3243+
{
3244+
"$ref": "#/definitions/SmallerEqualsOperator"
3245+
},
3246+
{
3247+
"$ref": "#/definitions/BiggerEqualsOperator"
3248+
},
32433249
{
32443250
"$ref": "#/definitions/AndOperator"
32453251
},
@@ -3264,6 +3270,34 @@
32643270
]
32653271
}
32663272
],
3273+
[
3274+
{
3275+
"ref": [
3276+
"to_Connection",
3277+
"FlightDate"
3278+
]
3279+
},
3280+
"<=",
3281+
{
3282+
"ref": [
3283+
"FlightDate"
3284+
]
3285+
}
3286+
],
3287+
[
3288+
{
3289+
"ref": [
3290+
"to_Connection",
3291+
"FlightDate"
3292+
]
3293+
},
3294+
">=",
3295+
{
3296+
"ref": [
3297+
"FlightDate"
3298+
]
3299+
}
3300+
],
32673301
[
32683302
{
32693303
"ref": [
@@ -3534,7 +3568,7 @@
35343568
},
35353569
"on": {
35363570
"type": "array",
3537-
"description": "The property `on` holds a sequence of operators and operands to describe the join condition, similar to an SQL expression.\n\nThe `on` condition is constructed by triples of:\n- Reference to the target element (ID) as array with 2 items\n- Equals Operator \"=\"\n- Reference to the local element (ID) as array with 1 item OR a constant value (`val`)\n\nThe first and third entry MAY be reversed but the `=` operator MUST be in the middle.\nThe target element reference MUST have two array items. The first item is the association name and the second item is the target element name.\nThe local element reference MUST have one array item, which is the local element name.\n\nIn case of composite references / IDs, any number of \"triples\" can be combined with the `and` operator in between.\n\nSee also: (../primer.md#on-condition) and [CAP documentation](https://cap.cloud.sap/docs/cds/csn#assoc-on).",
3571+
"description": "The property `on` holds a sequence of operators and operands to describe the join condition, similar to an SQL expression.\n\nThe `on` condition is constructed by triples of:\n- Reference to the target element (ID) as array with 2 items\n- Equals Operator \"=\" or Smaller Equals Operator \"<=\" or Bigger Equals Operator \">=\"\n- Reference to the local element (ID) as array with 1 item OR a constant value (`val`)\n\nThe first and third entry MAY be reversed but the `=`, `<=` or `>=` operator MUST be in the middle.\nThe target element reference MUST have two array items. The first item is the association name and the second item is the target element name.\nThe local element reference MUST have one array item, which is the local element name.\n\nIn case of composite references / IDs, any number of \"triples\" can be combined with the `and` operator in between.\n\nSee also: (../primer.md#on-condition) and [CAP documentation](https://cap.cloud.sap/docs/cds/csn#assoc-on).",
35383572
"items": {
35393573
"oneOf": [
35403574
{
@@ -3543,6 +3577,12 @@
35433577
{
35443578
"$ref": "#/definitions/EqualsOperator"
35453579
},
3580+
{
3581+
"$ref": "#/definitions/SmallerEqualsOperator"
3582+
},
3583+
{
3584+
"$ref": "#/definitions/BiggerEqualsOperator"
3585+
},
35463586
{
35473587
"$ref": "#/definitions/AndOperator"
35483588
},
@@ -3567,6 +3607,34 @@
35673607
]
35683608
}
35693609
],
3610+
[
3611+
{
3612+
"ref": [
3613+
"to_Connection",
3614+
"FlightDate"
3615+
]
3616+
},
3617+
"<=",
3618+
{
3619+
"ref": [
3620+
"FlightDate"
3621+
]
3622+
}
3623+
],
3624+
[
3625+
{
3626+
"ref": [
3627+
"to_Connection",
3628+
"FlightDate"
3629+
]
3630+
},
3631+
">=",
3632+
{
3633+
"ref": [
3634+
"FlightDate"
3635+
]
3636+
}
3637+
],
35703638
[
35713639
{
35723640
"ref": [
@@ -4259,6 +4327,18 @@
42594327
"description": "The operator \"=\"",
42604328
"const": "="
42614329
},
4330+
"SmallerEqualsOperator": {
4331+
"title": "Smaller Equals Operator",
4332+
"type": "string",
4333+
"description": "The operator \"<=\"",
4334+
"const": "<="
4335+
},
4336+
"BiggerEqualsOperator": {
4337+
"title": "Bigger Equals Operator",
4338+
"type": "string",
4339+
"description": "The operator \">=\"",
4340+
"const": ">="
4341+
},
42624342
"AndOperator": {
42634343
"title": "AND Operator",
42644344
"type": "string",
@@ -7179,7 +7259,7 @@
71797259
},
71807260
"on": {
71817261
"type": "array",
7182-
"description": "The property `on` holds a sequence of operators and operands to describe the join condition, similar to an SQL expression.\n\nThe `on` condition is constructed by triples of:\n- Reference to the target element (ID) as array with 2 items\n- Equals Operator \"=\"\n- Reference to the local element (ID) as array with 1 item OR a constant value (`val`)\n\nThe first and third entry MAY be reversed but the `=` operator MUST be in the middle.\nThe target element reference MUST have two array items. The first item is the association name and the second item is the target element name.\nThe local element reference MUST have one array item, which is the local element name.\n\nIn case of composite references / IDs, any number of \"triples\" can be combined with the `and` operator in between.\n\nSee also: (../primer.md#on-condition) and [CAP documentation](https://cap.cloud.sap/docs/cds/csn#assoc-on).",
7262+
"description": "The property `on` holds a sequence of operators and operands to describe the join condition, similar to an SQL expression.\n\nThe `on` condition is constructed by triples of:\n- Reference to the target element (ID) as array with 2 items\n- Equals Operator \"=\" or Smaller Equals Operator \"<=\" or Bigger Equals Operator \">=\"\n- Reference to the local element (ID) as array with 1 item OR a constant value (`val`)\n\nThe first and third entry MAY be reversed but the `=`, `<=` or `>=` operator MUST be in the middle.\nThe target element reference MUST have two array items. The first item is the association name and the second item is the target element name.\nThe local element reference MUST have one array item, which is the local element name.\n\nIn case of composite references / IDs, any number of \"triples\" can be combined with the `and` operator in between.\n\nSee also: (../primer.md#on-condition) and [CAP documentation](https://cap.cloud.sap/docs/cds/csn#assoc-on).",
71837263
"items": {
71847264
"oneOf": [
71857265
{
@@ -7188,6 +7268,12 @@
71887268
{
71897269
"$ref": "#/definitions/EqualsOperator"
71907270
},
7271+
{
7272+
"$ref": "#/definitions/SmallerEqualsOperator"
7273+
},
7274+
{
7275+
"$ref": "#/definitions/BiggerEqualsOperator"
7276+
},
71917277
{
71927278
"$ref": "#/definitions/AndOperator"
71937279
},
@@ -7212,6 +7298,34 @@
72127298
]
72137299
}
72147300
],
7301+
[
7302+
{
7303+
"ref": [
7304+
"to_Connection",
7305+
"FlightDate"
7306+
]
7307+
},
7308+
"<=",
7309+
{
7310+
"ref": [
7311+
"FlightDate"
7312+
]
7313+
}
7314+
],
7315+
[
7316+
{
7317+
"ref": [
7318+
"to_Connection",
7319+
"FlightDate"
7320+
]
7321+
},
7322+
">=",
7323+
{
7324+
"ref": [
7325+
"FlightDate"
7326+
]
7327+
}
7328+
],
72157329
[
72167330
{
72177331
"ref": [
@@ -7487,7 +7601,7 @@
74877601
},
74887602
"on": {
74897603
"type": "array",
7490-
"description": "The property `on` holds a sequence of operators and operands to describe the join condition, similar to an SQL expression.\n\nThe `on` condition is constructed by triples of:\n- Reference to the target element (ID) as array with 2 items\n- Equals Operator \"=\"\n- Reference to the local element (ID) as array with 1 item OR a constant value (`val`)\n\nThe first and third entry MAY be reversed but the `=` operator MUST be in the middle.\nThe target element reference MUST have two array items. The first item is the association name and the second item is the target element name.\nThe local element reference MUST have one array item, which is the local element name.\n\nIn case of composite references / IDs, any number of \"triples\" can be combined with the `and` operator in between.\n\nSee also: (../primer.md#on-condition) and [CAP documentation](https://cap.cloud.sap/docs/cds/csn#assoc-on).",
7604+
"description": "The property `on` holds a sequence of operators and operands to describe the join condition, similar to an SQL expression.\n\nThe `on` condition is constructed by triples of:\n- Reference to the target element (ID) as array with 2 items\n- Equals Operator \"=\" or Smaller Equals Operator \"<=\" or Bigger Equals Operator \">=\"\n- Reference to the local element (ID) as array with 1 item OR a constant value (`val`)\n\nThe first and third entry MAY be reversed but the `=`, `<=` or `>=` operator MUST be in the middle.\nThe target element reference MUST have two array items. The first item is the association name and the second item is the target element name.\nThe local element reference MUST have one array item, which is the local element name.\n\nIn case of composite references / IDs, any number of \"triples\" can be combined with the `and` operator in between.\n\nSee also: (../primer.md#on-condition) and [CAP documentation](https://cap.cloud.sap/docs/cds/csn#assoc-on).",
74917605
"items": {
74927606
"oneOf": [
74937607
{
@@ -7496,6 +7610,12 @@
74967610
{
74977611
"$ref": "#/definitions/EqualsOperator"
74987612
},
7613+
{
7614+
"$ref": "#/definitions/SmallerEqualsOperator"
7615+
},
7616+
{
7617+
"$ref": "#/definitions/BiggerEqualsOperator"
7618+
},
74997619
{
75007620
"$ref": "#/definitions/AndOperator"
75017621
},
@@ -7520,6 +7640,34 @@
75207640
]
75217641
}
75227642
],
7643+
[
7644+
{
7645+
"ref": [
7646+
"to_Connection",
7647+
"FlightDate"
7648+
]
7649+
},
7650+
"<=",
7651+
{
7652+
"ref": [
7653+
"FlightDate"
7654+
]
7655+
}
7656+
],
7657+
[
7658+
{
7659+
"ref": [
7660+
"to_Connection",
7661+
"FlightDate"
7662+
]
7663+
},
7664+
">=",
7665+
{
7666+
"ref": [
7667+
"FlightDate"
7668+
]
7669+
}
7670+
],
75237671
[
75247672
{
75257673
"ref": [

0 commit comments

Comments
 (0)