@sap/cds-compiler 2.15.8 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/CHANGELOG.md +102 -1590
  2. package/bin/.eslintrc.json +2 -1
  3. package/bin/cdsc.js +61 -46
  4. package/doc/API.md +11 -0
  5. package/doc/CHANGELOG_ARCHIVE.md +1592 -0
  6. package/doc/CHANGELOG_BETA.md +26 -5
  7. package/doc/CHANGELOG_DEPRECATED.md +55 -1
  8. package/doc/{DeprecatedOptions.md → DeprecatedOptions_v2.md} +3 -1
  9. package/doc/Versioning.md +20 -1
  10. package/lib/api/.eslintrc.json +2 -2
  11. package/lib/api/main.js +282 -156
  12. package/lib/api/options.js +17 -88
  13. package/lib/api/validate.js +6 -10
  14. package/lib/base/keywords.js +280 -110
  15. package/lib/base/message-registry.js +85 -25
  16. package/lib/base/messages.js +119 -89
  17. package/lib/base/model.js +46 -2
  18. package/lib/base/optionProcessorHelper.js +53 -21
  19. package/lib/checks/actionsFunctions.js +15 -12
  20. package/lib/checks/annotationsOData.js +1 -1
  21. package/lib/checks/cdsPersistence.js +1 -0
  22. package/lib/checks/elements.js +6 -6
  23. package/lib/checks/invalidTarget.js +1 -1
  24. package/lib/checks/nonexpandableStructured.js +1 -1
  25. package/lib/checks/queryNoDbArtifacts.js +2 -1
  26. package/lib/checks/selectItems.js +101 -15
  27. package/lib/checks/types.js +7 -8
  28. package/lib/checks/utils.js +2 -2
  29. package/lib/checks/validator.js +3 -3
  30. package/lib/compiler/assert-consistency.js +78 -21
  31. package/lib/compiler/base.js +6 -4
  32. package/lib/compiler/builtins.js +177 -10
  33. package/lib/compiler/checks.js +1 -1
  34. package/lib/compiler/define.js +28 -23
  35. package/lib/compiler/extend.js +75 -18
  36. package/lib/compiler/finalize-parse-cdl.js +25 -18
  37. package/lib/compiler/index.js +27 -11
  38. package/lib/compiler/moduleLayers.js +7 -0
  39. package/lib/compiler/populate.js +26 -39
  40. package/lib/compiler/propagator.js +12 -7
  41. package/lib/compiler/resolve.js +207 -236
  42. package/lib/compiler/shared.js +100 -93
  43. package/lib/compiler/tweak-assocs.js +13 -20
  44. package/lib/compiler/utils.js +20 -6
  45. package/lib/edm/annotations/preprocessAnnotations.js +12 -13
  46. package/lib/edm/csn2edm.js +35 -37
  47. package/lib/edm/edm.js +22 -13
  48. package/lib/edm/edmAnnoPreprocessor.js +349 -0
  49. package/lib/edm/edmInboundChecks.js +85 -0
  50. package/lib/edm/edmPreprocessor.js +338 -689
  51. package/lib/edm/edmUtils.js +97 -67
  52. package/lib/gen/Dictionary.json +29 -9
  53. package/lib/gen/language.checksum +1 -1
  54. package/lib/gen/language.interp +8 -31
  55. package/lib/gen/language.tokens +105 -114
  56. package/lib/gen/languageLexer.interp +1 -34
  57. package/lib/gen/languageLexer.js +892 -1007
  58. package/lib/gen/languageLexer.tokens +95 -106
  59. package/lib/gen/languageParser.js +20629 -22474
  60. package/lib/inspect/.eslintrc.json +4 -0
  61. package/lib/inspect/index.js +14 -0
  62. package/lib/inspect/inspectModelStatistics.js +81 -0
  63. package/lib/inspect/inspectPropagation.js +189 -0
  64. package/lib/inspect/inspectUtils.js +44 -0
  65. package/lib/json/from-csn.js +74 -69
  66. package/lib/json/to-csn.js +17 -14
  67. package/lib/language/antlrParser.js +2 -2
  68. package/lib/language/docCommentParser.js +61 -38
  69. package/lib/language/errorStrategy.js +52 -40
  70. package/lib/language/genericAntlrParser.js +424 -292
  71. package/lib/language/language.g4 +604 -687
  72. package/lib/language/multiLineStringParser.js +14 -42
  73. package/lib/language/textUtils.js +44 -0
  74. package/lib/main.d.ts +28 -42
  75. package/lib/main.js +104 -81
  76. package/lib/model/api.js +1 -1
  77. package/lib/model/csnRefs.js +57 -30
  78. package/lib/model/csnUtils.js +189 -287
  79. package/lib/model/revealInternalProperties.js +32 -10
  80. package/lib/model/sortViews.js +32 -31
  81. package/lib/modelCompare/compare.js +3 -0
  82. package/lib/optionProcessor.js +91 -57
  83. package/lib/render/.eslintrc.json +1 -1
  84. package/lib/render/DuplicateChecker.js +4 -7
  85. package/lib/render/manageConstraints.js +70 -2
  86. package/lib/render/toCdl.js +387 -367
  87. package/lib/render/toHdbcds.js +20 -16
  88. package/lib/render/toRename.js +44 -22
  89. package/lib/render/toSql.js +81 -59
  90. package/lib/render/utils/common.js +16 -3
  91. package/lib/render/utils/sql.js +20 -19
  92. package/lib/sql-identifier.js +6 -0
  93. package/lib/transform/db/.eslintrc.json +3 -2
  94. package/lib/transform/db/associations.js +43 -35
  95. package/lib/transform/db/cdsPersistence.js +5 -16
  96. package/lib/transform/db/constraints.js +1 -1
  97. package/lib/transform/db/expansion.js +7 -6
  98. package/lib/transform/db/flattening.js +16 -18
  99. package/lib/transform/db/transformExists.js +7 -5
  100. package/lib/transform/db/views.js +3 -3
  101. package/lib/transform/draft/.eslintrc.json +2 -2
  102. package/lib/transform/draft/db.js +6 -6
  103. package/lib/transform/draft/odata.js +6 -7
  104. package/lib/transform/forHanaNew.js +30 -24
  105. package/lib/transform/forOdataNew.js +14 -16
  106. package/lib/transform/localized.js +35 -25
  107. package/lib/transform/odata/toFinalBaseType.js +10 -10
  108. package/lib/transform/odata/typesExposure.js +17 -8
  109. package/lib/transform/odata/utils.js +1 -38
  110. package/lib/transform/transformUtilsNew.js +63 -77
  111. package/lib/transform/translateAssocsToJoins.js +2 -2
  112. package/lib/transform/universalCsn/.eslintrc.json +2 -2
  113. package/lib/transform/universalCsn/coreComputed.js +11 -6
  114. package/lib/transform/universalCsn/universalCsnEnricher.js +33 -5
  115. package/lib/utils/file.js +31 -21
  116. package/lib/utils/moduleResolve.js +0 -1
  117. package/lib/utils/timetrace.js +20 -21
  118. package/package.json +34 -4
  119. package/share/messages/syntax-expected-integer.md +9 -8
  120. package/doc/ApiMigration.md +0 -237
  121. package/doc/CommandLineMigration.md +0 -58
  122. package/doc/ErrorMessages.md +0 -175
  123. package/doc/FioriAnnotations.md +0 -94
  124. package/doc/ODataTransformation.md +0 -273
  125. package/lib/backends.js +0 -529
  126. package/lib/checks/unknownMagic.js +0 -41
  127. package/lib/fix_antlr4-8_warning.js +0 -56
@@ -1,8 +1,1600 @@
1
+ <!-- markdownlint-disable -->
1
2
  # ChangeLog for cdx compiler and backends (Archive)
2
3
 
3
4
  Note: `beta` fixes, changes and features are usually not listed in this ChangeLog.
4
5
  The compiler behaviour concerning `beta` features can change at any time without notice.
5
6
 
7
+ ## Version 2.11.4 - 2021-12-21
8
+
9
+ ### Fixed
10
+
11
+ - CDL parser: in many situations, improve message when people use reserved keywords as identifier
12
+ - Improve error text and error location for ambiguous auto-redirection target
13
+ - to.sql/hdi/hdbcds:
14
+ + Correctly detect `exists` in projections
15
+ + Correctly handle elements starting with `$` in the on-condition of associations
16
+ + Correctly handle sub queries in an entity defined with `projection on`
17
+ + Correctly handle associations in sub queries in a `from` of a sub query
18
+ + foreign key constraints: respect @assert.integrity: false for compositions
19
+ - to.hdbcds: Correctly quote elements named `$self` and `$projection`
20
+ - to.cdl: `when` was added to the keyword list for smart quoting
21
+ - Compiler support for code completion for `$user` and `$session` now respect user
22
+ provided variables in `options.variableReplacements`.
23
+ - API: `deduplicateMessages()` no longer removes messages for `duplicate` artifact/annotation errors.
24
+ Prior to this version, only one of the duplicated artifacts had a message, leaving the user to
25
+ guess where the other duplicates were.
26
+
27
+
28
+ ## Version 2.11.2 - 2021-12-06
29
+
30
+ ### Fixed
31
+
32
+ - to.sql/hdi/hdbcds:
33
+ + No foreign key constraint will be rendered for managed `composition of one` if annotated with `@assert.integrity: false`
34
+ + Correctly handle managed associations with other managed associations as foreign keys in conjunction with `exists`
35
+
36
+ ## Version 2.11.0 - 2021-12-02
37
+
38
+ ### Added
39
+
40
+ - Option `defaultBinaryLength` to set a `length` type facet for all definitions with type `cds.Binary`. This option
41
+ overrides the default binary length in the database backends and is also used as `MaxLength` attribute in Odata.
42
+ - If doc-comments are ignored by the compiler, an info message is now emitted. A doc-comment is ignored,
43
+ if it can't be assigned to an artifact. For example for two subsequent doc-comments, the first doc-comment
44
+ is ignored. To suppress these info messages, explicitly set option `docComment` to `false`.
45
+ - `cdsc`:
46
+ + `cdsc explain list` can now be used to get a list of message IDs with explanation texts.
47
+ + `cdsc` now respects the environment variable `NO_COLOR`. If set, no ANSI escape codes will be used.
48
+ Can be overwritten by `cdsc --color always`.
49
+ - to.sql/hdi: Support SQL Window Functions
50
+ - to.sql/hdi/hdbcds:
51
+ + Support configuration of `$session` and `$user` via option `variableReplacements`.
52
+ + Restricted support for SQL foreign key constraints if option `assertIntegrityType` is set to `"DB"`.
53
+ The behavior of this feature might change in the future.
54
+
55
+ ### Changed
56
+
57
+ - Updated OData vocabularies 'Common' and 'UI'.
58
+ - to.sql/hdi/hdbcds: The default length of `cds.Binary` is set to `5000` similar to `cds.String`.
59
+
60
+ ### Removed
61
+
62
+ - to.hdbcds: Doc comments on view columns are not rendered anymore. Doc comments on string literals will make the deployment fail
63
+ as the SAP HANA CDS compiler concatenates the doc comment with the string literal. Besides that, doc comments on view columns
64
+ are not transported to the database by SAP HANA CDS.
65
+ - to.hdbcds/sql/hdi: Forbid associations in filters after `exists` (except for nested `exists`), as the final behavior is not yet specified.
66
+
67
+ ### Fixed
68
+
69
+ - CSN parser: doc-comment extensions are no longer ignored.
70
+ - Properly check for duplicate annotation definitions.
71
+ - Correctly apply annotations on inherited enum symbols.
72
+ - Correctly apply annotations on elements in an inherited structure array.
73
+ - Fix a bug in API `defaultStringLength` value evaluation.
74
+ - Fix crash if named arguments are used in a function that's inside a `CASE` statement.
75
+ - to.sql/hdi/hdbcds:
76
+ + Properly flatten ad-hoc defined elements in `returns` / `params` of `actions` and `functions`.
77
+ + Correctly handle `*` in non-first position.
78
+ + Correctly handle action return types
79
+ + Correctly handle mixin association named `$self`
80
+ - to.cdl: doc-comments are no longer rendered twice.
81
+ - to.edm(x):
82
+ + Fix a bug in V2/V4 partner ship calculation.
83
+ + Remove warning of unknown types for Open Types in `@Core.Dictionary`.
84
+ + An empty CSN no longer results in a JavaScript type error
85
+
86
+ ## Version 2.10.4 - 2021-11-05
87
+
88
+ ### Fixed
89
+
90
+ - to.sql/hdi/hdbcds:
91
+ + Correctly complain about `exists` in conjunction with non-associations/compositions
92
+ + Don't resolve types in action returns, as this causes issues with $self-resolution
93
+
94
+ - to.edm(x): Be robust against transitively untyped keys in stacked view hierarchies
95
+
96
+ ## Version 2.10.2 - 2021-10-29
97
+
98
+ ### Fixed
99
+
100
+ - to.sql/hdi/hdbcds: Correctly handle `exists` in conjunction with mixin-associations
101
+
102
+ ## Version 2.10.0 - 2021-10-28
103
+
104
+ ### Added
105
+
106
+ - Support arbitrary paths after `$user` - similar to `$session`.
107
+ - Support scale `floating` and `variable` for `cds.Decimal` in CDL and CSN. Backend specific handling is descibed in their sections.
108
+ - Allow select item wildcard (`*`) in a `select`/`projection` at any position, not just the first.
109
+
110
+ - to.edm(x):
111
+ + In Odata V4 generate transitive navigation property binding paths along containment hierarchies and terminate on the
112
+ first non-containment association. The association target is either an explicit Edm.EntitySet in the same EntityContainer
113
+ or in a referred EntityContainer (cross service references) or an implicit EntitySet identified by the containment path
114
+ originating from an explicit EntitySet. This enhancement has an observable effect only in structured format with containment
115
+ turned on.
116
+ + Support for scales `variable` and `floating`:
117
+ + V4: `variable` and `floating` are rendered as `Scale="variable"`. Since V4 does not support `floating`, it is aproximated as `variable`.
118
+ + V2: `variable` and `floating` are announced via property annotation `sap:variable-scale="true"`
119
+
120
+ - to.sql/hdi/hdbcds:
121
+ + Reject scale `floating` and `variable`.
122
+ + Reject arbitrary `$user` or `$session` paths that cannot be translated to valid SQL.
123
+ + Following a valid `exists`, further `exists` can be used inside of the filter-expression: `exists assoc[exists another[1=1]]`
124
+ + `exists` can now be followed by more than one association step.
125
+ `exists assoc.anotherassoc.moreassoc` is semantically equivalent to `exists assoc[exists anotherassoc[exists moreassoc]]`
126
+
127
+ ### Changed
128
+
129
+ - to.odata: Inform when overwriting draft action annotations like `@Common.DraftRoot.ActivationAction`.
130
+
131
+ ## Version 2.9.0 - 2021-10-15
132
+
133
+ ### Changed
134
+
135
+ - to.edm(x): Raise `odata-spec-violation-type` to a downgradable error.
136
+
137
+ ### Fixed
138
+
139
+ - to.edm(x):
140
+ + Fix a bug in annotation propagation to foreign keys.
141
+ + Don't render annotations for not rendered stream element in V2.
142
+ - to.hdi:
143
+ + for naming mode "hdbcds" and "quoted" parameter definitions are not quoted anymore.
144
+ - to.hdi/sql/hdbcds:
145
+ + Correctly handle explicit and implicit alias during flattening.
146
+ + Raise an error for `@odata.draft.enabled` artifacts with elements without types - instead of crashing with internal assertions.
147
+
148
+ ## Version 2.8.0 - 2021-10-07
149
+
150
+ ### Added
151
+
152
+ - Allow defining unmanaged associations in anonymous aspects of compositions.
153
+ - Enable extensions of anonymous aspects for managed compositions of aspects.
154
+ - When the option `addTextsLanguageAssoc` is set to true and
155
+ the model contains an entity `sap.common.Languages` with an element `code`,
156
+ all generated texts entities additionally contain an element `language`
157
+ which is an association to `sap.common.Languages` using element `local`.
158
+ - for.odata:
159
+ + In `--odata-format=flat`, structured view parameters are flattened like elements.
160
+ - to.hdbcds
161
+ + Use "smart quotes" for naming mode "plain" - automatically quote identifier which are reserved keywords or non-regular.
162
+
163
+ ### Changed
164
+
165
+ - for.odata:
166
+ + In `--data-format=structured`, anonymous sub elements of primary keys and parameters are set to `notNull:true`,
167
+ an existing `notNull` attribute is _not_ overwritten. Referred named types are _not_ modified.
168
+ - to.edm(x):
169
+ + Improve specification violation checks of (nested) keys:
170
+ + All (sub-)elements must be `Nullable: false` (error).
171
+ + Must represent a single value (error).
172
+ + In V4 must be a specification compliant Edm.PrimitiveType (warning).
173
+ - to.hdi/hdbcds/sql: $user.\<xy\> now has \<xy\> added as alias - "$user.\<xy\> as \<xy\>"
174
+
175
+ ### Fixed
176
+
177
+ - Properly generate auto-exposed entities for associations in parameters.
178
+ - Correctly apply extensions to anonymous array item types.
179
+ - Correctly apply/render annotations to anonymous action return types.
180
+ - With CSN flavor `plain` (`gensrc`), correctly render annotations on elements
181
+ of referred structure types as `annotate` statements in the CSN's `extensions` property.
182
+ - to.cdl:
183
+ + Correctly render extensions on array item types
184
+ + Correctly render annotations on action return types
185
+ - to/for: Correctly handle CSN input where the prototype of objects is not the "default"
186
+ - to.hdi:
187
+ + for naming mode "hdbcds" and "quoted" parameter definitions are now quoted.
188
+ + for naming mode "plain", smart quotation is applied to parameter definitions if they are reserved words.
189
+ - to.hdi/hdbcds/sql:
190
+ + Ensure that cdl-style casts to localized types do not lose their localized property
191
+ + Fix a small memory leak during rendering of SQL/HDBCDS.
192
+ - to.edm(x): Remove ambiguous `Partner` attribute from `NavigationProperty`. A forward association referred
193
+ to by multiple backlinks (`$self` comparisons) is no longer partner to an arbitrary backlink.
194
+
195
+ ## Version 2.7.0 - 2021-09-22
196
+
197
+ ### Added
198
+
199
+ - to.hdi.migration:
200
+ + Support changes to HANA comments.
201
+
202
+ ### Changed
203
+
204
+ - Updated OData vocabularies 'Common', 'Core'
205
+
206
+ ### Fixed
207
+
208
+ - Fix memory issue: do not keep reference to last-compiled model.
209
+ - Fix dump which occured when trying to report that the user has defined an element to be both `key` and `localized` if
210
+ `localized` was inherited via the provided type, or in the generated entity for a managed composition of aspect.
211
+ - Properly auto-expose targets of associations in parameters and `many`.
212
+ - for.Odata:
213
+ + Fix handling of annotation `@cds.odata.valuelist` in conjunction with associations in structures using flat-mode and sqlMapping set to plain.
214
+ + Set correctly the $localized property in the OData backend resulting CSN for artifacts that have localized convenience views.
215
+ - to.edm(x):
216
+ + Fix rendering of structured referential constraints and nested partnerships in combination with `$self` comparisons.
217
+ + Fix merging of `@Capabilities` annotations while transforming them into `NavigationCapabilities` from the containee into the container.
218
+ - to.sql/hdi/hdbcds:
219
+ + Fix a bug in Association to Join translation in multi-level association redirection in combination with `$self`.
220
+ + Correctly flatten paths with filters or parameters.
221
+ + Improve error message in case of invalid `exists`.
222
+
223
+ ## Version 2.6.2 - 2021-08-26
224
+
225
+ ### Fixed
226
+
227
+ - to.sql/hdi/hdbcds/edm(x)/for.odata: Correctly handle tuple expansion in subqueries of Unions.
228
+
229
+ ## Version 2.6.0 - 2021-08-23
230
+
231
+ ### Added
232
+
233
+ - Support managed associations without foreign keys. Associations targeting a definition without primary keys or with an
234
+ explicit empty foreign key tuple or with empty structured elements as foreign keys and their corresponding `$self`
235
+ comparisons do not describe the relationship between the source and the target entity.
236
+ These associations can be used to establish API navigations but cannot be used to access elements in the target
237
+ entity as they cannot be transformed into a valid JOIN expression.
238
+ Consequently, these associations are not added to the `WITH ASSOCIATIONS` clause or forwarded to HANA CDS.
239
+ - to.sql/hdi/hdbcds/edm(x)/for.odata: Structure/managed association comparisons (tuple comparisons) are now
240
+ also expanded in infix filters, all expressions and all on-conditions.
241
+ - to.hdbcds: Better locations for messages - mostly concerning keywords and duplicates
242
+
243
+ ### Changed
244
+
245
+ - to.sql/hdi/hdbcds: Invalid (i.e. not expandable) usage of structures is now checked - an error is raised
246
+
247
+ ### Removed
248
+
249
+ - The internal non-enumerable CSN property `$env` has been removed from the compiled CSN.
250
+
251
+ ### Fixed
252
+
253
+ - Make `;` optional before `}` in all circumstances (was not the case with `many`).
254
+ - to.sql/hdi/hdbcds/edm(x): More graceful handling of CSN input where associations do not have `keys` or an `on`-condition
255
+
256
+ ## Version 2.5.2 - 2021-08-10
257
+
258
+ ### Fixed
259
+
260
+ - to.hdbcds: Fixed a bug introduced with 2.5.0 that caused virtual elements to be rendered in views.
261
+
262
+ ## Version 2.5.0 - 2021-07-28
263
+
264
+ ### Added
265
+
266
+ - Allow to extend existing array annotation values via the ellipsis operator `...`.
267
+ An ellipsis may appear exactly once at an arbitrary position in the top level array
268
+ of an `annotate` directive. Only array values can be merged into arrays and unapplied
269
+ ellipses are removed from the final array value. Annotation layering rules remain unaffected.
270
+ - to.sql/hdi/hdbcds:
271
+ + Doc comments are translated into HANA comments (or into `@Comment` annotation for `to.hdbcds`).
272
+ Such comments are possible on entities, views, elements of entities and `to.hdbcds` also supports comments on view columns.
273
+ Generation can be disabled via option `disableHanaComments`. Entities/views (and their elements/columns)
274
+ annotated with `@cds.persistence.journal` for `to.hdi`/`to.sql` will not have comments rendered.
275
+ + Generation of temporal `WHERE` clause can be suppressed by annotating the `validFrom`/`validTo` elements of the projection with `false` or `null`.
276
+ - to.sql/hdi/hdbcds/edm(x)/for.odata: Structure/managed association comparisons (tuple comparisons) are now
277
+ also expanded in `WHERE` and `HAVING` - this was previously only supported in on-conditions.
278
+ - `cdsc` now internally uses SNAPI.
279
+ - to.hdi.migration:
280
+ + Validate that the two supplied CSNs are compatible.
281
+ + Improve delta-mechanism to not render superflous [ALTER|DROP|ADD] statements for unchanged SQL.
282
+
283
+ ### Changed
284
+
285
+ - If the first source provided to the compile command has a `$sources` property
286
+ (whether enumerable or not) which is an array of strings,
287
+ use that instead of calculating one.
288
+ - Updated OData vocabularies 'Aggregation', 'Analytics', 'Authorization', 'Capabilities',
289
+ 'CodeList', 'Common', 'Communication', 'Core', 'Graph', 'HTML5', 'Measures', 'ODM', 'PersonalData',
290
+ 'Repeatability', 'Session', 'UI', 'Validation'
291
+
292
+ ### Removed
293
+
294
+ - Removed internal property `$viaTransform` from CSN produced by OData/HANA transformation
295
+
296
+ ### Fixed
297
+
298
+ - Remove warnings 'Ignoring annotation “@odata.draft.enabled” as the artifact is not part of a service'
299
+ and 'Ignoring draft node for composition target ... because it is not part of a service'
300
+ - Doc comments are no longer ignored after enum values and on view columns in parseCdl mode.
301
+ - to.cdl:
302
+ + Doc comments for enum values are correctly rendered.
303
+ + Enum value and doc comments are now correctly rendered if the enum is called `doc`.
304
+ + Doc comments at type references are correctly rendered.
305
+ + Empty doc comments are correctly rendered and not left out.
306
+ + Doc comments on view columns are correctly rendered.
307
+ - to.edm(x):
308
+ + OData V2: Ignore `@odata.singleton`.
309
+ + OData V4: Do not render an `edm:NavigationPropertyBinding` to a singleton if the association has
310
+ cardinality 'to-many'.
311
+ - forOData:
312
+ + Fix automatic renaming of shortcut annotation (eg. `@label`) with value `null`.
313
+ - CSN parser:
314
+ + Empty doc comments are correctly parsed and not complained about.
315
+
316
+ ## Version 2.4.4 - 2021-07-02
317
+
318
+ ### Fixed
319
+
320
+ - Do not remove parentheses around single literals and references on the right-hand side of an `in` and `not in` operator.
321
+
322
+ ## Version 2.4.2 - 2021-07-01
323
+
324
+ - Only changes to beta features. Refer to the [beta ChangeLog](doc/CHANGELOG_BETA.md#version-242) for more.
325
+
326
+ ## Version 2.4.0 - 2021-06-28
327
+
328
+ ### Added
329
+
330
+ - to.edm(x):
331
+ + Warn if an `edm:Property` has no `Type` attribute.
332
+ + Warn about using the protected names 'Edm', 'odata', 'System', 'Transient' as `edm:Schema` `Namespace` values.
333
+ + Allow `$edmJson` inline annotations in `edm:Collection` and nested annotations.
334
+ - to.hdi/sql/hdbcds: Transform a `exists <association>` into a `exists <subselect>`, where the subselect
335
+ selects from the target of `<association>` and establishes the same relation as `<association>` would via the WHERE clause.
336
+ Infix-filters of `<association>` are added to the WHERE clause.
337
+
338
+ ### Changed
339
+
340
+ - Do not inherit `@cds.persistence.skip` when `@cds.persistence.table` is set on entity.
341
+ - to.cdl: Opening and closing braces of empty services and contexts are now on the same line.
342
+
343
+ ### Fixed
344
+
345
+ - `cdsc`: Option `--direct-backend` can now be combined with `toCsn`'s option `--with-localized`
346
+ - The option `testSortCsn` was erroneously ignored in some compiler backends.
347
+
348
+ ## Version 2.3.2 - 2021-06-14
349
+
350
+ ### Fixed
351
+
352
+ - for.odata: Propagate the `virtual` attribute correctly while flattening structures.
353
+ - If internal relational types are used directly in CDL (e.g. `cds.Association`), an error is emitted.
354
+ In CSN, all artifacts of relational types need a `target` (/`targetAspect`) as well.
355
+ - In Association to Join translation don't produce a JOIN node for exposed (transitive) associations in
356
+ combination with their exposed foreign keys. Also resolve foreign keys correctly against the target
357
+ entity allowing to expose renamed foreign keys when aliased.
358
+ - The option `testSortCsn` (`--test-sort-csn` in `cdsc`) can be used to sort CSN definitions alphabetically.
359
+ This option is only intended for tests. This will restore the pre-v2.3.0 ordering in EDMX.
360
+ - to.sql:
361
+ + for SQL-dialect `sqlite`, render the string-format-time function (`strftime()`)
362
+ + `$at.from` with date-format: `'%Y-%m-%dT%H:%M:%S.000Z'`
363
+ + `$at.to` with date-format: `'%Y-%m-%dT%H:%M:%S.001Z'` (**+1ms** compared to `$at.from`)
364
+ + for SQL-dialect `hana` wrap `SESSION_CONTEXT('VALID-TO')` and `SESSION_CONTEXT('VALID-FROM')` in `TO_TIMESTAMP(..)` function
365
+ - to.hdbcds:
366
+ + Wrap `SESSION_CONTEXT('VALID-TO')` and `SESSION_CONTEXT('VALID-FROM')` in `TO_TIMESTAMP(..)` function
367
+
368
+ ## Version 2.3.0 - 2021-06-02
369
+
370
+ ### Added
371
+
372
+ - `cdsc` got a new option `--fallback-parser <cdl|csn>` that is used
373
+ if an unknown or no file extension is used.
374
+ - to.hdi/sql: Allow association publishing in UNIONs - this was previously forbidden, but this limitation only applies to HANA CDS.
375
+ - to.edm(x): Support dynamic expressions as $edmJson inline code
376
+
377
+ ### Changed
378
+
379
+ - Type `DecimalFloat` is no longer proposed for code-completion.
380
+ - Non-string enums without values for their enum elements are warned about.
381
+ - OData CSN is no longer sorted by definition names
382
+ - to.edm(x): Update OData vocabularies 'Aggregation', 'Analytics', 'CodeList', 'Common', 'Measures', 'Session', 'UI'
383
+
384
+ ### Removed
385
+
386
+ - to.hdbcds: Association publishing in subqueries is not supported by HANA CDS - an error is raised during compile time, instead of waiting for a deployment error.
387
+
388
+ ### Fixed
389
+
390
+ - Correct auto-exposure in model with unscoped projection on deep scoped entity
391
+ (from managed aspect compositions: component in component, like they are common in ODM).
392
+ - Internal types `cds.Association` and `cds.Composition` are no longer proposed for code-completion.
393
+ - Fix various issues with Association to Join translation:
394
+ + Substitute `$self.alias` expressions and respect prefix paths in foreign key accesses.
395
+ - to.hdbcds: In naming mode "hdbcds", correctly resolve $self backlinks with aliased foreign keys.
396
+ - to.cdl:
397
+ + Correctly traverse subelements when rendering annotations for them.
398
+ + Quote element names (if required) in `annotate with` statements.
399
+ - for.odata: Fix regression with detecting collision when generating foreign keys.
400
+ - to.edmx: Correctly render final base types in EDMX V2 when called with transformed OData CSN for V4.
401
+
402
+ ## Version 2.2.8 - 2021-05-20
403
+
404
+ ### Fixed
405
+
406
+ - Fix regression: also for associations _defined_ in a service, try to
407
+ implicitly redirect the provided model target.
408
+
409
+ ## Version 2.2.6 - 2021-05-12
410
+
411
+ ### Fixed
412
+
413
+ - to.edmx(x):
414
+ + The reverted change "`array of` elements are now allowed for OData V2, too." introduced with v2.2.0 has caused
415
+ regressions in various scenarios that used OData V4 processed CSN for OData V2 EDMX rendering. Therefore
416
+ the error has been lowered to a 'odata-spec-violation-array-of' warning.
417
+ + The fix 'Render constraints only if all principal keys are used in association' introduced with v2.2.2 has
418
+ caused regressions in mocking scenarios. With option `--odata-v2-partial-constr` partial constraint generation
419
+ can be reactivated. A 'odata-spec-violation-constraints' warning is raised.
420
+
421
+ ### 2.5.0 Addendum to Changed
422
+
423
+ - Replace outdated option `length` with `defaultStringLength` which is usable in `for.*` and `to.*` APIs.
424
+
425
+
426
+ ## Version 2.2.4 - 2021-05-06
427
+
428
+ No changes compared to Version 2.2.2; fixes latest NPM tag
429
+
430
+ ## Version 2.2.2 - 2021-05-04
431
+
432
+ ### Fixed
433
+
434
+ - Usually reserved names like `in` in references used as annotation values can now really
435
+ be provided without delimited identifiers (if the name is not `true`, `false` or `null`).
436
+ - Fixed the implicit redirection of associations to scoped targets (like texts entities).
437
+ - Fix regression: Allow virtual structured elements.
438
+ - to.edm(x):
439
+ + OData V2:
440
+ + Remove warning about scalar return types.
441
+ + Render constraints only if all principal keys are used in association.
442
+ + OData V4: Don't remove `@Capabilities` annotations from containee.
443
+ + Allow `@Core.MediaType` on all types and raise a warning for those (scalar) types that can't be mapped to `Edm.String` or `Edm.Binary`.
444
+ - to.cdl: Also handle subelement-annotations by rendering a `annotate X with Y`.
445
+ - to.hdi/sql/hdbcds: Fixed the DB name (with naming mode `quoted`/`hdbcds`) and the `to.hdi` file name of scoped definitions (like `texts` entities) in services.
446
+ - Empty enums no longer result in a syntax error.
447
+
448
+ ## Version 2.2.0 - 2021-04-28
449
+
450
+ ### Added
451
+
452
+ - The compiler now takes the “definition scope” of associations and compositions into account
453
+ when implicitly redirecting the target and auto-exposing entities.
454
+ - odata: The warning `enum-value-ref` is no longer reclassified to an error.
455
+ However, references to other enum values are still not supported.
456
+
457
+ ### Changed
458
+
459
+ - Remove special handling for implicit redirection to auto-exposed entity; consistently
460
+ do not overwrite user-specified target in a service anymore, also in this special case.
461
+ - Structured/Arrayed types for enums are now an error and not just a warning.
462
+ - to.cdl: Keywords in annotation paths are no longer escaped
463
+
464
+ ### Removed
465
+
466
+ - Consistently reject references to auto-exposed entities except for `annotate`
467
+ (it might have worked before, depending on the sequence of definitions);
468
+ expose an entity manually if you want to refer to it.
469
+
470
+ ### Fixed
471
+
472
+ - Do not omit indirectly annotated or redirected sub elements
473
+ during propagation of expanded sub elements.
474
+ - Also auto-expose composition targets of projected compositions,
475
+ not just those target which were used at the original definition of the composition.
476
+ - Improve checks for keys which are `array of` or of SAP HANA spatial type (`ST_POINT` & `ST_GEOMETRY`)
477
+ with checking also inside of used user-defined structured type.
478
+ - to.edm(x):
479
+ + V2: `OnDelete=Cascade` was set on dependent instead on principal role.
480
+ + V4: ReferentialConstraints Property and ReferencedProperty for managed composition to one were swapped.
481
+
482
+ ### 2.2.6 Addendum to Changed
483
+
484
+ - to.edm(x): Revert 2.1.0 change: "`array of` elements are now allowed for OData V2, too."
485
+ OData V2 does not allow elements to be typed with `Collection()`. Any `many`
486
+ predicate in element definitions is rejected. The only two positions where the `many` predicate
487
+ is allowed are `association to many` and `returns many`.
488
+
489
+ ## Version 2.1.6 - 2021-04-14
490
+
491
+ ### Fixed
492
+
493
+ - Do not unjustified complain about `$self` comparisons.
494
+ - Auto-exposed entities are represented as projections in the CSN.
495
+ - to.sql/to.hdi:
496
+ + Revert change "Default values are no longer propagated from the principal to the generated foreign key element." from version 2.1.0
497
+ + Fix regression where localized convenience views for temporal entities used keys in the from clause that did not exist on the texts-entity
498
+ + Mixin associations are properly removed and are not rendered into views anymore
499
+ - to.hdi(.migration): Ensure filenames for `.hdbindex` files stay compatible to V1
500
+ - for.odata: An association as a type of action's parameter or return type now signals an error
501
+ - to.edm(x):
502
+ + `@Capabilities` annotations remain on the containees entity type
503
+ + In containment mode don't render foreign keys of the containment constituting 'up' association in the containee
504
+ as primary key refs.
505
+ + Revert change "Default values are no longer propagated from the principal to the generated foreign key element." from version 2.1.0
506
+ + Allow `--odata-proxies` and/or `--odata-x-service-refs` in combination with `--odata-format=flat` and `--version=v4`
507
+
508
+ ## Version 2.1.4 - 2021-03-31
509
+
510
+ ### Fixed
511
+
512
+ - The postinstall step now never fails with an exit code != 0. As the postinstall step is optional, it should not break any `npm install` steps.
513
+
514
+ ## Version 2.1.2 - 2021-03-29
515
+
516
+ ### Fixed
517
+
518
+ - ensure `postinstall` script is part of the shipped `package.json`
519
+
520
+ ## Version 2.1.0 - 2021-03-26
521
+
522
+ ### Added
523
+
524
+ - Inferred sub elements of a referred structure type can be individually annotated.
525
+ - All primitive types except for binary are now allowed as enum value types.
526
+ - Allow users to define `A.B` even if there is a definition `A` which is not a context or service.
527
+ - You can now provide almost all annotation assignments without delimited identifiers:
528
+ the use of `.`, `@` and `#` is fine for annotation names,
529
+ property names of structures, and in references used as annotation values.
530
+ - for.odata:
531
+ + All the artifacts that have localized fields get a `$localized: true` property.
532
+ + Allow the user to define draft actions for annotation purposes
533
+ + `draftPrepare(SideEffectsQualifier: String) returns <ET>`,
534
+ + `draftActivate() returns <ET>`,
535
+ + `draftEdit(PreserveChanges: Boolean) returns <ET>`
536
+ - to.edm(x):
537
+ + Warn about non-applicable annotations.
538
+ + Render property default values (only OData V4).
539
+ + Option `odataProxies` exposes association targets outside of the current service.
540
+ These `EntityType`s do only expose their primary keys have no accompanying `EntitySet`.
541
+ The added navigation targets are exposed under their namespace or if not available under namespace `root`.
542
+ `odataProxies` is only available with `--format=structured`.
543
+ + Option `odataXServiceRefs` renders an `edm:Reference` to the service for those navigation targets
544
+ that are defined in another service. `odataXServiceRefs` is only available with `--format=structured`.
545
+ + Duplicate EntityContainer entries with same name will raise an error.
546
+ + `array of` elements are now allowed for OData V2, too.
547
+ - to.sql/hdi/hdbcds: Explicitly render the implicit alias for functions without arguments, e.g. `current_date`.
548
+ - to.sql:
549
+ + Sort the SQL statements according to the deployment order.
550
+ + New sql dialect `plain`, which now is the default.
551
+ synchronously.
552
+ - API:
553
+ + `compileSync()` is now compatible to `compile()`:
554
+ the function can also receive a file cache and will resolve all `using`s
555
+ + New API functions `parse.cql` (prefer it to deprecated `parseToCqn`) and
556
+ `parse.expr` (prefer it to deprecated `parseToExpr`)
557
+ + function `getArtifactCdsPersistenceName` now accepts a CSN as a third parameter (used to be a namespace). With a CSN provided,
558
+ the name can be correctly constructed for naming modes `quoted` and `hdbcds`. Without a CSN, the name is possibly wrong
559
+ if it contains dots. If the CSN is not provided or the third parameter is not a CSN, the old, deprecated, implementation is used.
560
+ - `cdsc` and other client tools:
561
+ + Added `--with-localized` to the command `toCsn` which adds convenience views for localized entities to the output.
562
+ + A script `bin/cds_update_identifiers.js` was added. You can use it to update the delimited identifier style in your CDS sources.
563
+ + A script `bin/cdscv2m.js` was added.
564
+ It's command `ria` adds `@cds.redirection.target: false` annotate statements
565
+ for all ambiguous redirection errors.
566
+ - Added `deprecated` options; setting any of them disables all `beta` options.
567
+
568
+ ### Changed
569
+
570
+ - CSN representation:
571
+ + CSN Version is set to `2.0`
572
+ + CSN `definitions` are not sorted anymore
573
+ + `$syntax` is non-enumerable
574
+ + increase the use of JS numbers in the CSN for numbers in CDL, especially noticable in annotation values
575
+ + Annotation definitions are to be found in the top-level property `vocabularies`.
576
+ + Introduce `kind: 'aspect'` to replace `kind: 'type', $syntax: 'aspect'` and
577
+ `kind: 'entity', abstract: true` (the deprecated variants are still accepted as input).
578
+ + Projections are rendered via `projection` instead of `query.SELECT`.
579
+ + Parentheses are represented structurally and unnecessary parentheses are omitted.
580
+ + Use `.` instead of `_` for the name suffix of generated texts entities and the calculated entity for managed compositions.
581
+ + The CSN returned by `compile()` does not include localized convenience views anymore.
582
+ - Core engine (function `compile`):
583
+ + An assignment `@Foo.Bar` is always `@Foo.Bar`, we do not try to search anymore
584
+ for a local definition of `Foo` probably having a different full name.
585
+ + Localized convenience views are no longer generated by the core compiler but added by the `for.odata`
586
+ and `to.sql/hdi/hdbcds` processing on demand.
587
+ + Minimize name clashes when calculating names for autoexposed entities,
588
+ extends the v1 option `dependentAutoexposed` to sub artifacts of entites (see “Added”).
589
+ + Ambiguities when redirecting associations now always lead to compile errors;
590
+ you might want to use the new annotation `@cds.redirection.target` to solve them.
591
+ + The association `up_` in the calculated entity for managed compositions is now managed.
592
+ _Limitation_: Nested managed compositions are not activatable via `to.hdbcds --names=hdbcds`.
593
+ + Bound actions and functions are no longer propagated from the main query source to the resulting view or projection.
594
+ + Remove annotation `@cds.autoexpose` from generated `.texts` entity
595
+ + Require `order by` references to start with a table alias when referring to source elements.
596
+ + Infer the type of a `select` item from the type of a top-level `cast`.
597
+ - Localized convenience views now also contain `masked` elements of the original artifact.
598
+ - for.odata:
599
+ + Even with `--format: structured`, (flat) foreign keys for managed associations are generated.
600
+ + An `entity` or an `aspect` defined outside the current service cannot be used as action parameter or return types.
601
+ + Structured elements are expanded in-place.
602
+ + Foreign keys for managed associations are created in-place.
603
+ - to.edm(x):
604
+ + An `Edm.TypeDefinition` is rendered for a derived scalar type and used as type reference instead of
605
+ rendering the final scalar type, including the `array of`/`many` predicates.
606
+ + `enum` type definition as service member is rendered as `edm:TypeDefinition` instead of `edm:EnumType`.
607
+ + Set default source cardinality of compositions to exact one. This is observable in V2 EDM only.
608
+ + Key must not be `nullable=true`, this includes all sub elements of used structured types.
609
+ + Default values are no longer propagated from the principal to the generated foreign key element.
610
+ + `array of array` is rejected, nested Collections `Collection(Collection(...))` are illegal.
611
+ + Temporal rendering:
612
+ + `@cds.valid.from` is not `Edm.KeyRef` anymore.
613
+ + `@cds.valid.key` is rendered as `@Core.AlternateKeys`.
614
+ + Downgrade message "`<Term>` is not applied" from warning to info.
615
+ + Update Vocabularies 'Aggregation', 'Capabilities', 'Core', 'Validation'.
616
+ - to.sql/to.hdi/to.hdbcds:
617
+ + Reject using associations or compositions in query elements starting with `$self` or `$projection`.
618
+ + Virtual elements are not rendered.
619
+ + Structured elements are expanded in-place.
620
+ + Foreign keys for managed associations are created in-place.
621
+ + Implicit/CDL-style casts are not rendered as SQL CASTs.
622
+ + All association usages in queries are always translated into JOIN expressions
623
+ (except for to.hdbcds `--names=hdbcds`).
624
+ - to.sql/to.hdi:
625
+ + Downgrade message `to-many-no-on` from error to warning.
626
+ + Default values are no longer propagated from the principal to the generated foreign key element.
627
+ - to.sql:
628
+ + Changed type mappings for `--dialect=sqlite`:
629
+ + `cds.Date` -> `DATE_TEXT`
630
+ + `cds.Time` -> `TIME_TEXT`
631
+ + `cds.Timestamp` -> `TIMESTAMP_TEXT`
632
+ + `cds.DateTime` -> `TIMESTAMP_TEXT`
633
+ + `cds.Binary` -> `BINARY_BLOB`
634
+ + `cds.hana.Binary` -> `BINARY_BLOB`
635
+ + Don't check missing type facets.
636
+ - to.hdbcds:
637
+ + References to derived, primitive types are replaced by their final type.
638
+ The derived type definitions are not rendered anymore for hdbcds naming mode.
639
+ + Don't check missing type facets in views.
640
+ - to.cdl:
641
+ + Render maximum cardinality as 'to one' or 'to many'.
642
+ + Return at most two files. The first one (named `model.cds`) contains all definitions, simply rendered in order,
643
+ without namespaces or usings. Contexts and services are NOT nested. The second file (named `<namespace>.cds`)
644
+ represents the CSN `namespace` property, simply defining such a namespace and requiring the first file.
645
+ - API changes:
646
+ + The API functions `compile()` and `compileSync()` return a CSN and not an XSN,
647
+ `compactModel()` returns the first argument.
648
+ + If `options` does not provide a `messages` property, all messages are printed to standard error.
649
+ + The `options.messages` is kept throughout the compiler and contains all messages from the compiler and all backends.
650
+ + Messages are not sorted anymore; use the API function `sortMessages` to have it sorted.
651
+
652
+ ### Removed
653
+
654
+ - Core engine (function `compile`):
655
+ + Referential integrity issues now always lead to compile errors.
656
+ + The `type of` operator (without `:` in the reference) cannot be used
657
+ for parameters and inside queries anymore.
658
+ + Using `"…"` for delimited identifiers leads to a compile error.
659
+ + Issue an error for “smart artifact references”, i.e.
660
+ when using `Definition.elem` instead of `Definition:elem`
661
+ + The definition of annotations is no longer allowed in `context`s and `service`s.
662
+ + Providing an alias name without `as` leads to a compile error or warning.
663
+ + Providing unexpected kind of definitions for `type` or other references leads to a compile error.
664
+ + The ancient CSN 0.1.0 format generation has been removed.
665
+ + The compiler does no longer look for modules whose file extension is `.csn.json`,
666
+ both `.csn` and `.json` is still checked.
667
+ - for.odata:
668
+ + With `--format: structured`, the property `$generatedFieldName` in keys of
669
+ managed associations has been removed.
670
+ + Artificially exposed types that are required to make a service self contained are
671
+ removed from the OData processed CSN.
672
+ + Localized convenience views are no longer part of the OData CSN.
673
+ - API changes:
674
+ + The deprecated XSN based transformers `forHana`, `forOdata`, `toSwagger`, `toSql`, `toCsn`, `toCdl`
675
+ have now been removed from the code base.
676
+ + Remove `collectSources()` as well as `options.collectSources`.
677
+ + A `CompilationError` usually does not have the property `model` anymore,
678
+ to avoid potential memory issues.
679
+ + CSN compiler messages no longer have a `location` property. Use `$location` instead.
680
+ - The following `cdsc` options have been removed:
681
+ + `--old-transformers`.
682
+ + `--hana-flavor` with all corresponding rudimentarily implemented language constructs.
683
+ + `--new-resolve` (the new resolver is now the default).
684
+
685
+ ### Fixed
686
+
687
+ - Core engine (function `compile`):
688
+ + Managed composition in sub elements are now properly redirected,
689
+ even if the sub structure comes from a referred type.
690
+ + Do not dump with sub queries in the `on` condition of `join`s.
691
+ + Properly report that managed aspect composition inside types and as sub elements
692
+ are not supported yet.
693
+ + Make sure that including elements with managed aspect compositions only
694
+ use the provided target aspect, but not the generated target entity.
695
+ + Properly handle the extra keywords in the third argument of the HANA SQL function `round`.
696
+ - to.edm(x):
697
+ + Return all warnings to the user.
698
+ + Don't render references and annotations for unexposed associations.
699
+ + Rendering of `@Validation.AllowedValue` for elements of type enum annotated with `@assert.range`:
700
+ + Add `@Core.Description`, if the enum symbol has a `@Core.Description`, `@description` or document comments.
701
+ + Primary key aliases are now the path basenames, colliding aliases are numbered.
702
+ + Fix a bug in constraint calculation if principal has no primary keys.
703
+ + Illegal OData identifiers which are not exposed in the generated edmx schema are not causing errors anymore.
704
+ + Improve non-enum value handling on term definitions based on an enum type by raising a warning and rendering
705
+ the value with appropriate scalar EDM type.
706
+ + Render annotion qualifier in JSON format.
707
+ - to.sql/hdi/hdbcds:
708
+ + Reject structured view parameters for HANA.
709
+ + Types are not rendered anymore for HANA in quoted mode.
710
+ + Structured elements in subqueries are now properly expanded.
711
+ + Actions, functions, annotations and events do not have DB specific checks run on them, as
712
+ they will not be part of the resulting artifacts anyways
713
+ + With `--names=quoted` or `hdbcds`, some `.` in artifact names are turned into `_`.
714
+ In general, this happens when part of the name prefix is "shadowed" by a non-context/service;
715
+ any `.` after that point is turned into `_`. This change also affects the filenames and the
716
+ `@cds.persistence.name` annotation in the CSN returned by `to.hdi.migration` and `for.odata`.
717
+ - to.sql/hdi:
718
+ + Fixed a bug which led to an exception if elements were referenced as types.
719
+ + For the SQLite dialect, date, time and timestamp are rendered as simple string literals instead of function calls.
720
+ + For naming mode "plain", date, time and timestamps are rendered as SQL-compliant literals.
721
+ - to.sql/hdbcds: Fix issue which led to wrong ON conditions for naming mode `hdbcds`.
722
+ - to.sql:
723
+ + SRID of SAP HANA spatial type (`ST_POINT` & `ST_GEOMETRY`) is not rendered as the length of `CHAR`
724
+ for SQL-dialects other than `hana`. The resulting `CHAR` has a default length of 2000.
725
+ - to.hdbcds:
726
+ + Nullability constraints on view parameters are not rendered anymore.
727
+ + CDS and HANA CDS types inside cast expressions are mapped to their SQL-counterparts, as the CDS types can't be used in a cast.
728
+ - to.cdl: Correctly render `event` typed as `projection`.
729
+ - to.hdi.migration: Don't generate `ALTER` for type change from association to composition or vice versa (if the rest stays the same),
730
+ as the resulting SQL is identical.
731
+
732
+ ## Version 1.50.10 - 2021-07-30
733
+
734
+ ### Fixed
735
+
736
+ - to.hdi.migration: Check for incompatible CSN versions to avoid wrongly generated ALTER|DROP|ADD statements.
737
+
738
+ ## Version 1.50.8 - 2021-07-01
739
+
740
+ ### Fixed
741
+
742
+ - to.hdi.migration: Don't generate `ALTER` for type change from association to composition or vice versa (if the rest stays the same), as the resulting SQL is identical.
743
+
744
+ ## Version 1.50.6 - 2021-05-05
745
+
746
+ ### Fixed
747
+
748
+ - to.edm(x):
749
+ + OData V2: Render constraints only if all principal keys are used in association.
750
+ + OData V4: Don't remove `@Capabilities` annotations from containee.
751
+ + Allow `@Core.MediaType` on all types and raise a warning for those (scalar) types that can't be mapped to `Edm.String` or `Edm.Binary`.
752
+
753
+ ## Version 1.50.4 - 2021-04-06
754
+
755
+ ### Fixed
756
+
757
+ - to.hdbcds: CDS and HANA CDS types inside cast expressions are mapped to their SQL-counterparts, as the CDS types can't be used in a cast.
758
+
759
+ ## Version 1.50.2 - 2021-03-19
760
+
761
+ ### Fixed
762
+
763
+ - Correct calculation of dependent autoexposed entity name
764
+ (fixing a potential regression with v1.50.0)
765
+ - to.hdi.migration: Correctly handle "temporal" and other cases when rendering expressions
766
+ - to.edm(x):
767
+ + Improve non-enum value handling on Oasis enum term definitions by raising a warning and rendering
768
+ the value with appropriate scalar EDM type.
769
+ + Render annotion qualifier in JSON format.
770
+ - Update OData vocabularies
771
+ 'Aggregation', 'Analytics', 'Capabilities', 'CodeList', 'Common', 'Communication',
772
+ 'Core', 'Graph', 'HTML5', 'ODM', 'PersonalData', 'Session', 'UI'
773
+
774
+ ## Version 1.50.0 - 2021-02-25
775
+
776
+ ### Added
777
+
778
+ - Introduce annotation `@cds.redirection.target`.
779
+ With value `false`, the projection is not considered an implicit redirection target;
780
+ with value `true`, is is considered a “preferred” redirection target.
781
+
782
+ ## Version 1.49.2 - 2021-02-16
783
+
784
+ ### Fixed
785
+
786
+ - to.edm(x): Illegal OData identifiers which are not exposed in the generated edmx schema are not causing errors anymore.
787
+ - to.cdl: Annotations are now rendered with the new delimited Identifier syntax
788
+ - to.sql/hdi:
789
+ + Fixed a bug which led to an exception if elements were referenced as types.
790
+ + For the SQLite dialect, date, time and timestamp are rendered as simple string literals instead of function calls.
791
+ + For naming mode "plain", date, time and timestamps are rendered as SQL-compliant literals.
792
+
793
+ ## Version 1.49.0 - 2021-01-29
794
+
795
+ ### Added
796
+
797
+ - to.hdi/sql:
798
+ + Updated the list of reserved keywords for HANA and SQLite
799
+ + Use "smart quoting" for naming mode "plain" - automatically quote reserved keywords
800
+ - to.hdi.migration:
801
+ + Supports various kinds of entity changes: entity addition/deletion/change (the latter including element additions/deletions/type changes).
802
+ + Provides option to render any element type change as `ALTER TABLE DROP` to prevent deployment issues due to incompatible data
803
+ (default for length reductions or association/composition changes).
804
+ - to.cdl: Smart artifact references are now rendered explicitly via `:` notation
805
+
806
+ ### Changed
807
+
808
+ - OData/EDMX:
809
+ Change the `EntityType` precedence of the OData term definition `AppliesTo=` attribute. If `AppliesTo` contains
810
+ both `EntityType` and `EntitySet`, the annotation was assigned to the entity type. Extending an
811
+ `AppliesTo=[EntitySet]` with `EntityType` would be OData compliant but incompatible for clients
812
+ which still expect the annotation at the set and do not perform the full lookup.
813
+ With this change, `EntitySet` and `EntityType` are treated individually, effectively annotating the type and
814
+ (if available) the set. This fixes both extendability and client behavior.
815
+
816
+ ### Fixed
817
+
818
+ - Structured foreign key and forward association reference paths used in ON condition definitions
819
+ are now translatable into the correct short form ON condition paths in Association to Join translation.
820
+ - to.hdbcds: Aliased mixin-associations are now handled correctly
821
+
822
+ ## Version 1.48.0 - 2021-01-15
823
+
824
+ ### Changed
825
+
826
+ - to.hdbcds/hdi/sql: Reject using associations or compositions in query elements starting with `$self` or `$projection`.
827
+ - OData: Update vocabularies 'Common', 'PersonalData', 'UI'.
828
+
829
+ ### Fixed
830
+
831
+ - Using a hex literal like `x'D028'` (in a CSN input) could lead to an error.
832
+ - for.odata:
833
+ + Fix a bug in constraint calculation if principal has no primary keys.
834
+ + Don't overwrite user defined `@Core.Computed` annotation.
835
+ - to.hdi/sql/hdbcds: Fixed a bug during processing of skipped/otherwise not db-relevant artifacts.
836
+
837
+ ## Version 1.47.0 - 2020-12-11
838
+
839
+ ### Changed
840
+
841
+ - Update vocabularies 'Aggregation', 'Common'
842
+
843
+ ### Fixed
844
+
845
+ - to.hdbcds/hdi/sql:
846
+ + Types are not rendered anymore for SAP HANA in quoted mode.
847
+ + Aliases are now respected when resolving $self
848
+ + Association clones are now pre-pended with three underscores (`_`) instead of two
849
+ to prevent shadowing of context names or usings
850
+
851
+ ## Version 1.46.6 - 2020-12-01
852
+
853
+ ### Fixed
854
+
855
+ - OData identifiers can now include all unicode characters which are described in the OData specification.
856
+
857
+ ## Version 1.46.4 - 2020-11-28
858
+
859
+ ### Fixed
860
+
861
+ - Association to Join translation: Fix using forward association target as table alias in ON condition.
862
+
863
+ ## Version 1.46.2 - 2020-11-20
864
+
865
+ ### Fixed
866
+
867
+ - to.edm(x) Fix a bug in the alias calculation for key references in structured OData.
868
+
869
+ ## Version 1.46.0 - 2020-11-20
870
+
871
+ ### Changed
872
+
873
+ - to.edm(x):
874
+ + V4 structured key ref path aliases are now the basenames, colliding aliases are numbered.
875
+ + Lower level to `info` for "‹Term› is not applied" message if an annotation cannot be applied.
876
+ - OData:
877
+ + Update vocabulary 'UI'
878
+ + Correctly handle `not null` during flattening. Only if the parent and all subelements in the chain
879
+ are `not null`, make the corresponding flat leaf element `not null`.
880
+
881
+ ### Fixed
882
+
883
+ - Do not consider events to be potential targets for implicit redirections:
884
+ strange warnings for multiple projections or other strange errors disappear.
885
+ - to.hdbcds/hdi/sql:
886
+ + Reject structured view parameters for HANA.
887
+ + Correctly handle `not null` during flattening.
888
+ Only if the parent and all subelements in the chain are `not null`, make the corresponding flat leaf element `not null`.
889
+ - to.edm(x): Render @assert.range enum annotations correctly (enum symbol as value and don't omit zero value).
890
+ - Fixed CDS module resolution with option `newResolve` on Windows where a superfluous `\` was prepended to absolute paths.
891
+
892
+ ## Version 1.45.0 - 2020-10-30
893
+
894
+ ### Added
895
+
896
+ - OData: Warn about non-applicable annotations.
897
+
898
+ ### Changed
899
+
900
+ - A warning is emitted for annotation definitions inside services/contexts as this won't be
901
+ allowed in the next major cds-compiler release.
902
+ - OData: Update vocabularies 'Analytics' and 'Common'.
903
+
904
+ ### Fixed
905
+
906
+ - Association to Join translation: Fill empty select blocks with aliased columns.
907
+ - to.edm(x):
908
+ + Some EDM(x) warnings were not properly passed to the user.
909
+ + Don't render references and annotations for unexposed associations.
910
+ - to.hdbcds: Warnings during rendering of the hdbcds were not raised to the user.
911
+ - Issue which led to wrong on-conditions for `hdbcds` naming mode.
912
+
913
+ ## Version 1.44.4 - 2020-10-16
914
+
915
+ ### Fixed
916
+
917
+ - to.hdbcds/hdi/sql: The processing of managed associations as foreign keys now works regardless of the order in which the possible chains are resolved.
918
+ - OData: Namespaces are brought back into the exposed types. Dots are replaced with underscores in the name.
919
+
920
+ ## Version 1.44.2 - 2020-10-09
921
+
922
+ ### Added
923
+
924
+ - OData: The annotations `@assert.format` and `@assert.range` now result in adding the
925
+ `@Validation.Pattern` and `@Validation.AllowedValues` in the resulting EDMX.
926
+ - A new compiler option `newResolve` is added (`--new-resolve` for `cdsc`). When set to `true` a new
927
+ module resolver is used which needs fewer file lookups. It will become the default in the future.
928
+ - Event definitions can be typed with a reference to an event.
929
+ - When the new option `withLocation` is set,
930
+ the property `$location` in the CSN is enumerable instead of non-enumerable;
931
+ the value of `$location` is an object with sub properties `file`, `line` and `col`
932
+ which describes the source position of all definitions, elements and other members.
933
+
934
+ ### Changed
935
+
936
+ - OData:
937
+ + The `namespace` is now not part of the exposed type's name.
938
+ + Update vocabularies 'Aggregation', 'UI' and 'Validation'.
939
+
940
+ ## Version 1.43.0 - 2020-10-02
941
+
942
+ ### Added
943
+
944
+ - The magic variable `$session` is now supported. All element accesses are unchecked.
945
+ - Reference paths as annotation values can now contain identifiers starting with `@`.
946
+
947
+ ### Changed
948
+
949
+ - OData:
950
+ + Raise message level for illegal OData identifiers from warning to error.
951
+ + Update vocabularies 'Aggregation' and 'Common'.
952
+
953
+ ### Fixed
954
+
955
+ - to.hdi/hdbcds/sql: Correctly process the elements of subqueries in localized view variants
956
+
957
+ ### Removed
958
+
959
+ ### Fixed
960
+
961
+ - OData: put default value validation under `beta:odataDefaultValues`
962
+
963
+ ## Version 1.42.2 - 2020-09-29
964
+
965
+ ### Fixed
966
+
967
+ - CDL: Action blocks can now be empty, e.g. `entity E {…} actions { }`.
968
+ - An info message is emitted if builtin types are annotated. Use a custom type instead.
969
+ Annotating builtins in CDL is possible but when transformed into CSN the annotation was silently lost.
970
+ It is now put into the "extensions" property of the CSN.
971
+ - Fixed `cast()` for simple values like numbers and strings.
972
+
973
+ - to.sql:
974
+ + Remove simple default value checks and allow the database to reject default values upon activation.
975
+ + Render empty actual parameter list when selecting from a view with parameters which are fully covered with
976
+ default values and no actual parameters are provided in the query itself.
977
+
978
+ - OData:
979
+ + Correctly render unary operator of default values in EDM.
980
+
981
+ ## Version 1.42.0 - 2020-09-25
982
+
983
+ ### Added
984
+
985
+ - The compiler now supports the `cast(element as Type)` function in queries.
986
+ Using this function will also result in a `CAST` SQL function call.
987
+ - A top-level property `i18n` is now supported. The property can contain translated texts.
988
+ The compiler expects its entries to be objects where each text value is a string.
989
+ - CDL: Empty selection lists in views/projections are now allowed and make it possible to extend
990
+ empty projections. Note that views/projections without any elements are not deployable.
991
+ - For CSNs as input, the compiler returns properties as they are (without checks)
992
+ if their name does not match the regexp `/[_$]?[a-zA-Z]+[0-9]*/` and does not start with `@`.
993
+ With more than one CSN input,
994
+ the compiler only returns the top-level CSN properties of the first source.
995
+
996
+ ### Changed
997
+
998
+ - to.cdl: Smart type references are now explicitly rendered via ":"-syntax
999
+
1000
+ ### Removed
1001
+
1002
+ ### Fixed
1003
+
1004
+ - Annotating an _unknown_ element _twice_ now results in a duplicate annotation error instead
1005
+ of silently loosing the annotation.
1006
+ - Service/context extensions that reference a non-service/non-context now result in a compiler error
1007
+ instead of silently loosing the context/service extension.
1008
+ - to.hdbcds/sql/hdi:
1009
+ + fix a bug, which resulted in a malformed on-condition, if an association key
1010
+ was another association pointing to an entitiy with a structured key.
1011
+ + in conjunction with assoc-to-joins, the internal CSN reference broke
1012
+ causing missing locations and even internal errors when logging messages
1013
+ + managed associations in UNION are now correctly processed
1014
+ - The parseCdl mode now correctly resolves type arguments of "many" types.
1015
+ - OData: The annotation `@Capabilities.Readable` is now correctly
1016
+ translated to `@Capabilities.ReadRestrictions.Readable`.
1017
+
1018
+ ## Version 1.41.4 - 2020-09-18
1019
+
1020
+ ### Removed
1021
+
1022
+ - The length of HANA identifiers are not checked anymore: no more warnings are issued for long identifiers.
1023
+
1024
+ ### Fixed
1025
+
1026
+ - The check for ignored "localized" keywords in sub-elements has been extended to also
1027
+ include references to structured types.
1028
+ - A warning was added if views/projections are used as element types.
1029
+ - An info message is emitted if a namespace is annotated.
1030
+ Annotating namespaces is not possible. Previously the annotation was silently lost.
1031
+ It is now put into the "extensions" property of the CSN.
1032
+
1033
+ ## Version 1.41.2 - 2020-09-15
1034
+
1035
+ ### Fixed
1036
+
1037
+ - OData: correctly render primary key associations targeting a composition parent but are not
1038
+ the composition enabling association.
1039
+ - to.hdbcds/sql/hdi: Do not dump if artifact doesn't exist anymore after association to join translation
1040
+ - Only check for unmanaged associations inside of "many"/"array of" in the elements of views and entities,
1041
+ not inside of actions and other members.
1042
+
1043
+ ## Version 1.41.0 - 2020-09-11
1044
+
1045
+ ### Added
1046
+
1047
+ - OData: Allow the relational comparison of structures or managed associations in an ON condition as described in
1048
+ version 1.32.0 - 2020-07-10 (forHana).
1049
+ - Allow `Struct:elem` with and without preceeding `type of` as type reference.
1050
+
1051
+ ### Fixed
1052
+
1053
+ - to.cdl: Only render enums if they were directly defined there
1054
+ - The parseCdl mode now checks for redefinitions to avoid generating invalid CSN.
1055
+ - OData: An error is thrown if a redirected target has fewer keys than the original one.
1056
+ - OData: Empty structured elements are now handled correctly in `flat` format.
1057
+
1058
+ ## Version 1.40.0 - 2020-09-04
1059
+
1060
+ ### Added
1061
+
1062
+ - to.hdi/sql: Support default values for view parameters.
1063
+ - OData: lower message severity from Error to Warning for
1064
+ `<entity type> has no primary key` and `<type> has no properties`.
1065
+
1066
+ ### Changed
1067
+
1068
+ - OData: The foreign key references in associations are not flattened any more with format `structured`.
1069
+
1070
+ ### Fixed
1071
+
1072
+ - parse.cdl: Properly handle type arguments, most likely relevant for HANA types.
1073
+ - OData: Multilevel anonymously defined `composition of <aspect>` is now processed successfully with the OData backend.
1074
+ - OData: Fix a bug in EDM generation that caused a dump.
1075
+ - Update ANTLR dependency to version 4.8.
1076
+
1077
+ ## Version 1.39.0 - 2020-08-26
1078
+
1079
+ ### Added
1080
+
1081
+ - If the first CDS source (CDL or CSN) provided to the compiler
1082
+ has a `namespace` declaration/property, then
1083
+ that namespace name is put into the property `namespace` of the returned CSN.
1084
+ - An event payload type can now be defined with a type/entity reference or
1085
+ or projection (instead of providing the elements directly).
1086
+ - Aspects can now be included when specifying the elements of an event payload type,
1087
+ as it is known for type, entity and aspect definitions.
1088
+
1089
+ ### Fixed
1090
+
1091
+ - Fix a bug in explicit JOIN cardinality CDL parsing
1092
+ - to.hdbcds/hdi/sql: Identifiers are checked and warnings are raised if the identifier exceeds a length limitation which would result in a deployment error.
1093
+ - OData: Service, entity and element identifiers are checked and warnings are raised if an identifier is not compliant with the OData specification.
1094
+
1095
+ ## Version 1.38.0 - 2020-08-25
1096
+
1097
+ ### Changed
1098
+
1099
+ - CSN: The property `payload` of an `event` has been renamed to `elements`.
1100
+
1101
+ ### Fixed
1102
+
1103
+ - to.hdbcds/hdi/sql: Correctly handle local-scope refs in on-conditions when flattening structures.
1104
+ - Run checks for associations inside of `many` or `array of` only on entities and views.
1105
+
1106
+
1107
+ ## Version 1.37.0 - 2020-08-21
1108
+
1109
+ ### Added
1110
+
1111
+ - Projections columns can now use expressions like select items,
1112
+ both for `entity … as projection on` and `extend projection … with`.
1113
+ - OData: `array of <structure>` or `many <structure>` is now allowed in OData V4, flat format.
1114
+
1115
+ ### Changed
1116
+
1117
+ - to.hdbcds/hdi/sql:
1118
+ + Messages of id "query-no-undefined" are now raised as errors.
1119
+ + Aspects/types/abstract entities containing anonymous aspect compositions
1120
+ must not be used as types and are removed during transformation.
1121
+
1122
+ ### Fixed
1123
+
1124
+ - to.cdl: Events are rendered.
1125
+ - to.cds: Anonymous aspect composition are now rendered correctly.
1126
+ - to.hdbcds/hdi/sql:
1127
+ + Events are ignored.
1128
+ + local-scope references in on-conditions are now handled correctly during flattening.
1129
+ + Removed duplicate messages.
1130
+ - A model with multilevel `composition of <aspect>` (spread across several aspect declarations,
1131
+ composing one another) is now processed successfully with the OData backend.
1132
+ - The CSN parser supports explicit join cardinalities.
1133
+ - Prefix a `@assert.unique` table constraint with the table name to avoid name clashes.
1134
+
1135
+
1136
+ ## Version 1.36.0 - 2020-08-07
1137
+
1138
+ ### Added
1139
+
1140
+ - Query select items can now be declared to be virtual.
1141
+
1142
+ - CQL now allows to specify a join cardinality. Allowed are any combinations of
1143
+ `{ [ EXACT ] ONE | MANY } TO { [ EXACT ] ONE | MANY }` for
1144
+ `{ INNER | { LEFT | RIGHT | FULL } [ OUTER ] }` joins.
1145
+ The cardinality is added in the for HANA generated `CREATE VIEW` statements.
1146
+
1147
+ - Support the creation of unique constraints by assigning `@assert.unique.<constraintName>` to
1148
+ non-query entities or query entities annotated with `@cds.persistence.table`. The value of the
1149
+ annotation is an array of paths referring to elements in the entity. The path leaf may
1150
+ be an element of a scalar, structured or managed association type. Individual foreign keys or
1151
+ unmanaged associations can not be accessed. In case the path points to a structured element,
1152
+ the unique constraint will contain all columns stemming from the structured type. In case
1153
+ the path points to a managed association, the unique constraint will contain all foreign key
1154
+ columns stemming from this managed association.
1155
+ For HANA a `UNIQUE INVERTED INDEX` and for SQLite a `named unique table constraint` is generated.
1156
+
1157
+ ### Changed
1158
+
1159
+ - OData: Update vocabularies 'Common', 'UI'
1160
+ - The association to join transformation treats foreign key accesses with priority. If a foreign key
1161
+ of a managed association can be accessed without joins, no joins are generated.
1162
+ The priority handling can be turned of with option `joinfk`.
1163
+
1164
+ ### Fixed
1165
+
1166
+ - Semantic location in messages is now more precise.
1167
+
1168
+ ## Version 1.35.0 - 2020-07-31
1169
+
1170
+ ### Added
1171
+
1172
+ - Introduce option `localizedLanguageFallback`; if set to value `"none"`, the localized
1173
+ convenience views do not use function `coalesce` to select from a default text as fallback.
1174
+
1175
+ ### Fixed
1176
+
1177
+ - Properly consider targets of compositions in `mixin`s to be autoexposed.
1178
+ - Uniformly limit propagation of `@cds.autoexposed`, i.e.
1179
+ there is not inheritance from a query source navigating along an association.
1180
+ Previously, compiling a compiled model could lead to new autoexposed entities.
1181
+ - OData:
1182
+ + V2: Distribute various `@sap` specific annotations to the entity container.
1183
+ + Always set attribute `Nullable` on properties of type `Collection()`.
1184
+
1185
+ ## Version 1.34.0 - 2020-07-27
1186
+
1187
+ ### Fixed
1188
+
1189
+ - Do not dump with illegal references in explicit `on` conditions of redirections;
1190
+ properly report them via error messages.
1191
+
1192
+ ## Version 1.33.0 - 2020-07-24
1193
+
1194
+ ### Added
1195
+
1196
+ - Allow to declare `many/array of` elements, parameters and return types to be `(not) null`.
1197
+ The nullability applies to the array items of the element, not the element itself.
1198
+ - New boolean option `dependentAutoexposed` to avoid name clashes in dependent
1199
+ autoexposed entities (text entities, components of managed compositions).
1200
+ - cdsc: Add toOdata version 'v4x' to combine `{ version: 'v4', odataFormat: 'structured', odataContainment: true }`.
1201
+
1202
+ ### Changed
1203
+
1204
+ - OData:
1205
+ + Update vocabularies 'Common', 'Core', 'ODM'.
1206
+ + The default nullability for collection value properties is `false`, indicating that the returned collection must
1207
+ not contain null value entries.
1208
+ - toCdl: Identifiers are now quoted with `![` and `]`. Inner `]` characters are escaped with `]]`.
1209
+ - toCdl/toSql: Function names containing non standard HANA identifier characters are rendered case preserving and quoted
1210
+ if an appropriate naming mode has been set in the options.
1211
+
1212
+ ### Fixed
1213
+
1214
+ - forHana: Correctly flatten managed associations as foreign keys used in the definition.
1215
+ of another managed association.
1216
+ - OData: Don't render aspects as `edm.ComplexType`.
1217
+
1218
+ ## Version 1.32.0 - 2020-07-10
1219
+
1220
+ ### Added
1221
+
1222
+ - Provide semantic code completion for elements, enums, actions and parameters
1223
+ in `annotate` and `extend`.
1224
+ - forHana: Allow the relational comparison of structures or managed associations in an ON condition.
1225
+ Both operands must be structurally compatible, that is both structures must be expandable
1226
+ to an identical set of leaf paths. Each leaf path must terminate on a builtin CDS scalar type.
1227
+ The original relational term of the form `s1 op s2` is replaced by the resulting expression
1228
+ `s1.leafpath_0 op s2.leafpath_0 (AND s1.leafpath_i op s2.leafpath_i)*` with `i < n leaf paths`.
1229
+
1230
+ ### Changed
1231
+
1232
+ - toCdl: String enums without a value are no longer rendered with their name's string representation as their value.
1233
+
1234
+ ### Fixed
1235
+
1236
+ - parseCdl: Fix missing extensions in files that extend unknown services/contexts.
1237
+ - OData: Do not render an EDM document in case of raised errors
1238
+ - to.cdl: Aspects are now correctly rendered as aspects and not as types
1239
+
1240
+ ## Version 1.31.2 - 2020-07-03
1241
+
1242
+ ### Fixed
1243
+
1244
+ - HANA/SQLite: Correctly handle already resolved types when a cds.linked CSN is passed in
1245
+ - HANA/SQLite: Ensure that all elements in a Draft are non-virtual
1246
+
1247
+ ## Version 1.31.0 - 2020-06-26
1248
+
1249
+ ### Added
1250
+
1251
+ - forHana/toSql: A (proxy) entity representing a HANA User Defined Function or a HANA Calculation View
1252
+ can now be annotated with `@cds.persistence { udf, calcview }` so that queries to these artifacts are
1253
+ rendered with the appropriate parameter lists. Parameters for HANA Calculation Views are decorated with
1254
+ `PLACEHOLDER."$$<id>$$"`. HANA User Defined Functions without arguments require an empty argument
1255
+ list `()` as part of the query source.
1256
+ Entities that are assigned with `@cds.persistence { udf, calcview }` cannot contain associations or act as
1257
+ association targets, even if they have no defined parameter list.
1258
+ Multiple assignments of `@cds.persistence { table, udf, calcview }` to the same entity are rejected.
1259
+ - OData V4: Elements with type `array of <scalar type>` are now supported in flat mode
1260
+
1261
+ ### Changed
1262
+
1263
+ - Option `beta` now only works with selective feature flags. Instead of `beta: true`, a dictionary of `<feature>: true` is expected. Available feature flags are:
1264
+ 1. subElemRedirections
1265
+ 2. keyRefError
1266
+ 3. aspectCompositions
1267
+ 4. odataProxies
1268
+ 5. uniqueconstraints
1269
+ - OData V4: Unmanaged associations/compositions with a target cardinality of exactly one (that is `[1..1]`)
1270
+ are rendered as `edmx:NavigationProperty` with attribute `Nullable="false"`
1271
+ - OData: On-condition checks are now performed when generating OData as well.
1272
+ - SQLite: The property length for string parameters is not longer restricted to 5000 characters.
1273
+ - HANA/SQLite: Improved the error message when an entity without elements is found to make it clearer what is expected.
1274
+
1275
+ ### Fixed
1276
+
1277
+ - An error is emitted if parameters in functions/actions have a default value as it is not yet supported.
1278
+ For example by using `type of E:element` where `element` has a default value.
1279
+ - OData V2: Derived scalar types are not rendered as `<edmx:TypeDefinition>`, so no annotation assignments to
1280
+ such carriers must be rendered.
1281
+ - HANA/SQLite: Fixed a bug when flattening structured elements - instead of a human-readable error, an exception was thrown.
1282
+
1283
+ ## Version 1.30.0 - 2020-06-12
1284
+
1285
+ ### Added
1286
+
1287
+ - Projections can now have `where` and `group by`/`having` clauses.
1288
+
1289
+ ### Changed
1290
+
1291
+ ### Fixed
1292
+
1293
+ - `doc` comments in CDL now support Windows-style line breaks (CRLF). They are replaced with `\n` in CSN.
1294
+ - `toCdl` no longer renders a `*` column if no columns are used in the original source.
1295
+ - Types that have both `type` and `items`/`elements` properties in CSN are now checked to avoid
1296
+ mismatches if a unstructured / non-arrayed type is referenced but `items`/`elements` exists.
1297
+ - OData:
1298
+ + Correctly render CRLF and LF to __&#xa;__ in EDMX
1299
+
1300
+ ## Version 1.29.0 - 2020-06-08
1301
+
1302
+ ### Added
1303
+
1304
+ - Projections can now have `limit` and `order by` clauses.
1305
+
1306
+ ### Changed
1307
+
1308
+ - OData: Update vocabularies 'CodeList', 'Common', 'Graph', 'UI'
1309
+
1310
+ ### Fixed
1311
+
1312
+ - Memory usage improvement - compile messages with id `ref-undefined-excluding` uses much less memory.
1313
+
1314
+ - HANA/SQL: Validate ON conditions of mixin association definitions in all subqueries
1315
+
1316
+ - OData V2: Assign various `@sap` annotations to the `<edmx:EnitySet>` and `<edmx:AssociationSet>`
1317
+ if such annotations are assigned to CDS entities or associations.
1318
+
1319
+ - OData V4 Structured: Omit foreign keys of managed associations that establish the containment relationship to
1320
+ a container, if this association was declared to be primary key.
1321
+
1322
+ - OData: Warn about non-integer enums as they are not supported by OData, yet.
1323
+
1324
+ - Warn about string values in integer enums and vice versa.
1325
+
1326
+ ## Version 1.28.0 - 2020-05-27
1327
+
1328
+ ### Added
1329
+
1330
+ - API: add `getArtifactCdsPersistenceName()` and `getElementCdsPersistenceName()` which return
1331
+ the value of annotation `@cds.persistence.name` for the corresponding artifact/element.
1332
+
1333
+ ### Changed
1334
+
1335
+ - Issue error if old backends are used with beta mode.
1336
+ - Raise severity of message `Unmanaged associations cannot be used as primary key` with id `unmanaged-as-key` to error.
1337
+
1338
+ ### Fixed
1339
+
1340
+ - OData:
1341
+ + Render vocabulary `<edmx:Reference>` and `<edmx:Include>` if vocabulary namespace was used.
1342
+ + Reduce memory consumption in EDM Renderer.
1343
+ + Render annotations for navigation properties if association is annotated with `@cds.api.ignore: true`.
1344
+
1345
+ ## Version 1.27.0 - 2020-05-15
1346
+
1347
+ ### Added
1348
+
1349
+ ### Changed
1350
+
1351
+ - Improve warning messages for integer enum missing a value and chained array of.
1352
+ - HANA/SQL
1353
+ + Empty structures are not allowed as foreign keys.
1354
+ - Report a warning for integer enum elements that do not have values.
1355
+ - Report a warning for enums that are not integer- or string-like.
1356
+ - OData
1357
+ + Update vocabularies 'Common', 'Core', 'Validation'
1358
+ + Pass through structures without elements
1359
+ + `cds.Decimal` and `cds.DecimalFloat` (deprecated) without precision/scale are rendered
1360
+ as `Edm.Decimal` with `Scale=variable` (V4) and `sap:variable-scale="true"` (V2)
1361
+
1362
+ ### Fixed
1363
+
1364
+ - Memory usage improvement - compile messages do not inherit from Error any more.
1365
+ - HANA types in annotation assignments work again.
1366
+ - HANA/SQL: Correctly handle temporal in conjunction with namespaces.
1367
+ - Fix a bug in Association to Join translation that prevents exposing managed associations via subqueries.
1368
+
1369
+ ### Removed
1370
+
1371
+ ## Version 1.26.4 - 2020-05-08
1372
+
1373
+ ### Added
1374
+
1375
+ - Add new OData vocabulary `com.sap.vocabularies.HTML5.v1`
1376
+
1377
+ ### Changed
1378
+
1379
+ - Report a warning when a deprecated non-snapi backend (OData, HANA/SQL) is called.
1380
+
1381
+ - OData:
1382
+ + Update vocabulary 'UI'
1383
+ + Add annotation `@Common.Label: '{i18n>Draft_DraftAdministrativeData}'` to entity `DraftAdministrativeData`
1384
+ + Improve info message for target mismatch on associations that are compared with $self
1385
+
1386
+ ### Fixed
1387
+
1388
+ - The CSN `val` property is now allowed in enum element extensions. Such CSN can be
1389
+ generated using the `parseCdl` mode and it is now compilable.
1390
+
1391
+ - Again allow negative values as enum values, fixing a regression introduced with v1.24.6.
1392
+
1393
+ - OData: Correctly handle associations in arrayed elements (keyword `many`).
1394
+
1395
+ - Annotation assignment checks now recognize HANA types.
1396
+
1397
+ ## Version 1.26.2 - 2020-04-24
1398
+
1399
+ ### Added
1400
+
1401
+ - The client tool `cdsc` has got a new option `--beta <list>` which may be used to
1402
+ specify a comma separated list of experimental features to be enabled.
1403
+
1404
+ - CSN in parse-cdl mode now has a `requires` property that represents `using`s from CDL.
1405
+
1406
+ ### Fixed
1407
+
1408
+ - OData:
1409
+ + Change foreign key creation order for associations to respect their dependencies.
1410
+ + Use correct path during on-condition flattening.
1411
+ + Report error when using elements without types for **array of type of (element)** and similar definitions.
1412
+
1413
+ - HANA/SQL:
1414
+ + Fix references to `null` enum values in default clauses.
1415
+
1416
+ - Type arguments are now properly set in CSN when using parse-cdl mode.
1417
+
1418
+ - Avoid unjust warning if the `extensions` property of an input CSN contain `extend` statements.
1419
+
1420
+ ## Version 1.26.0 - 2020-04-17
1421
+
1422
+ ### Added
1423
+
1424
+ - The client tool `cdsc` has got a new command `parseCdl` which returns a CSN
1425
+ that is close to the original CDL file. It does not resolve imports and does
1426
+ not apply extensions.
1427
+
1428
+ - Unmanaged associations as primary keys are now warned about.
1429
+
1430
+ - `localized` in combination with `key` is now warned about.
1431
+
1432
+ - Enum values are now checked to only be either numbers or a strings - a warning is raised.
1433
+
1434
+ - Elements in mixin clauses that are _not_ unmanaged associations now produce an error.
1435
+
1436
+ ### Changed
1437
+
1438
+ - HANA/SQL:
1439
+ + Raise warnings `rewrite-not-supported` and `rewrite-undefined-key` to errors.
1440
+
1441
+ - Compiler: Empty elements are now kept along for the propagation.
1442
+
1443
+ - OData: Annotate all elements of `DraftAdministrativeData` with `@Common.Label: '{i18n>"Draft_<elementName>"}'`
1444
+ and elements 'DraftUUID', 'DraftIsCreatedByMe' and 'DraftIsProcessedByMe' with `@UI.Hidden`.
1445
+
1446
+ ### Fixed
1447
+
1448
+ - Compiler: `type of <unmanaged assocation>` is now handled correctly by raising an error.
1449
+
1450
+ ## Version 1.25.0 - 2020-04-09
1451
+
1452
+ ### Changed
1453
+
1454
+ - Downgrade `chained array of`-error to a warning
1455
+ - SQLite: Don't render implicit casts
1456
+
1457
+ ## Version 1.24.6 - 2020-04-08
1458
+
1459
+ ### Changed
1460
+
1461
+ - OData:
1462
+ + Improve messages for misaligned forward/backlink associations in EDM generator
1463
+ + For V2 add annotations `@sap.creatable: false`, `@sap.updatable: false`, `@sap.deletable: false`,
1464
+ `@sap.pageable: false` to the Parameter EntityType and `@sap.creatable: false`, `@sap.updatable: false`,
1465
+ `@sap.deletable: false`, `@sap.addressable: false` to the Result EntityType.
1466
+ + Update vocabularies 'Common' and 'Graph' and 'ODM'.
1467
+
1468
+
1469
+ ### Fixed
1470
+
1471
+ - Various messages mention more appropriate source locations.
1472
+
1473
+ - Improve messages for `array of`
1474
+
1475
+ - OData:
1476
+ + Render 'array of' for ReturnType correctly
1477
+ + Report error for view fields with no type information early
1478
+ + Handle associations in structures with an association as explicit key
1479
+
1480
+ ### Removed
1481
+
1482
+ - The client tool `cdsc` does not offer the option `--std-json-parser` anymore,
1483
+ as it had no effect.
1484
+
1485
+ ## Version 1.24.4 - 2020-03-25
1486
+
1487
+ ### Added
1488
+
1489
+ ### Changed
1490
+
1491
+ - `doc` comment propagation can now also be stopped by comments that only contain whitespace
1492
+ (including newlines) like `/** */`.
1493
+
1494
+ - OData:
1495
+ + Remove redundant service name and `__` prefix out of dynamically exposed substructures.
1496
+ + Update vocabularies 'Capabilities' and 'Graph'.
1497
+
1498
+ ### Fixed
1499
+
1500
+ - OData:
1501
+ + Process correctly "type of".
1502
+ + Process correctly elements with underscore as prefix.
1503
+
1504
+ - Preserve parameter list in localized convenience views.
1505
+
1506
+ ## Version 1.24.3 - 2020-03-16
1507
+
1508
+ ### Added
1509
+
1510
+ ### Changed
1511
+
1512
+ ### Fixed
1513
+
1514
+ - Force usage of resolve@1.8.1 instead of semver to avoid issues with file cache
1515
+
1516
+ ## Version 1.24.2 - 2020-03-13
1517
+
1518
+ ### Added
1519
+
1520
+ - Support function calls like `count( distinct ... )` and `count( all ... )`.
1521
+
1522
+ - With option `--doc-comment` comments of the form `/**...*/` are preserved, if these comments
1523
+ appear at positions where annotation assignments are allowed. `doc` comments are propagated
1524
+ like annotations until an empty comment `/***/` disrupts the propagation.
1525
+
1526
+ - OData:
1527
+ + Add new OData vocabularies `com.sap.vocabularies.Graph.v1` and `com.sap.vocabularies.ODM.v1`
1528
+ + With option `--odata-containment`, `parent` association and inferred key elements for
1529
+ `composition of <aspect>` as well as inferred keys of `_texts` entities are not rendered.
1530
+ + OData V4: Produce primary key paths with length limited alias names.
1531
+
1532
+ ### Changed
1533
+
1534
+ ### Fixed
1535
+
1536
+ - When not disabled by `@cds.autoexpose:false`, an entity used as composition target
1537
+ is auto-exposed in the current service;
1538
+ this did not work always if the target was a _query_ entity.
1539
+
1540
+ - Foreign key creation in odata flat-mode when following associations.
1541
+
1542
+ - Rename `@description` to `@Core.Description` in all cases as part of the OData transformation of a CSN.
1543
+
1544
+ - When generating extensions from EDMX annotations, handle correctly targets from an EntityContainer.
1545
+
1546
+ - Apply service annotations in EDMX generation.
1547
+
1548
+
1549
+ ### Removed
1550
+
1551
+ - Warning 'Service should not have more then one draft root artifact'
1552
+
1553
+ - Experimental annotation '@cds.odata.{v2|v4}.ignore`
1554
+
1555
+ - OData vocabulary `com.sap.vocabularies.odm.v1` (lowercase 'odm')
1556
+
1557
+ - `--beta-mode` from option `--odata-containment`.
1558
+
1559
+ ## Version 1.24.1 - 2020-03-06
1560
+
1561
+ ### Added
1562
+
1563
+ - Add new OData vocabulary `com.sap.vocabularies.odm.v1`
1564
+
1565
+ ### Changed
1566
+
1567
+ - Expressions in mixin-definitions are now validated.
1568
+ - OData:
1569
+ + Redirect inbound associations to entities with parameters to corresponding Parameter EntityType.
1570
+ + Update vocabulary `UI`
1571
+ - Use semver for dependencies
1572
+
1573
+ ### Fixed
1574
+
1575
+ - Resolve backlink mixin association usages uniformly in association to join translation.
1576
+
1577
+
1578
+ ## Version 1.24.0 - 2020-02-28
1579
+
1580
+ ### Added
1581
+
1582
+ - If an entity `E` with localized elements has the annotation `@fiori.draft.enabled`,
1583
+ a new element `ID_texts` of type `cds.UUID` is added to `E_texts` as the _only key_ and
1584
+ the annotation `@odata.draft.enabled` will not be set to false for `E.texts`.
1585
+ - A comment of the form `/**…*/` at "annotation positions" is now considered a doc comment;
1586
+ its "cleaned-up" text is put into the CSN as value of the property `doc`.
1587
+ In the OData/EDMX, it appears as value for the annotation `@Core.Description`.
1588
+
1589
+ ### Fixed
1590
+
1591
+ - HANA CDS: When casting a column to an enum type, don't render it as an enum
1592
+ - Ignore top-level CSN "annotations" like `@sql_mapping` in the CSN frontend.
1593
+ - OData: Key constraint checks for Draft enabled entities consider EDM exposed keys only.
1594
+ - Message level for draft key checks is raised to 'warning' again.
1595
+ - Action and function calls are checked for missing arguments.
1596
+ - All references are correctly transformed in flatten mode.
1597
+
6
1598
  ## Version 1.23.2
7
1599
 
8
1600
  Changes