@sap/cds-compiler 5.9.2 → 6.0.10

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 (111) hide show
  1. package/CHANGELOG.md +109 -319
  2. package/README.md +1 -1
  3. package/bin/cds_update_identifiers.js +3 -5
  4. package/bin/cdsc.js +22 -8
  5. package/bin/cdshi.js +1 -1
  6. package/bin/cdsse.js +4 -4
  7. package/doc/CHANGELOG_BETA.md +11 -0
  8. package/doc/CHANGELOG_DEPRECATED.md +29 -0
  9. package/lib/api/main.js +8 -5
  10. package/lib/api/options.js +12 -10
  11. package/lib/base/builtins.js +1 -0
  12. package/lib/base/message-registry.js +190 -96
  13. package/lib/base/messages.js +29 -20
  14. package/lib/base/model.js +14 -24
  15. package/lib/checks/actionsFunctions.js +10 -20
  16. package/lib/checks/annotationsOData.js +1 -1
  17. package/lib/checks/elements.js +30 -10
  18. package/lib/checks/enums.js +31 -0
  19. package/lib/checks/foreignKeys.js +2 -2
  20. package/lib/checks/hasPersistedElements.js +5 -0
  21. package/lib/checks/invalidTarget.js +1 -1
  22. package/lib/checks/managedWithoutKeys.js +5 -4
  23. package/lib/checks/queryNoDbArtifacts.js +10 -8
  24. package/lib/checks/types.js +5 -5
  25. package/lib/checks/validator.js +6 -4
  26. package/lib/compiler/assert-consistency.js +12 -9
  27. package/lib/compiler/checks.js +18 -50
  28. package/lib/compiler/define.js +6 -6
  29. package/lib/compiler/extend.js +2 -1
  30. package/lib/compiler/generate.js +14 -17
  31. package/lib/compiler/populate.js +8 -31
  32. package/lib/compiler/propagator.js +21 -35
  33. package/lib/compiler/resolve.js +35 -22
  34. package/lib/compiler/shared.js +7 -1
  35. package/lib/compiler/tweak-assocs.js +1 -1
  36. package/lib/compiler/utils.js +1 -1
  37. package/lib/edm/annotations/edmJson.js +20 -15
  38. package/lib/edm/annotations/genericTranslation.js +7 -8
  39. package/lib/edm/csn2edm.js +46 -50
  40. package/lib/edm/edm.js +8 -7
  41. package/lib/edm/edmPreprocessor.js +37 -85
  42. package/lib/edm/edmUtils.js +2 -2
  43. package/lib/gen/BaseParser.js +55 -44
  44. package/lib/gen/CdlGrammar.checksum +1 -1
  45. package/lib/gen/CdlParser.js +1133 -1150
  46. package/lib/json/from-csn.js +70 -43
  47. package/lib/json/to-csn.js +6 -8
  48. package/lib/language/multiLineStringParser.js +3 -2
  49. package/lib/main.d.ts +58 -24
  50. package/lib/model/csnUtils.js +28 -39
  51. package/lib/model/xprAsTree.js +23 -9
  52. package/lib/modelCompare/compare.js +5 -4
  53. package/lib/optionProcessor.js +21 -17
  54. package/lib/parsers/AstBuildingParser.js +63 -11
  55. package/lib/parsers/XprTree.js +57 -3
  56. package/lib/parsers/identifiers.js +1 -1
  57. package/lib/parsers/index.js +0 -3
  58. package/lib/render/manageConstraints.js +25 -25
  59. package/lib/render/toCdl.js +173 -170
  60. package/lib/render/toHdbcds.js +126 -128
  61. package/lib/render/toRename.js +7 -7
  62. package/lib/render/toSql.js +128 -125
  63. package/lib/render/utils/common.js +47 -22
  64. package/lib/render/utils/delta.js +25 -25
  65. package/lib/render/utils/operators.js +2 -2
  66. package/lib/render/utils/pretty.js +5 -5
  67. package/lib/render/utils/sql.js +13 -13
  68. package/lib/render/utils/standardDatabaseFunctions.js +115 -103
  69. package/lib/render/utils/unique.js +4 -4
  70. package/lib/transform/db/applyTransformations.js +1 -1
  71. package/lib/transform/db/assertUnique.js +2 -2
  72. package/lib/transform/db/associations.js +6 -7
  73. package/lib/transform/db/assocsToQueries/utils.js +4 -5
  74. package/lib/transform/db/backlinks.js +12 -9
  75. package/lib/transform/db/cdsPersistence.js +8 -7
  76. package/lib/transform/db/constraints.js +13 -10
  77. package/lib/transform/db/expansion.js +7 -3
  78. package/lib/transform/db/flattening.js +4 -14
  79. package/lib/transform/db/processSqlServices.js +2 -1
  80. package/lib/transform/db/temporal.js +5 -7
  81. package/lib/transform/db/views.js +2 -4
  82. package/lib/transform/draft/db.js +8 -8
  83. package/lib/transform/draft/odata.js +10 -7
  84. package/lib/transform/forOdata.js +10 -5
  85. package/lib/transform/forRelationalDB.js +5 -75
  86. package/lib/transform/localized.js +1 -1
  87. package/lib/transform/odata/createForeignKeys.js +11 -10
  88. package/lib/transform/odata/flattening.js +8 -4
  89. package/lib/transform/odata/foreignKeyRefsInXprAnnos.js +96 -0
  90. package/lib/transform/odata/typesExposure.js +3 -3
  91. package/lib/transform/transformUtils.js +4 -8
  92. package/lib/transform/translateAssocsToJoins.js +14 -7
  93. package/lib/transform/universalCsn/universalCsnEnricher.js +10 -4
  94. package/lib/utils/objectUtils.js +0 -17
  95. package/package.json +10 -13
  96. package/share/messages/def-upcoming-virtual-change.md +1 -1
  97. package/LICENSE +0 -37
  98. package/bin/cds_remove_invalid_whitespace.js +0 -138
  99. package/doc/CHANGELOG_ARCHIVE.md +0 -3604
  100. package/lib/gen/genericAntlrParser.js +0 -3
  101. package/lib/gen/language.checksum +0 -1
  102. package/lib/gen/language.interp +0 -456
  103. package/lib/gen/language.tokens +0 -180
  104. package/lib/gen/languageLexer.interp +0 -439
  105. package/lib/gen/languageLexer.js +0 -1483
  106. package/lib/gen/languageLexer.tokens +0 -167
  107. package/lib/gen/languageParser.js +0 -24941
  108. package/lib/language/antlrParser.js +0 -205
  109. package/lib/language/errorStrategy.js +0 -646
  110. package/lib/language/genericAntlrParser.js +0 -1572
  111. package/lib/parsers/CdlGrammar.g4 +0 -2070
@@ -1,3604 +0,0 @@
1
- <!-- markdownlint-disable -->
2
- # ChangeLog for cdx compiler and backends (Archive)
3
-
4
- Note: `beta` fixes, changes and features are usually not listed in this ChangeLog.
5
- The compiler behaviour concerning `beta` features can change at any time without notice.
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 described 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 `locale`.
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 occurred 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 auto-exposed entities,
588
- extends the v1 option `dependentAutoexposed` to sub artifacts of entities (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 auto-exposed 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 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 preceding `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 auto-exposed 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
- auto-exposed 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:entitySet>` 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 association>` 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
-
1598
- ## Version 1.23.2
1599
-
1600
- Changes
1601
-
1602
- * Association to Join Transformation:
1603
- + Validate paths of an expression in the projection to be compliant with the
1604
- ON condition path constraints if such an expression is used in a mixin.
1605
- + Reject recursive or non-bijective `$self` expressions.
1606
- * Reject casting of a structured select item to a different type.
1607
- * OData: Update vocabularies `Capabilities`, `Common`, `UI`, `Validation`
1608
-
1609
- Fixes
1610
-
1611
- * Association to Join Transformation: Resolve compound ON conditions with
1612
- multiple logical terms and/or references to different associations via `$self`.
1613
- * Remove temporary property `viaTransformation` from published CSN.
1614
- * Do not complain about unaligned `$syntax` attribute in CSN frontend.
1615
-
1616
- ## Version 1.23.1
1617
-
1618
- Changes
1619
-
1620
- * OData:
1621
- + Lower message for unknown vocabulary annotations from warning to info.
1622
- + Lower message for `@Analytics.Measure expects @Aggregation.default` from warning to info.
1623
- + Remove empty EntityContainer and raise warning if Schema is empty.
1624
-
1625
- Fixes
1626
-
1627
- * Correctly calculate code completion candidates for projection items in all
1628
- circumstances (regression introduced in v1.22.0).
1629
- * In the Hana/Sql backend, correctly resolve forward `on` condition when using
1630
- mixin association that backlinks to an unrelated 3rd party entity and association.
1631
- * Raise a warning if the element of the forward association and the element of
1632
- the query source do not originate from the same defining entity. Raise an
1633
- error if the element of the forward association cannot be found in the query
1634
- source or is ambiguous.
1635
- * Correctly create localization views with compiled model as input;
1636
- it was wrong previously in a model with a high view hierarchy.
1637
-
1638
- ## Version 1.23.0
1639
-
1640
- Features
1641
-
1642
- * Introduce `![identifier body]` in the CDL source for delimited identifiers.
1643
- (The `!` is inspired by ABAP's identifier tag,
1644
- `[]` by the delimited identifier syntax in Microsoft SQL Server and Sybase;
1645
- we cannot use `[]` alone, because brackets are used for filter conditions.)
1646
- * When generating SQL or HDBVIEW, explicit CASTs are now rendered
1647
-
1648
- Changes
1649
-
1650
- * Signal a warning for all uses of `"identifier body"` in the CDL source, as
1651
- most uses of double-quotes in actual CDS models were likely meant for strings.
1652
- (Yes, we do not adhere strictly to the lexical rules of the SQL Standard with this change…)
1653
- * Issue a warning for an `aspect` definition without `{…}`.
1654
- * In the CSN, `aspect` definitions have a `$syntax` property with value `"aspect"`.
1655
- A future incompatible change will set the `kind` of aspect definitions to value `"aspect"`.
1656
- * Removed old CSN frontend and the corresponding options: `stdJsonParser` and `oldCsnFrontend`.
1657
- * Fix check for arguments and filters in references (__might introduce new errors__).
1658
- * Issue an error if explicit `keys` are provided when redirecting *un*managed associations.
1659
- * File paths given to `cdsc` which contain symbolic links are now resolved before being
1660
- passed to the compiler.
1661
- * Annotating elements with `@Core.Computed` now always overwrites computed value;
1662
- also expressions in parentheses will now induce to set `@Core.Computed` to `true`.
1663
- * Update OData vocabulary `UI`
1664
- * Increase the length of the element `locale` in generated `_texts` entities from
1665
- `String(5)` to `String(14)`.
1666
- * Do not overwrite annotations with generated annotations (such as shortcuts and other
1667
- convenience annotations).
1668
-
1669
- Fixes
1670
-
1671
- * Automatically calculate `keys` also for published _secondary_ managed
1672
- associations, i.e., associations in a select column which is reached by
1673
- following another association. The compiler doest not yet calculate the `on`
1674
- condition of published secondary unmanaged associations – provide it explicitly.
1675
- * Entities/Views without elements are now detected correctly.
1676
- * Fix check for action/function parameters in services.
1677
- * OData: Correctly apply annotations to parameters.
1678
-
1679
- ## Version 1.22.0
1680
-
1681
- Features
1682
-
1683
- * With `redirected to`, model designers can now explicitly provide the `on`
1684
- condition / foreign `keys` for "consumers" of the current query (entity).
1685
- This is useful for situations (usually mentioned as message) where the
1686
- compiler does not calculate `on`/`keys` (automatically yet).
1687
- * Add OData vocabularies: `com.sap.vocabularies.CodeList.v1`, `Org.OData.Repeatability.V1` and `com.sap.vocabularies.Session.v1`
1688
-
1689
- Changes
1690
-
1691
- * In the `sql`, `hdi` and `hdbcds` backends with SQL dialect HANA, `$user.id` is translated to
1692
- `SESSION_CONTEXT('APPLICATIONUSER')`, not `SESSION_CONTEXT('XS_APPLICATIONUSER')` anymore.
1693
- As with the SQL dialect SQLite, it can now be configured.
1694
- * The client tool `cdsc` now prints a source excerpt for each message by default;
1695
- use `cdsc --no-message-context` to get the previous behavior.
1696
- * Increase severity to `Warning` of messages for a situation where the compiler
1697
- cannot calculate an `on` condition / foreign `keys` automatically.
1698
- * Issues warnings for annotation definitions, as their CSN representation will be
1699
- moved from `definitions` into an new property `vocabularies` in a future change.
1700
- * OData:
1701
- + Update vocabularies: `Analytics`, `Common`, `Communication`, `Core`, `PersonalData`, `UI`
1702
- + Set reference base URI for SAP Vocabularies to `https://sap.github.io/odata-vocabularies/vocabularies`
1703
-
1704
- Fixes
1705
-
1706
- * In the `sql`, `hdi` and `hdbcds` backends,
1707
- + correctly ignore contexts containing just actions,
1708
- * In all backends, correctly handle models where an `on` condition of a `join` contains a sub query.
1709
- * Avoid infloop for cyclic dependencies on select items with explicit redirections.
1710
-
1711
- ## Version 1.21.1
1712
-
1713
- Features
1714
-
1715
- * OData: Support annotation `@insertonly` at an entity which translates to
1716
- `@Capabilities.DeleteRestrictions.Deletable: false`, `@Capabilities.ReadRestrictions.Readable:false`,
1717
- `@Capabilities.UpdateRestrictions.Updatable: false`.
1718
- A warning is raised if `@insertonly` and `@readonly` are applied at the same entity and no mapping is
1719
- done.
1720
-
1721
- ## Version 1.21.0
1722
-
1723
- Features
1724
-
1725
- * Support `cds.Decimal` without type facets `precision` and `scale` as substitute for the deprecated `cds.DecimalFloat`. Mapping is as follows:
1726
-
1727
- | HANA CDS | HANA SQL | SQLite | Odata V4 | Odata V2 |
1728
- |--------------|----------|---------|----------|----------|
1729
- | DecimalFloat | DECIMAL | DECIMAL | Decimal | Decimal |
1730
-
1731
- * OData:
1732
- + Expand shorthand annotation `@mandatory` to `Common.FieldControl: #Mandatory`.
1733
- + Support edm:Singleton by annotating an entity with either
1734
- `@odata.singleton: Boolean` or `@odata.singleton.nullable: Boolean`.
1735
-
1736
- `@odata.singleton.nullable` is a shorthand for `@odata.singleton: true` and sets
1737
- the value for attribute `Nullable` (default is false).
1738
-
1739
- If `odata.singleton` is `false`, no singleton is generated regardless of the existence of `@odata.singleton.nullable`.
1740
- + Option `odataContainment: true` renders compositions as `edm:NavigationProperty` with
1741
- containment. This option is only available for OData V4 and with `--beta-mode`.
1742
-
1743
- Changes
1744
-
1745
- * CSN frontend: use faster implementation by default.
1746
- * CDL frontend: issue warning for suspicious-looking delimited identifiers;
1747
- some people think that they have written strings when they use double-quotes.
1748
- * Models delivered with `@sap/cds` are now resolved from `cds.home`; e.g. `using ... from '@sap/cds/common'`.
1749
- This allows working without locally inst# ChangeLog for cdx compiler and backends
1750
- This allows working without locally installed `@sap/cds`, for example in Java projects.
1751
- In that case, respective models will be fetched from a globally installed `@sap/cds-dk`.
1752
- * OData:
1753
- + Improve `array of` checks and reject anonymous types and types that are not service members.
1754
- + Set draft properties `HasActiveEntity` and `HasDraftEntity` to `Nullable: false`.
1755
- * Reject old-style CSN from all CSN based transformers and renderers
1756
- * `toHana` and `toSql`: Allow aliasing for foreign keys
1757
-
1758
- Fixes
1759
-
1760
- * OData:
1761
- + Fix `Nullable` attribute for parameters in EDM JSON V4.
1762
- + Do not annotate `edm:NavigationProperty` for term definitions with `AppliesTo: Property` and vice versa.
1763
- * Fix bug in ON Condition rendering during transformation of associations to joins for stream based `$self` expressions.
1764
- * `toHana`: Only render and allow keys in the leading query
1765
- * `toHana` and `toSql`: When following an association, explicitly set the implicit alias to work around a HANA limitation
1766
-
1767
- ## Version 1.20.3
1768
-
1769
- Changes
1770
-
1771
- * Core Compiler: Forbid navigating associations (to non foreign key elements) in the ON condition
1772
- of an association definition.
1773
- * OData: Do not generate `OnDelete` for Containment Navigation Propertie, as this is redundant.
1774
-
1775
- Fixes
1776
-
1777
- * In `toSql` for `Sqlite` generate `current_timestamp` for `$at`
1778
-
1779
- ## Version 1.20.1
1780
-
1781
- Changes
1782
-
1783
- * Associations to 'abstract' artifacts and the usage of abstract entities in queries are now rejected.
1784
-
1785
- Fixes
1786
-
1787
- * OData:
1788
- + Raise level from 'info' to 'warning' for excluded NavigationProperties due to targets outside the service.
1789
- + Fix a bug in mapping of `@Capabilities` (see Version 1.20.0)
1790
- + Flattening of structured elements - @cds.persistence.name was semi-flattened
1791
-
1792
- * CSN Input:
1793
- + Support views with parameters in queries
1794
- + Support views with parameters in on-conditions of unmanaged associations
1795
- + Support 'not null' for enum elements
1796
-
1797
- ## Version 1.20.0
1798
-
1799
- Changes
1800
-
1801
- * Issue error (instead of a warning) if a projected association uses a non-projected element
1802
- in its `on` condition (message id `rewrite-not-projected`).
1803
-
1804
- * Issue error (instead of a warning) if the redirected target does not originate from the original
1805
- target of an association (message id `redirected-to-unrelated`).
1806
-
1807
- * In `--beta-mode` remove the annotation `@odata.draft.enabled: false` from generated
1808
- `_texts` entities. Annotate the technical foreign keys of a `_texts` entity with
1809
- `@cds.odata.v4.ignore: true` to allow containment in OData V4 for `_texts`.
1810
-
1811
- * In `toHana` and `toSql` associations to entities annotated with `@cds.persistence.exists` are
1812
- removed from the generated model. This is an extension to the change introduced with version 1.15.0.
1813
- If a proxy artifact shall be an association target, another 1:1 projection entity shall be created
1814
- wich then can act as the association target.
1815
-
1816
- * OData:
1817
- + Reject non specification compliant CSN as input to csn2edmx
1818
- + Add annotation `@cds.odata.{v2|v4}.ignore` in `--beta-mode`
1819
- + Rewrite `@Capabilities` annotation to `@Capabilities.NavigationRestrictions` at the containment
1820
- association in case an entity set has been omitted due to containment in OData V4.
1821
- + Update vocabularies `Common` and `UI`
1822
- + Improve error message when not generating a navigation property for association targets outside
1823
- the same service.
1824
-
1825
- * Draft:
1826
- + Raise an info message if a draft root has not exactly one primary key element of type `cds.UUID`
1827
- + Raise an info message if a draft node (subordinate to a draft root) has not exactly one primary key element
1828
- of type `cds.UUID` and optionally one more additional primary key.
1829
- + Raise an error message if the same draft node is reachable from two separate draft roots.
1830
- + Raise an info message if a service contains more than one draft root entities.
1831
- + Annotate technical elements `IsActiveEntity`, `HasActiveEntity`, `HasDraftEntity`,
1832
- `DraftAdministrativeData` and `DraftAdministrativeData_DraftUUID` with `@UI.Hidden`
1833
-
1834
- * CSN Input:
1835
- + New simplified parsing of CSN, can be enabled via compiler option stdJsonParser or
1836
- command line option --std-json-parser
1837
- + Support for $location
1838
-
1839
- Fixes
1840
- * Compiler:
1841
- + Correctly reject the Promise if errors occur during parsing
1842
-
1843
- * OData:
1844
- + Correctly render annotations with `null` values in arrays.
1845
- + Correctly render annotations with records of complex types.
1846
- + Correctly annotate artifacts with parameters. Annotations are assigned to the resulting
1847
- EntityType `<name>Type`
1848
- + Correctly flatten substructures when used as types
1849
-
1850
- * CSN Validation:
1851
- + Correctly process views with parameters in unmanaged associations
1852
-
1853
- * Make `parseToCqn()` use filter in `FROM` clause as hint for (recommended) colon, i.e.
1854
- never discard the filter.
1855
-
1856
- ## Version 1.19.2
1857
-
1858
- Changes
1859
-
1860
- * Improve the semantic checks for `Association to many` with a partial key, not complaining
1861
- about a missing `ON` condition anymore.
1862
-
1863
- * HANA:
1864
- + When using `names: quoted`, raise a warning when artifacts with `@cds.persistence.exists`
1865
- belong to a CDS namespace, context or service.
1866
-
1867
- * OData:
1868
- + Raise an `info` message on the usage of deprectated OData vocabulary terms.
1869
- + Raise a `warning` message when applying `@odata.Type` with another type as `Edm.String`, `Edm.Int16`,
1870
- `Edm.Int32`, `Edm.Int64`.
1871
- + Support shorthand annotation `@description` for `@Core.Description`.
1872
-
1873
- * Never complain about `localization` views when recompiling a CSN file that has localized convenience views
1874
- already expanded. If the definition's absolute name is `localized`, it must be a context. If the definition's
1875
- absolute name starts with `localized.`, it must either be a context or a query entity. An error message is
1876
- raised in all other cases. In all cases, definitions in the namespace `localized` are ignored for further processing.
1877
-
1878
- Fixes
1879
-
1880
- * Fix a dump when compiling from CSN for query elements without a `key` property that have no column
1881
- counterpart.
1882
-
1883
- ## Version 1.19.1
1884
-
1885
- Fixes
1886
-
1887
- * Make sure that we really create all localized convenience views for entities
1888
- which have localized elements, select localized elements or can directly or
1889
- indirectly reach (via navigation along associations and compositions) such entities.
1890
-
1891
- Features
1892
-
1893
- * Allow annotations with `@odata.Type: 'Edm.Int16'` and likewise with value `'Edm.Int32'`
1894
- and `'Edm.Int64'` to influence the type which is chosen in the generated EDMX.
1895
-
1896
- ## Version 1.19.0
1897
-
1898
- Changes
1899
-
1900
- * Event definitions are now properly listed in the CSN:
1901
- the `kind` is `event`, the property for its members is called `payload`.
1902
- * Omit redundant `kind: 'param'` for parameters in the `params` dictionary of a CSN.
1903
-
1904
- Fixes
1905
-
1906
- * Do not use upcoming OData v4.01 facet values for `cds.DecimalFloat`, i.e.
1907
- revert v1.18.0 change which had added `Scale: floating` and `Precision: 34`.
1908
- * In CSN frontend, support direct `{func: …}` objects in `orderBy` and `groupBy`.
1909
-
1910
- ## Version 1.18.2
1911
-
1912
- Fixes
1913
-
1914
- * Issue warning instead error when CDS type `cds.DecimalFloat` is used with OData v2.
1915
- Also issue the warning for CDS type `cds.hana.SMALLDECIMAL`.
1916
- * Properly render n-ary `cross join`s, typically produced by `select from A, B, C`.
1917
-
1918
- Features
1919
-
1920
- * Allow to provide HANA-specific magic variables like `current_utctimestamp` via the
1921
- function syntax `current_utctimestamp()`. Similar for `sysuuid`, `current_connection`,
1922
- `current_schema`, `current_transaction_isolation_level`, `current_utcdate` and `current_utctime`.
1923
- Support SQL Standard magic variable `system_user` (without parentheses); be aware that
1924
- it is not supported (by that syntax) in HANA.
1925
-
1926
- ## Version 1.18.1
1927
-
1928
- Changes
1929
-
1930
- * Hide the experimental swagger backend behind `betaMode` and issue a warning even then.
1931
-
1932
- Fixes
1933
-
1934
- * Properly establish EDMX partnership again between forward and backward association
1935
- even in the presense of "hidden" associations (v1.18.0 had introduced a bug).
1936
- Issue a warning if there are multiple (non hidden) partnership candidates.
1937
-
1938
- Features
1939
-
1940
- * `using from <module>` also tries file extensions `.csn` and `.csn.json`.
1941
-
1942
- ## Version 1.18.0
1943
-
1944
- Changes
1945
-
1946
- * OData: add type facet `Scale: floating`, `Precision: 34` to `Edm.Decimal`
1947
- for mapped CDS type `cds.DecimalFloat`.
1948
- Issue __error if `cds.DecimalFloat` is used with OData v2__.
1949
-
1950
- Fixes
1951
-
1952
- * If a projection in a service selects from a source in a model,
1953
- associations in the projection source are _implicitly redirected_
1954
- to a target in the service.
1955
- The corresponding redirection must also happen for the _localized convenience view_
1956
- for the projection in the service: the new target should be
1957
- the localized convenience view for the "original" redirection target
1958
- (if it does not exist: the "original" redirection target itself).
1959
-
1960
- ## Version 1.17.3
1961
-
1962
- Changes
1963
-
1964
- * OData:
1965
- Disable proxy generation again due to too many runtime conflicts. This effectively
1966
- auto-excludes the associations as navigation properties from the service that reference targets outside the service;
1967
- properties from the foreign keys of managed associations remain.
1968
- As opposed to the pre-v1.16.2 behaviour, this only affects the OData backend.
1969
- * OData: Raise error if `EntityType` has no primary key.
1970
- * Raise warning if compiler is invoked in `--beta-mode`
1971
-
1972
- Fixes
1973
-
1974
- * Make `annotate` statements on members of auto-exposed entities and
1975
- automatically created text entities work.
1976
-
1977
- ## Version 1.17.2
1978
-
1979
- Fixes
1980
-
1981
- * Fix stack overflow bug in EDM Preprocessing
1982
-
1983
- ## Version 1.17.1
1984
-
1985
- Changes
1986
-
1987
- * OData: Add type facet `Precision=7` to `Edm.DataTimeOffset` if CDS type is `cds.Timestamp`.
1988
- * Add semantic check to prevent the usage of `hana.ST_POINT` and `hana.ST_GEOMETRY` as primary key types.
1989
-
1990
- Fixes
1991
-
1992
- * OData: Do not generate `NavigationPropertyBinding` (V4) or `AssociationSet` (V2) for non-existing `EntitySet`
1993
- of the Proxy `EntityType`s introduced with Version 1.16.2.
1994
-
1995
-
1996
- ## Version 1.17.0
1997
-
1998
- Features
1999
-
2000
- * OData V4:
2001
- With `--beta-mode` enabled, compositions become containment navigation properties. This
2002
- is performed by annotating all compositions with `@odata.contained`. Existing assignments
2003
- are not overwritten.
2004
- Enabling containment is an incompatible change to existing OData metadata documents
2005
- as all composition targets are no longer accessible as EntitySets but only through their
2006
- container.
2007
- * Release keyword `event`.
2008
-
2009
- Changes
2010
-
2011
- * OData: Update all known Odata vocabularies, this also includes SAP vocabularies which now
2012
- may contain Term definitions marked as *experimental*.
2013
- * HANA Datatype Support in SQLite: Render `ST_GEOMETRY` and `ST_POINT` as `CHAR(5000)`.
2014
- * Use association names as table aliases during the association to join transformation instead of
2015
- using the association target (this makes the transformed view more comprehensible).
2016
-
2017
- Fixes
2018
-
2019
- * Parameter lists and filters in ON condition paths are rejected in association to join transformation.
2020
- * Append the temporal `WHERE` clause to views that already have a `WHERE` clause.
2021
- * View elements with @cds.valid.from/@cds.valid.key are no longer marked as key in the columns.
2022
- * CSN validator accepts select statements with a having or a group by clause containing a function call.
2023
-
2024
- ## Version 1.16.2
2025
-
2026
- Features
2027
-
2028
- * Introduce builtin-types for the (HANA) SQL types `SMALLINT`, `TINYINT`,
2029
- `SMALLDECIMAL`, `REAL`, `CHAR`, `NCHAR`, `VARCHAR`, `CLOB`, `BINARY`,
2030
- `ST_POINT`, `ST_GEOMETRY`. In the CSN, they appear as `cds.hana.SMALLINT`,
2031
- …. In CDL, they can be referred to by `hana.SMALLINT`, ….
2032
-
2033
- Mapping of the types is as follows:
2034
-
2035
- |CDS|HANA|SQLite|OData V4|OData V2|
2036
- |----|----|-----|--------|--------|
2037
- |SMALLINT|SMALLINT|INT|Edm.Int16|Edm.Int16|
2038
- |TINYINT|TINYINT|INT|Edm.Byte|Edm.Byte|
2039
- |SMALLDECIMAL|SMALLDECIMAL|DECIMAL|Edm.Decimal Scale="floating" Precision="16"|Edm.Decimal|
2040
- |REAL|REAL|FLOAT|Edm.Single|Edm.Single|
2041
- |CHAR|CHAR|CHAR|Edm.String|Edm.String|
2042
- |NCHAR|NCHAR|CHAR|Edm.String|Edm.String|
2043
- |VARCHAR|VARCHAR|CHAR|Edm.String|Edm.String|
2044
- |CLOB|CLOB|CHAR|Edm.String|Edm.String|
2045
- |BINARY|BINARY|CHAR|Edm.Binary|Edm.Binary|
2046
- |ST_POINT|ST_POINT|CHAR|Edm.GeometryPoint|n/a|
2047
- |ST_GEOMETRY|ST_GEOMETRY|CHAR|Edm.Geometry|n/a|
2048
-
2049
- Changes
2050
-
2051
- * Associations in services with targets outside the service
2052
- are not auto-excluded anymore.
2053
- * OData: Create proxy `EntityType`s for association targets that are not
2054
- part of the current service. This maintains the navigation path in the
2055
- EDM model and exposes the primary key tuple of the otherwise unreachable
2056
- target. The primary keys of a proxy entity must be scalar types. No
2057
- complex types are supported. Also all outbound navigations are removed
2058
- from a proxy.
2059
- * The package require node version 8 or higher.
2060
-
2061
- Fixes
2062
-
2063
- * Forbid publishing associations inside unions.
2064
- * Fix a bug in the creation of localized convenience views that lead to an erroneously JOIN
2065
- expression if such a view gets transformed into a SQL query with `toSql --assoc joins`.
2066
-
2067
- * OData: be robust against erroneoulsy assigned @odata.foreignKey4 annotation.
2068
- * Improve ON condition path checks in Association to Join transformation.
2069
- * Fix crash in forHana generation when determining the type of an enum.
2070
-
2071
- ## Version 1.16.1
2072
-
2073
- Features
2074
-
2075
- * API: If the compiler frontend reports messages and the `compile` function
2076
- had been called without options having a `messages` property, then
2077
- the resulting CSN contains a non-enumerable `messages` property containing the messages.
2078
-
2079
- Changes
2080
-
2081
- * Removed TNT specific behaviours for HANA CDS, SQL and OData from the code.
2082
- * Perform usage check of entities annotated with `@cds.persistence.skip` if
2083
- using entity really exists on the database (not annotated with `cds.persistence.table`).
2084
- * Remove mixin associations with a target entity annotated with `@cds.persistence.skip` and
2085
- its select item that eventually expose this association.
2086
- * csn2edm: Produce all services in a given model in one pass removing the requirement
2087
- to call the EDM transformation for each service individually. The existing API is still
2088
- compatible. If an EDM for only one service is requested, only this EDM will be produced.
2089
- * Odata:
2090
- + Don't omit containee's foreign keys if they are also primary key.
2091
- + Remove warning that containment association must be `NOT NULL` .
2092
- + Support annotation `@cds.etag` as (backward compabible) replacement for `@odata.etag`.
2093
- + Update broken UI vocabulary.
2094
-
2095
- Fixes
2096
-
2097
- * Make property propagation from query sources using associations work.
2098
- * Consider associations in `from` clause for `on` condition rewrite.
2099
- * Make the CSN parser always produce the correct result for `null`.
2100
- * Propagate `@cds.autoexpose` along primary query source in all circumstances.
2101
- * Make `annotate` statements on auto-exposed entities work in circumstances.
2102
- * Do not dump when magic variables like `$now` or `current_date` had been used
2103
- in an entitiy for which the compiler creates a localized convenience view.
2104
- * Fix order problem in creation of association `DraftAdministrativeData` for draft enabled entities.
2105
- * Fix runtime error in `forHana` in handling of mixin forward and backward associations.
2106
-
2107
- ## Version 1.15.0
2108
-
2109
- Features
2110
-
2111
- * Release aspect `temporal`.
2112
-
2113
- Changes
2114
-
2115
- * Improve handling for entities are either `abstract` or annotated with `@cds.persistence.skip` in `toHana` and `toSql`:
2116
- + Such entities are not part of the generated database model and thus non-existing in the database schema.
2117
- + Associations/compositions to non-existing entities are removed from the generated model but not their eventually
2118
- generated foreign keys (for managed associations). An info message is raised for each removal.
2119
- + An error message is raised if a non-existing entity is used (either directly or indirectly through an association).
2120
-
2121
- Fixes
2122
-
2123
- * OData
2124
- + Do not assign `@Core.AlternateKeys` for `temporal` aspects if the annotation already assigned.
2125
- + Resolve primitive return types for actions
2126
- + Mark localized _texts entities and convenience views with `@odata.draft.enabled: false`
2127
- * JSON parser
2128
- + Allow JavaScript objects as input, as well as JSON
2129
-
2130
- ## Version 1.14.1
2131
-
2132
- Changes
2133
-
2134
- * Primary key definitions are only allowed in first `union`. Raise an error if primary keys are defined in
2135
- subordinate `union` clauses when generating `toHana`.
2136
-
2137
- Fixes
2138
-
2139
- * HANA CDS
2140
- + Don't generate primary keys in subordinate `union` clauses if the element is a key-element of the source entity.
2141
- + In case of multiple chained `union`s, generate all `union` clauses correctly.
2142
- * OData
2143
- + Generate unique Names for `<edmx:Association>` elements in Version 2 to avoid name clashes with other entries in `<edmx:Schema>`.
2144
- + Raise error for duplicate definitions in `<edmx:Schema>`.
2145
- * CSN Input
2146
- + validation - joins can have value literals in the on condition
2147
-
2148
- ## Version 1.14.0
2149
-
2150
- Features
2151
-
2152
- * Support aspect `temporal` with option `--beta-mode`:
2153
- + Support magic variables `$at.from` and `$at.to`.
2154
- + OData:
2155
- - Add element annotated with `@cds.valid.from` to the key in the metadata document but not in the CSN, requiring a valid
2156
- primary key in the projection to exist.
2157
- - An element annotated with `@cds.valid.key` becomes the sole primary key in the EntityType.
2158
- Add an `@Core.AlternateKeys` annotation that lists the original primary key tuple as well as the element annotated with `@cds.valid.from`.
2159
- + SQL/HANA CDS:
2160
- - Translate `$at.from` to `SESSION_CONTEXT('VALID-FROM')` in HANA and `current_time` in Sqlite.
2161
- - Translate `$at.to` to `SESSION_CONTEXT('VALID-TO')` in HANA and `current_time` in Sqlite.
2162
- - A `WHERE` claues that allows time travel queries is generated for projection that contain exactly one element annotated
2163
- with `@cds.valid.from` and `@cds.valid.to` that stem from the same origin.
2164
- - An entity elementannotated with `@cds.valid.from` is added to the primary key tuple of the resulting database table.
2165
- - If an entity element is annotated with `@cds.valid.key`, it becomes the sole primary key of the resulting database table.
2166
- * Redirect targets of associations in `localized` convenience views to their respective `localized` convenience views.
2167
- In addition to that, create a `localized` convenience view for all entities that contain associations that lead directly
2168
- or indirectly (via n other association steps) to a localized entity, so that these associations can also be redirected.
2169
- `Localized` convenience views are only created in case the model is error free.
2170
-
2171
- Changes
2172
-
2173
- * Allow to `extend` an entity with an empty structure
2174
- * OData:
2175
- + An error is raised for entities that have become empty (no elements) due to automatic exclusion of associations.
2176
- + Update the vocabulary `UI`
2177
- + Allow multiple 'backlink' associations via `$self` ON condition, first 'backlink' establishes the partnership
2178
- + Allow 'backlink' associations to define their own target multiplicity.
2179
- + Raise a warning if the forward association is not included in the service (due to autoexclusion).
2180
- + Reclassify error on containment association to be `NOT NULL` down to a warning.
2181
- + `@cds.api.ignore` suppresses annotations.
2182
-
2183
-
2184
- Fixes
2185
-
2186
- * OData: Fix issues with `@cds.odata.bindingparameter.collection`:
2187
- + Correct `$Collection` to `Collection` in EDMX
2188
- + No referential constraints for NavigationProperties with target multiplicity '*'
2189
- * Avoid internal errors on cyclic view definitions
2190
- * Strengthen checks on reserved names
2191
-
2192
-
2193
- ## Version 1.13.4
2194
-
2195
- Feature
2196
-
2197
- * `extend projection` with elements
2198
- * `extend` entity with aspect, i.e. not by specifying new elements, but via a definition which has elements.
2199
-
2200
- Changes
2201
-
2202
- * Localized convenience views (introduced in Version 1.12.0 as beta feature) are now available.
2203
- + The convenience views for views and projections are created as a copy of the regular artifact in
2204
- the `localized` namespace which selects from the corresponding localized artifacts.
2205
- + Associations within localized convenience views aren't redirected yet; they still point to their
2206
- original non-localized target.
2207
- + Convenience views for views containing associations in their `FROM` clause aren't supported yet.
2208
- For those views an `Info` message is produced stating that no convenience view could be created for the given view.
2209
- + In contrast to the beta feature it isn't required anymore to expose the `localized` association or the primary key.
2210
- * The automatic exposure of entities, redirection and exclusion of
2211
- associations has been moved from `forHana` and `forOdata` post-processing into the core compiler:
2212
- + When an association is projected, the compiler checks whether all elements are propagated
2213
- which are referred to in the `on` condition of the projected association.
2214
- Please __reexamine warnings__ for your model.
2215
- + The compiler checks whether a redirection target (directly or indirectly) projects from the
2216
- original target (and/or uses the original target as structure include).
2217
- + Elements can be renamed in the redirected target and the `on` condition is rewritten correspondingly
2218
- (currently not if the projected association is an indirect one, i.e. if we project `assoc1.assoc2`,
2219
- which _was an Error in v1.12.0_) → this means that those DB artifacts can be deployed.
2220
- + When following an implicitily redirected association,
2221
- potentially renamed elements are taken into account.
2222
- + Implicit redirections fail less often as the compiler tries to find a "minimal" exposure.
2223
- + Auto-exposure via `Composition of` now works in all circumstances.
2224
- + Other features like "localized" work for auto-exposed entity and/or with implicitly redirected association.
2225
- + __Redirections for associations which are sub elements do not work__.
2226
- * The name of an auto-exposed entity now looks like `<Service>.<LastNamePart>`
2227
- where `<LastNamePart>` is the part of the name of the original entity after the final dot.
2228
- If you get an error because of name clashes, just expose one entity explicitly
2229
- (or use the option `longAutoexposed`).
2230
- * Multiple backlink associations for one forward association make the OData backend report an error.
2231
-
2232
- Fixes
2233
-
2234
- * Forward the `key` property to the select items of generated HANA CDS views.
2235
- * Remove some issues of the `$projection` and `$self` handling in the association to join translation.
2236
- * Add alias for select items that are primary key in HANA CDS.
2237
- * Fix support for union queries in localized convenience views.
2238
-
2239
- ## Version 1.12.1
2240
-
2241
- Changes
2242
- * With option `--beta-mode`, automatic exposure of entities, redirection and exclusion of
2243
- associations has been moved from `forHana` and `forOdata` post-processing into the core compiler.
2244
-
2245
- Fixes
2246
- * With option `--beta-mode` in v1.12.0, a just inherited `@cds.autoexpose` had not been considered.
2247
- * With option `--beta-mode` in v1.12.0, projecting indirect associations (`assoc1.assoc2`) lead to an error.
2248
-
2249
- ## Version 1.12.0
2250
-
2251
- Features
2252
- * With option `--beta-mode`, support `localized` convenience views:
2253
- Create a view named `localized.<EntityName>` for an entity with `localized` elements.
2254
- This view allows a coalesced access to `localized` elements and either returns
2255
- the default or translated content, depending on the locale setting.
2256
- + A convencience view is only created if both the `localized` association and some
2257
- localized elements are exposed in the entity.
2258
- + When exposing the `localized` association in an entity, also the complete primary key
2259
- has to be exposed, otherwise an error is thrown.
2260
- * Mark calculated and virtual elements as `@Core.Computed:true`. If `@Core.Computed` has
2261
- been set manually, it remains unchanged.
2262
-
2263
- Changes
2264
-
2265
- * With option `--beta-mode`, automatic exposure of entities, redirection and exclusion of
2266
- associations has been moved from `forHana` and `forOdata` post-processing into the core compiler.
2267
- _Update to v1.12.1_ if you experience problems – an inherited `@cds.autoexpose` had not been considered.
2268
- * In `toSql` and `toHana` errors are raised
2269
- + for duplicate definitions of elements that differ only in spelling,
2270
- + if the entity is not `abstract` or annotated with any `@cds.persistence` set to true and
2271
- - an element is typed to be an `array of` a `type`,
2272
- - an implicit managed composition has cardinality to many.
2273
- * Raise a warning if an element is to be `localized` which is not of type `cds.String`.
2274
-
2275
- Fixes
2276
- * OData:
2277
- + On `@Aggregation.ApplySupported.PropertyRestrictions` apply `@sap.sortable':false, '@sap.filterable':false`
2278
- at new `ID__` property.
2279
- + Allow `@Core.OperationAvailable: null`
2280
- + Abstract entities and all inbound navigation properties are removed from the metadata document.
2281
- + Non-properties are not considered as referential constraints.
2282
- * Correct annotation `cds.autoexposed`.
2283
-
2284
- ## Version 1.11.0
2285
-
2286
- Features
2287
- * Support `localized` elements:
2288
- + Add sibling entity `<entityName>_texts` to store the localized content.
2289
- + Add two associations `texts` and `localized` to the original entity.
2290
- + Add view `localized.<entityName>` to retrieve either the translated or original content.
2291
- * Annotate elements that are `virtual` or annotated with `@odata.on.insert` or
2292
- `@odata.on.update` with `@Core.Computed`.
2293
- * Support OData `@Common.ValueList` by either
2294
- + annotating an element for which a value help entity shall be used with
2295
- `@Common.ValueList.viaAssociation`. The value is the association to the value list entity.
2296
- + annotating an entity with `@cds.odata.valuelist`. All associations targeting to this entity
2297
- are then annotated with `@Common.ValueList.viaAssociation`.
2298
- + annotating an element statically with `@Common.ValueList.entity`. The annotation value
2299
- is a static entity name and cannot be dynamically adapted during autoexposure.
2300
- * Add annotation `@cds.odata.bindingparameter: {name: String, collection: Boolean }`
2301
- which allows overriding the binding parameter name and cardinality of a bound action in
2302
- OData V4. Default is: `name='in'`, `collection=false`.
2303
- * Allow a colon in `FROM` and `TYPE OF` references.
2304
- * Support using and publishing a mixin association in the same view when activating for HANA CDS.
2305
-
2306
- Changes
2307
- * Produce all CSN output in version 1.0 by default.
2308
- * Virtual elements cannot be used in expressions.
2309
- * Command `toRename` creates a stored procedure instead of individual statements.
2310
- * Don't auto-expose composition target which is annotated with `@cds.autoexpose: false`.
2311
-
2312
- Fixes
2313
- * OData:
2314
- + Rename OData annotation vocabulary `Auth` to `Authorization`.
2315
- + Correct exposure of entities with parameters:
2316
- - Set attribute `EntityType` of element `edm:EntitySet` to the correct type
2317
- - Set attribute `EntitySet` of element `edm:End` in `edm:AssociationSet` to
2318
- the correct set.
2319
- + `EnumMember` in element `edm:Annotation` has only one delimiting slash
2320
- * Rewrite ON condition of a mixin backlink association for an inferred and redirected
2321
- forward association.
2322
-
2323
- ## Version 1.10.0
2324
-
2325
- Features
2326
- * Annotate entities with `@cds.autoexposed` that are auto-exposed in a service.
2327
- * Always auto-expose composition targets without annotating them with `@cds.autoexpose`.
2328
- * For associations in a service with targets which are not in a service:
2329
- + automatically exclude them if the associaiton is inferred (via select * or include),
2330
- + signal an error if the association is explicitly defined in the service.
2331
- * Support the OData annotation vocabulary `Authorization`.
2332
-
2333
-
2334
- Changes
2335
- * Generate `null as …` for virtual view elements.
2336
- * Update OData annotation vocabulary `Core`.
2337
- * Change the tranlation of annotation `@readonly` at an element from `@Core.Immutable` to
2338
- `@Core.Computed` when processing for OData.
2339
-
2340
- Fixes
2341
- * Avoid unnecessary aliases for paths that terminate on an association in the FROM clause.
2342
- * Fix an issue with table alias handling in Association to Join translation.
2343
- * Translate type `Cds.DateTime` to SQL type `TIMESTAMP` for Sqlite.
2344
- * Fix an internal error when parsing `view V as select distinct from E`
2345
- * Raise an error that an empty service cannot be used to generate an OData metadata document
2346
- * Correctly set the OData principal in a referential constraint for compositions with
2347
- free defined ON conditions.
2348
-
2349
- ## Version 1.9.0
2350
-
2351
- Changes
2352
- * Always use quotes around identifiers for `toSql` and `toHana` with `quoted` or
2353
- `hdbcds` names.
2354
- * Never use quotes around identifiers for `toSql` and `toHana` with `plain` names.
2355
- Issue a warning if an identifier may conflict with a language keyword.
2356
- * Generate `.hdbtable`, `.hdbview` etc. files if option `toSql.src` is `hdi` (default
2357
- `sql` generates `.sql` files).
2358
-
2359
- Features
2360
- * Allow `select` clauses with standard SQL syntax (i.e. also accept `select ... from ...`
2361
- in addition to the CDS-specific form `select from ... { ... }`).
2362
- * Support `count(*)` etc.
2363
- * Support function calls with names arguments.
2364
- * Support `aspect` definitions.
2365
-
2366
- Fixes
2367
- * Omit unused vocabularies in OData-generated EDMX files.
2368
- * For `toOdata`, handle nested anonymous types correctly (also with arrays, e.g. in
2369
- action/function parameters)
2370
- * Handle mixins correctly when transforming associations to joins.
2371
-
2372
- ## Version 1.8.1
2373
-
2374
- Changes
2375
- * With `--new-redirect-impl`, associations and compositions in services
2376
- are implicitely redirected to a (unique) projection of the original target
2377
- if the projection is "simple and similar enough" and defined in the service.
2378
- This is now always done, not only by the `toOdata` backend;
2379
- association targets explicitly provided in the service are not implicitly redirected.
2380
- * With option `--new-csn` (or `--beta-mode`) alone, we do not properly rewrite the
2381
- `on` condition or `keys` anymore.
2382
- Use option `--assoc-on-rewrite` and `--new-redirect-impl` to do so.
2383
-
2384
- Fixes
2385
- * With `--new-redirect-impl`, the navigation along implicitly redirected associations now
2386
- properly considers that elements could have been renamed in the new association target.
2387
- * With `--new-redirect-impl`, the code completion candidates are the elements
2388
- of the new association target calculated by the implicit redirection.
2389
- * With `--new-redirect-impl` and `--assoc-on-rewrite`,
2390
- the `on` condition or `keys` are rewritten with implicit redirections.
2391
- * With `toSwagger`, enum constants without values are now correctly rendered.
2392
- * With `toSql` in `sqlite` dialect, a warning is now issued if an identifier collides
2393
- with a known SQL keyword.
2394
- * For OData, annotations with `null` values are now ignored (this can also be used to
2395
- "delete" an annotation in an extension).
2396
- * In OData, structured types that are anonymous or not exposed in a service are now
2397
- automatically exposed (unless used as an entity element - in that case they are still
2398
- flattened).
2399
- * For OData v2, the namespace for service annotations is now correctly set.
2400
- * For `toHana` with `plain` names, all type properties (including `length` ...) are now
2401
- propagated correctly when derived types are used explicitly in view columns.
2402
- * CSN version 0.2.0 is now accepted by the compiler.
2403
-
2404
- ## Version 1.8.0
2405
-
2406
- Features
2407
- * Support the OData annotation vocabularies `PersonalData` and `Aggregation`.
2408
- The vocabulary for `PersonalData` contains a number of annotations that are flagged
2409
- as "experimental". Their usage will result in a warning.
2410
- * New option for specifying the locale in SQLite dialect. As part of the `toSql`
2411
- command is now available the options `'-l, --locale <locale>'` for specifying
2412
- value for the "$user.locale" variable.
2413
-
2414
- Changes
2415
- * Entity definitions with elements of type `array` and structure type definitions with
2416
- association elements will now lead to an error message when generating edmx for OData v2.
2417
- These constructs are not allowed in OData v2, but there was no corresponding check in the
2418
- cds compiler yet.
2419
-
2420
- ## Version 1.7.1
2421
-
2422
- Fixes
2423
- * Restore version function which was deleted by accident
2424
-
2425
- ## Version 1.7.0
2426
-
2427
- Features
2428
- * Allow entities to have parameters. They can be referred to inside the query with
2429
- `:Param`. Entities with parameters are not allowed in `toSql` for dialect "sqlite".
2430
- When generating for HANA, parameters cannot be used in combination with associations:
2431
- an entity with parameters cannot have associations, and an association must not point
2432
- to an entity with parameters.
2433
- * The parameters and return value of actions and functions can now have structured types.
2434
- * In the annotation translation for OData, falsy values of the special variable `$value`
2435
- (that is used to provide nested annotations for scalar values) are correctly handled.
2436
- * When (new-style) csn is used as input, the compiler ignores unknown attributes.
2437
- * Implicit redirection and auto-exposure are now applied recursively, i.e. the associations
2438
- of an auto-exposed entity are considered for implicit redirection and auto-exposure,
2439
- if necessary.
2440
-
2441
- Changes
2442
- * With `--new-csn`, consider `redirected to` on projected associations and
2443
- adapt the `on` condition and the `keys` specification accordingly. There are
2444
- also Info messages if an element referred to in the `on` condition or `keys`
2445
- specification has not been projected to the new association target.
2446
- _The severity of these messages will be increased if implicit redirections
2447
- will have been performed by the core compiler._
2448
- * `toHana` and `toSql` now reject entities that only contain unmanaged associations.
2449
- Such entities would lead to a deployment error later.
2450
- * SQL name mapping modes `quoted` and `hdbcds` are only allowed when generating for HANA.
2451
- * In the csn, the csn language version is now stored in the top level attribute `$version`.
2452
- The version information via `version.csn` is deprecated and will be removed in a future
2453
- release. The information about the creator of the csn has been moved inside the new
2454
- top level attribute `meta`.
2455
-
2456
- Fixes
2457
- * Provide code completion for references in complex select item expressions not
2458
- (yet) having an alias (complex = not consisting of just a reference).
2459
- * With `--new-csn`, avoid internal error while rewriting the `on` condition
2460
- from an element of a source entity which refers to a `mixin` definition with
2461
- an `on` condition containing a reference like `$projection.<elem>`.
2462
- * OData, edmx generation: correctly escape the characters `<`, `>`, `&`, and `"`.
2463
- * When an entity is auto-exposed, it's annotations are transferred to the generated
2464
- projection.
2465
-
2466
- ## Version 1.6.0
2467
-
2468
- Features
2469
- * Provide code completion for `using` declarations.
2470
- * Support the OData annotation vocabulary "Validation".
2471
- * For compositions in EDM, add `<OnDelete Action="Cascade"/>` to the navigation
2472
- property where required.
2473
-
2474
- Changes
2475
- * With `--new-csn`, complain more often about projected associations whose `on`
2476
- condition could not be rewritten correctly.
2477
- * Make `associations: 'joins'` the default for `toSql` (because the default for
2478
- `dialect` is already `sqlite`, which requires joins).
2479
- * Adapt the command line interface to use commands instead of the `--to...` generation
2480
- options (e.g. `cdsc toHana --src --names plain` instead of `cdsc --toHana src,plain`).
2481
- Please see the [Command Line Migration guide](doc/CommandLineMigration.md)
2482
- for details.
2483
- * Add a `generated by cds-compiler version x.y.z` comment to all generated SQL and `hdbcds`
2484
- sources.
2485
- * Replace the CSN validator (formerly `ajv`) with a new own implementation.
2486
-
2487
- Fixes
2488
- * With `--new-csn`, do not change references to magic variables like `$user.id`
2489
- while rewriting the `on` conditition of a projected association.
2490
- * Apply OData specific checks (e.g. that all elements of an entity must have a type)
2491
- applied only to objects that are exposed in a service.
2492
- * When generating SQL for SQLite, replace the special variables `$now`, `$user.id`
2493
- and `$user.locale` by `CURRENT_TIMESTAMP`, `'$user.id'`, and `'EN'`, respectively.
2494
- * Issue a warning for conflicting cardinality declarations (e.g. `association[1] to many ...`).
2495
- * Handle filters with cardinality correctly when translating associations to joins.
2496
- * Avoid crash when checking structured action parameters.
2497
- * Handle `$self` as the first of multiple path steps correctly in `toOdata`.
2498
- * In `toHana`, render the combination of enums and `type of` correctly.
2499
- * In mixins generated by `toHana`, handle special variables starting with `$` correctly.
2500
-
2501
- ## Version 1.5.0
2502
-
2503
- Features
2504
- * The DDL statements in the output of `toSql` are now sorted according to kind
2505
- (views after tables), so that they can be deployed sequentially to HANA (view
2506
- dependencies not yet considered).
2507
- * (Still work in progress): The output of `toSql` now also contains kind-specific
2508
- dictionaries for `hdbtable`, `hdbview` etc., which should be directly deployable
2509
- to HDI.
2510
-
2511
- Changes
2512
- * Element definitions in multiple entity/structure extensions are now sorted
2513
- according to the layer hierarchy – elements from highest layers come last.
2514
- Report such multiple extensions only if they are potentially problematic.
2515
- * The values for the `names` option of `toSql`, `toHana` and `toOdata` have
2516
- been renamed: `flat` (default) is now `plain`, `deep` is now `quoted`. The old
2517
- values are still accepted (with a warning) but **will be removed in a subsequent
2518
- release**.
2519
-
2520
- Fixes
2521
- * OData, annotation processing for v2: In a view where translation of analytical annotations
2522
- is switched on, the annotations `@Common.Text`, `@Common.Label`, and
2523
- `@Measures.ISOCurrency/@Measures.Unit` are now translated into the corresponding v2-style annotations
2524
- `sap:label`, `sap:text`, and `sap:unit`, respectively, even if the value is a path or
2525
- has a nested annotation.
2526
- * OData V2, generation of EDMX: The Parameters of a FunctionImport now always have
2527
- an attribute `Nullable="true"` if not specified as `not null` in CDS.
2528
- * Produce better parentheses for nested set operations (`union`, `intersect`, ...) in views
2529
- for SQL output.
2530
- * Correctly strip off the `enum` property of types for HANA CDS, even when derived types are
2531
- involved.
2532
-
2533
- ## Version 1.4.0
2534
-
2535
- Features
2536
- * OData, annotation processing: Provide a shortcut for the nesting of the `TextArrangement`
2537
- annotation: In order to annotate a `@Common.Text` annotation, just put an annotation
2538
- `@Common.TextArrangement` next to it.
2539
- * Parameters can now be referred to with `:param`, `:1` or `?` in the parse API functions.
2540
-
2541
- Changes
2542
- * More checks for the correct usage of `$self` and associations as values in expressions.
2543
- * Backlink-Associations: When transforming an ON-condition `on $self = foo.bar`, check that
2544
- the association `bar` really points to the entity enclosing association `foo`.
2545
- * Allow and transform multiple `$self`-comparisons in one association ON-condition
2546
- (but a true backlink association still requires exactly one such comparison).
2547
- * Warn if a "to many" association or composition does not have an ON-condition
2548
- (likely not intended because the resulting managed association will at most match a single
2549
- item)
2550
-
2551
- Fixes
2552
- * Add missing `as` for flattened structured elements.
2553
- * Allow `using cds;` to make the namespace `cds` explicitly known, which is
2554
- useful if that had been shadowed by a namespace declaration ending with `cds`.
2555
- * OData: don't generate empty `<Annotations ...>` elements any more.
2556
- * Draft for OData v2: in the `DraftRoot` and `DraftNode` annotations, the path
2557
- to the draft annotations now contains `EntityContainer`.
2558
- * Improved checks for parameters of actions and functions. Inappropriate warnings like
2559
- "The type of input parameter ... must be from the current service" and
2560
- "The action ... can only return an array of entities" don't appear any more.
2561
- * Correctly generate foreign key fields for associations in structured types.
2562
- * For `toHana()` and `toSql()`, enclose the artificial condition resulting from
2563
- `$self`-comparisons in parentheses.
2564
- * Warn properly when draft-enabled artifacts are not exposed in a service.
2565
- * Do not render a full entity name for paths like `$self.foo` to SQL (just skip `$self`).
2566
-
2567
- ## Version 1.3.0
2568
-
2569
- Features
2570
- * The `using` declaration can now appear top-level also after artifact definitions.
2571
- * Support for `$user.locale` and `$user.id` with HANA generation `SESSION_CONTEXT(…)`.
2572
- * For entities annotated with `@odata.draft.enabled`, the generated `DraftAdministrativeData`
2573
- association for ODATA is now annotated with `@odata.contained: true` (avoiding the
2574
- generation of an `<Attribute>` for its foreign key in ODATA V4).
2575
-
2576
- Changes
2577
- * Having just `$user` in CDL is now rendered as `{ref:['$user','id'], as:'$user'}`
2578
- in new-style CSN.
2579
- * Using SQL's parameter-less functions not having parentheses (like `current_date`)
2580
- is now rendered as `{func:'current_date'}` in new-style CSN.
2581
- * `betaMode` is currently required for entities with parameters.
2582
- * In old-style CSN, the `on` condition as source text has been removed.
2583
- * Explicit redirection of an association to a target that is completely unrelated to
2584
- the original target is now an error, not just a warning.
2585
- * The API function `toI18n()` and the corresponding command line option `--to-i18n` have
2586
- been removed.
2587
- * Annotation assignments after sub structure definitions, enum definitions, and
2588
- parameters are now considered an error instead of just a warning.
2589
- * For bound actions and functions, the name of the corresponding function import in
2590
- OData v2 edmx is now prefixed with the name of the entity.
2591
-
2592
- Fixes
2593
- * For ODATA V2, create correct `<Principal>` and `<Dependent>` for backlink associations
2594
- having `@odata.navigable:false`.
2595
- * Avoid the `Expecting artifact to be part of a service` error that occurred when generating
2596
- multiple entities with `@odata.draft.enabled` to SQL.
2597
- * Generate correct (fully qualified) action names into the `@Common.DraftRoot` and
2598
- `@Common.DraftNode` annotations.
2599
- * When generating the `DRAFT.DraftAdministrativeData` entity for SQL, provide proper
2600
- lengths for all `NVARCHAR` fields.
2601
-
2602
- ## Version 1.2.0
2603
-
2604
- Features
2605
- * Provide semantic code completion for the `excluding` clause.
2606
- * Add support for "deep drafts", i.e. follow compositions from entities annotated
2607
- with `@odata.draft.enabled` ("draft roots") and draft-enable them as "draft nodes".
2608
-
2609
- Changes
2610
- * Finalize the propagation of the `key` property.
2611
- Provide Info messages if it is not obvious why it has not been propagated.
2612
- * Finalize the propagation of the `keys` property and `items` property.
2613
- * Check for illegal use of `$self` and associations in expressions (may only occur
2614
- as values in an expression as part of the ON-condition in a backlink association).
2615
-
2616
- Fixes
2617
- * Produce warnings instead of errors in the translation of OData annotations.
2618
- * For ODATA, in case of managed associations to draft-enabled entities, do not add
2619
- an extra foreign key for the ODATA-generated key field `IsActiveEntity`.
2620
- * For HANA, in the generated draft shadow entities, redirect all associations (not
2621
- just compositions) so that they point to the draft shadow entities.
2622
- * For ODATA V2, produce an `<EntitySet>` for `DraftAdministrativeData`, too. Ignore
2623
- the `@cds.odata.NoEntitySet` annotation.
2624
- * For ODATA V4, do not generate `<Nullable>` for `<NavigationProperty>`s that are
2625
- collections.
2626
-
2627
- ## Version 1.1.3
2628
-
2629
- Features
2630
- * A `;` is now always optional before `}` and more often optional after a `}`.
2631
-
2632
- Changes
2633
- * In `toOdata()` for v2, in the edmx the
2634
- **names of bound actions and functions now are prefixed with the corresponding entity's name**
2635
- in order to disambiguate actions and functions with the same name at two or more entities.
2636
- The corresponding implementation code in the CDS runtime needs to be adapted.
2637
- * Check `redirected to` target.
2638
-
2639
- Fixes
2640
- * Make the compiler more robust wrt/ parse errors and redefinitions.
2641
- * Correctly propagate properties inside `returns` and `items`.
2642
- * Some corrections to EDM `ActionImport` and `FunctionImport` in ODATA V2 and V4.
2643
- * Generate correct joins for mixin associations that are traversed with different filters.
2644
- * Generate joins not only for views, but also for projections.
2645
- * For entities annotated with `@odata.draft.enabled`, make all non-key fields nullable in
2646
- `toOdata()`.
2647
-
2648
- ## Version 1.1.2
2649
-
2650
- Features
2651
- * Allow reserved names for annotations/properties in assignments.
2652
- * Allow final `,` for much more "lists" (e.g. arguments).
2653
- * It is now possible to omit the select list in a view definition,
2654
- which is the same as writing `select from <name> {*}`.
2655
- * Allow `array of` as type spec for a parameter definition.
2656
- * SQL generation for sqlite now supports a mode where associations are resolved
2657
- to joins.
2658
-
2659
- Changes
2660
- * Improved messages for syntax errors.
2661
- * `where` now is a reserved keyword and so cannot be used anymore as name at many places.
2662
-
2663
- Fixes
2664
- * In `toOdata()` with the `hdbcds` naming convention, the value of the `@cds.persistence.name`
2665
- annotation now uses `.` rather than `_` as separator for the names of flattened structured
2666
- entity elements.
2667
- * Numeric values in OData annotations are now correctly mapped to edmx.
2668
-
2669
- ## Version 1.1.1
2670
-
2671
- Fixes
2672
- * Ignore unapplied extensions when generating HANA CDS source.
2673
- * Make sure the combination of `collectSources()` and `compileSources()` has the same
2674
- effect as `compile()`, especially regarding annotation precedence.
2675
- * Render annotations of `edm:Schema` correctly in for ODATA V4.
2676
-
2677
- ## Version 1.1.0
2678
-
2679
- Features
2680
- * Support `@odata.draft.enabled` without the need for option `{ betaMode: true }`).
2681
-
2682
- Fixes
2683
- * Return result of `collectSources()` as promise.
2684
-
2685
- ## Version 1.0.33
2686
-
2687
- Features
2688
- * Allow to extend query entities with actions.
2689
- * Allow `select distinct`.
2690
- * With `--tnt-flavor` only: allow to specify (a restricted version of) service include via syntax.
2691
- * (Work in progress): New option `{ dialect: 'hana'|'sqlite' }` for `toSql()`, allowing generation
2692
- of SQL statements without HANA-specific constructs (e.g. without `WITH ASSOCIATION`).
2693
- * For ODATA V4, handle associations to parameterized entities correctly.
2694
- * Allow specifying `key` for projection elements (important in case of partial keys
2695
- not being propagated, see below).
2696
- * Annotate entities and elements in the CSN with `@cds.persistence.name`, the name generated
2697
- for the persistence layer according to the naming convention chosen (`flat`, `deep`, `hdbcds`).
2698
- * (Work in progress, only available with option `{ betaMode: true }`): Support `@odata.draft.enabled`
2699
- with `toHana()`, `toOdata()` and `toSql()`. Only draft roots so far, no compositions.
2700
-
2701
- Fixes
2702
- * Put table alias for `from` into CSN even without having it explicitly provided in CDL
2703
- if necessary (the table has been referred via a `using` with alias).
2704
- * Do not assume a specific min cardinality if none was provided.
2705
- * For SQL, provide table aliases when required because of `flat` naming.
2706
- * Handle `@readonly` annotation correctly when applied to entities.
2707
- * Various fixes to the handling of `@odata.contained`.
2708
-
2709
- Changes in the property propagation, see internalDoc/Propagation.md:
2710
- * Propagate properties along primary sources in includes, especially actions/functions.
2711
- * The propagation of `key` is more restrictive now, most notably:
2712
- only if all keys are selected (selecting sub elements of a structured key is not enough),
2713
- only if there is no navigation along a to-many association in a select item.
2714
- * The propagation of `notNull` has been corrected.
2715
- * The propagation of `virtual` has been corrected.
2716
- * The propagation of an array type has been corrected.
2717
-
2718
- Other changes
2719
- * For ODATA, provide min cardinality 1 for non-null associations.
2720
- * Remove obsolete option `--check-model`. Instead, always perform all checks
2721
- previously hidden behind that option, possibly resulting in more warnings
2722
- (but not more errors).
2723
- * Actions and functions are no longer restricted to entities within services.
2724
-
2725
- ## Version 1.0.32
2726
-
2727
- Features
2728
- * The `toHana()`, `toSql()` and `toRename()` backends now also support a naming
2729
- convention that is backward compatible to HANA CDS, with option `{ names: 'hdbcds' }`.
2730
- * New API function `collectSources()` to conserve a set of compiled sources with
2731
- its hierarchy relations.
2732
- * Avoid unnecessary quoting of names generated by `toHana()`, `toSql()` and `toRename()`.
2733
- * Implement handling of `@cds.persistence.table`.
2734
- * Support "term casts" in paths of ODATA annotations.
2735
- * Support the `@odata.contained` annotation.
2736
-
2737
- Changes that only have an effect if the `--new-csn` option is set
2738
- * With `--disable-propagate`, produce CSN in `gensrc` flavor:
2739
- + omit inferred elements and keys,
2740
- + omit propagated properties (like annotation assignments),
2741
- + supply annotation assignments on inferred and propagated members with an
2742
- extra `annotate` statement in the model's `extensions` property if necessary.
2743
- * Without `--disable-propagate`, produce CSN in `client` flavor:
2744
- + provide inferred elements and keys,
2745
- + provide propagated properties (like annotation assignments),
2746
- + supply annotation assignments directly with the inferred member.
2747
- * The `$inferred` property has been removed.
2748
- * Rename `foreignKeys` to `keys` for the keys to target elements of associations.
2749
- * Rename `filter` to `where` in `ref`s and omit the surrounding `{xpr:…}` of the condition.
2750
- * Do not render query `columns` if no columns have been provided (only implicit `*`).
2751
- * Render technical configuration correctly.
2752
- * Render `select distinct` correctly.
2753
- * Let also those backends that produce CSN as a by-product (e.g. `toHana()`, `toOdata()`, ...)
2754
- produce new-style CSN if the `--new-csn` option is set.
2755
-
2756
- Other changes
2757
- * The property propagation has been changed, except with `--tnt-flavor`.
2758
- See internalDoc/Propagation.md, it is still work in progress.
2759
- * Remove the special handling of namespaces ending with `::`
2760
- * Sort the output of `toHana()` and `toCdl` (also within contexts and services).
2761
- * When `@cds.autoexpose` is set for entities that are already exposed, use the existing
2762
- exposure for implicit redirection.
2763
-
2764
- Fixes
2765
- * An `annotate` statement on an enum symbol now has the expected effect.
2766
- * Annotation `@cds.autoexposure` is renamed to `@cds.autoexpose` (like it is used in documentation)
2767
- * EDM `Nullable` and `Cardinality` now handled correctly for ODATA V2.
2768
- * Correctly check that elements must have a type for ODATA.
2769
- * Handle structured annotation assignments and `#`-variants correctly with `toCdl()`.
2770
- * For `toHana`, generate correct aliases for foreign key fields in views if the corresponding
2771
- association has an alias.
2772
- * Do not propagate `@cds.persistence.table` and `@cds.persistence.exists`.
2773
- * Render artifact paths in `from` correctly with `toSql()`.
2774
- * In EDM, do not render `OpenType` and `Abstract` if they have default values.
2775
- * For EDM annotations, correctly set `Target` according to vocabulary's `AppliesTo`.
2776
- * In EDM, only set `Nullable=false` if `not null` was explicitly specified (i.e. not just for
2777
- all keys).
2778
- * In EDM, handle entities with parameters correctly regarding the entity type that
2779
- is generated for the parameters.
2780
-
2781
- ## Version 1.0.31
2782
-
2783
- Features
2784
- * Support multiple imported names in `using` declaration:
2785
- `using { foo.bar, this as that } from './othermodule';`
2786
- * Add new command line option `--to-rename`, generates SQL DDL statements
2787
- renaming existing HANA tables for migration (work in progress, subject to
2788
- change).
2789
- * For ODATA, allow backlink associations on unmanaged associations.
2790
-
2791
- Changes
2792
- * New error for extending views (query entities) with new elements.
2793
- * Allow annotations of unknown artifacts - slightly change the name resolution
2794
- in CDL for references in top-level `extend` and `annotate` statements.
2795
- * Make the client tool display info messages by default.
2796
- * Make keywords `new` and `aspect` to be non-reserved. With this change, the set
2797
- of reserved keywords of CDL is a real subset of the reserved keywords of SQL.
2798
- * Remove command line options and API functions deprecated with v1.0.24.
2799
- * In ODATA V2, reuse the `edm::Association` of the original association for backlink
2800
- associations.
2801
-
2802
- Fixes
2803
- * Miscellaneous fixes for CSN with option `--new-csn`.
2804
- * Avoid internal error by not running extra checks after compilation with error.
2805
- * Propagate defaults and `@odata.Type` annotations from keys to generated foreign
2806
- key fields of associations.
2807
- * Do not render annotations of subqueries to HANA CDS.
2808
- * Suppress `$projection` in ON-conditions for ODATA.
2809
- * When looking for candidates for implicit redirection, follow `FROM` sources of
2810
- views/projections and `:`-includes of entities transitively, not just for one level.
2811
- (Please note that this fix **may uncover errors in existing models** where implicit
2812
- redirection now fails because of multiple candidates. Use explicit redirection to
2813
- resolve this to one of the candidates, as suggested in the error message).
2814
- * For ODATA and HANA CDS, recognize and transform backlink associations also if the
2815
- condition is in (redundant) parentheses.
2816
- * For HANA CDS, replace enum literals in defaults by their values.
2817
- * Reject paths in defaults.
2818
-
2819
- ## Version 1.0.30
2820
-
2821
- Features
2822
- * Complex queries (with joins, sub-selects etc.) are now supported.
2823
-
2824
- Changes
2825
- * Both `toHana()` and `toSql()` now use `flat` names by default (specify
2826
- options `{ names: 'deep' }` to get the old behavior). The CSN version
2827
- currently starts with `0.1` for `flat` names, with `0.0` for `deep`.
2828
- This is likely to be adapted again later.
2829
- * Using `Annotate` on unknown artifacts or members now only leads to an info
2830
- message, not an error anymore. The CSN with option `--new-csn` then has
2831
- an `extensions` property containing the effective assignments.
2832
- * Downward compatibility for `@cds.odata.navigable` was finally removed
2833
- (see 1.0.11, use `@odata.navigable` instead).
2834
-
2835
- Fixes
2836
- * Render table aliases correctly for HANA CDS when an entity is used in
2837
- `from` that is aliased by a `using` declaration.
2838
-
2839
- ## Version 1.0.29
2840
-
2841
- Features
2842
- * Support the generation of multiple services with `--to-swagger`.
2843
- * Support `SELECT DISTINCT`.
2844
-
2845
- Changes
2846
- * Improve smart wildcard handling: simple projections with just redirections now
2847
- have the original element order of the source.
2848
- * Restrict `limit` and `offset` value to number (and `null`).
2849
- * There is a warning for `key` elements outside entities or views, as an inner
2850
- `key` specification would be ignored for implicit foreign keys and propagation.
2851
- * Change propagation of the `key` property: see internalDoc/Propagation.md. Most
2852
- notably, in a view/projection the `key` property is no longer propagated along
2853
- association navigation.
2854
-
2855
- Fixes
2856
- * Entities that contain only virtual elements or are empty (recursively) are
2857
- now rejected for HANA CDS, unless they are abstract (was only partly checked before).
2858
- * Multiply nested structs in views or projections are now correctly rendered to
2859
- HANA CDS (avoiding a completely unrelated error message complaining about
2860
- extensions).
2861
-
2862
- ## Version 1.0.28
2863
-
2864
- Features
2865
- * The mapping of cds to edm types can be overridden by the annotations
2866
- `@odata.Type` and `@odata.MaxLength`. Currently only `Edm.String` can
2867
- be used as target type. This is intended for exceptional cases, where
2868
- the standard type mapping is not wanted (e.g. if `UUID` should be mapped
2869
- to `Edm.String` rather than `Edm.Guid`).
2870
-
2871
- Fixes
2872
- * Issue an error, if an association element that is defined in a mixin of the
2873
- same view is explicitly redirected. Up to now this modeling error was not
2874
- recognized and led to the generation of incorrect HANA CDS models.
2875
- * We now also allow query entities and their elements to use as type, relaxing
2876
- a check introduces with v1.0.26.
2877
- It needs to be seen whether we allow entities as type only for actions.
2878
-
2879
- ## Version 1.0.27
2880
-
2881
- Changes
2882
- * The `implemented in` clause of entity definitions **has been removed** and will now
2883
- cause a syntax error (this clause is obsolete since version 1.0.21, see corresponding
2884
- changelog entry). Replace it by one of these annotations:
2885
- + use `@cds.persistence.exists` to indicate that an object should not be
2886
- created in the database because the database object already exists.
2887
- + use `@cds.persistence.skip` to indicate that an object should not be
2888
- created in the database because it is implemented in the service layer.
2889
-
2890
- ## Version 1.0.26
2891
-
2892
- Features
2893
- * For annotation assignments outside array values,
2894
- allow paths and variants, not just identifiers as keys in structure values.
2895
-
2896
- Changes
2897
- * In `flat` mode, the `toHana` channel will reject quoted identifiers in definitions.
2898
- * Smart `*`: just issue a warning if a select item "overwrites" an element
2899
- coming from the wildcard. Might even be downgraded to an Info message in the future.
2900
- * Artifact references are checked for plausibility:
2901
- only allow entities as association and composition target and
2902
- for the `select from` clause (allow to navigate along associations there, too),
2903
- only allow (non-query) structures for structure includes,
2904
- only allow types (and entities) and their elements as types.
2905
- * Implicit redirection of associations is now also performed for HANA CDS (as it was
2906
- already for ODATA).
2907
-
2908
- Fixes
2909
- * IDE support: improve syntactic code completion, and messages for parse errors.
2910
- * OData: correctly escape special xml characters in generated edmx.
2911
-
2912
- ## Version 1.0.25
2913
-
2914
- Changes
2915
- * Better command line error reporting for `cdsc`.
2916
-
2917
- Fixes
2918
- * Render anonymous structured types correctly to HANA CDS (no `:`).
2919
- * Handle structured elements with aliases in views and projections correctly.
2920
- * Flatten structured view elements for ODATA (like for HANA CDS).
2921
-
2922
- ## Version 1.0.24
2923
-
2924
- Features
2925
- * The `toHana()` channel now also supports the option flag `toHana.names:'flat'`.
2926
- This option affects how the names of database objects and their columns are built.
2927
- This option **will become the default in one of the next versions**.
2928
- The old behavior can then be enforced with option flag `toHana.names:'deep'`.
2929
- With option flag `flat`, ...
2930
- + all names are converted to uppercase
2931
- + in object names, `_` is used as separator instead of `.`
2932
-
2933
- Changes
2934
- * The new command line tool `cdsc` is going to replace the old `cdsv`, which is deprecated **and will
2935
- be removed soon**. Please see the [Command Line Migration guide](doc/CommandLineMigration.md)
2936
- for details.
2937
- * New API "backend" functions (i.e. those that generate output from a CSN model) are going to replace
2938
- the existing ones. The old API functions `toHanaCdl`, `forHana`, `toOdataOutput`, `exportAnnotations`,
2939
- `exportAnnosUi5Style` and `toSqlDdl`, are deprecated **and will be removed soon**. Please see the
2940
- [API Migration guide](doc/ApiMigration.md) for details.
2941
- * ODATA JSON output can no longer be generated for V2 (there is no valid V2 JSON format).
2942
- * When generating the CSDL JSON for OData v4, enum values now have an additional attribute `$EnumMember@odata.type`.
2943
- This addition reflects an amendment of the specification of CSDL JSON.
2944
-
2945
- Fixes
2946
- * Do not try to find table aliases for references consisting of a single identifier,
2947
- i.e., a column named `x` in the select list is also found
2948
- if the table alias or the table itself has been named `x`, too.
2949
- * Fix unjustified message about a undefined reference in `mixin` definitions
2950
- when a reference starting with `$projection` accesses
2951
- a nested element or an element which has been added to the query via `*`.
2952
- * Check that ON-conditions of unmanaged associations do not traverse other unmanaged associations.
2953
- * When generating EDM, ignore aliased elements in ON conditions of redirected associations.
2954
- * Guarantee a deterministic artifact processing order even if async calls are involved.
2955
- * When generating edmx for OData v2, referential constraints for entities with multi-part keys
2956
- are now correctly rendered.
2957
-
2958
- ## Version 1.0.23
2959
-
2960
- Changes
2961
- * When generating for Swagger, handle TNT-specific features more gracefully.
2962
-
2963
- ## Version 1.0.22
2964
-
2965
- Fixes
2966
- * IDE support: improve syntactic code completion, and messages for parse errors.
2967
- * Fix behavior of `@cds.persistence.exists` for HANA CDS (generate correct `using`,
2968
- avoid empty contexts).
2969
- * Strip `key` from structured type elements when generating for HANA CDS.
2970
-
2971
- ## Version 1.0.21
2972
-
2973
- Changes
2974
- * The CSN element property `notNull` is not inherited anymore
2975
- if the `select`/`projection` items whose path referring the source element
2976
- navigates along associations or compositions.
2977
- * Annotation assignments which are placed after the name of `context` or `service` definitions
2978
- must now use the `@(...)` syntax variant if a value is supplied,
2979
- the same restriction already applies for all other definitions.
2980
- This new syntax restriction can be disabled with option `tntFlavor`, and
2981
- re-enabled with its new sub option `skipSloppyAnnoAssignments`.
2982
- * The syntax `implemented in` is deprecated. It is replaced by two new annotations:
2983
- + use `@cds.persistence.exists` to indicate that an object should not be
2984
- created in the database because the database object already exists.
2985
- + use `@cds.persistence.skip` to indicate that an object should not be
2986
- created in the database because it is implemented in the service layer.
2987
- * The shortcut for the value list annotation has been simplified, you now can just type
2988
- `@Common.ValueList.entity:'SomeValueList'`
2989
-
2990
- Fixes
2991
- * IDE support: improve semantic code completion.
2992
- * Self-associations are now handled correctly in the ODATA generation.
2993
-
2994
- ## Version 1.0.20
2995
-
2996
- Features
2997
- * For Swagger, one parameter of an action or function can now be selected to become
2998
- the request body, by annotating it with `@Swagger.parameter: 'requestBody'`.
2999
- * The shortcut for value help annotation `@Common.ValueList:{ type:#fixed, entity:'SomeValueList' }`
3000
- is now generally available.
3001
- * For associations in ODATA that have targets outside the service, projection-like views
3002
- are now also considered as implicit redirection targets (not just projections).
3003
-
3004
- Fixes
3005
- * Type properties like `length` are now omitted when generating an ODATA property `Edm.Stream`.
3006
- * Nested annotations for ODATA are now handled correctly.
3007
- * The transformation of backlink associations for HANA CDS is now more robust against
3008
- artifact processing order.
3009
-
3010
- ## Version 1.0.19
3011
-
3012
- Changes
3013
- * Allow aliases in projections for HANA CDS (although not 100% watertight in all cases).
3014
-
3015
- Features
3016
- * Entities annotated with `@cds.autoexposure` are now automatically exposed in a service
3017
- (by means of a full projection) when they are used as association targets
3018
- within that service.
3019
-
3020
- Fixes
3021
- * The `$user` variable is now correctly expanded to `SESSION_CONTEXT('XS_APPLICATIONUSER')`,
3022
- with only one underscore.
3023
- * The `--check-model` option is now more robust against the order of artifacts in the
3024
- model.
3025
- * Enum types are now always reduced to their base type for HANA CDS.
3026
- * Options given to the compiler or one of the post-processing functions are now always
3027
- handed down together with the model.
3028
- * The query clauses `LIMIT` and `OFFSET` are now really enabled (were accidentally still
3029
- left in beta).
3030
-
3031
- ## Version 1.0.18
3032
-
3033
- Changes
3034
- * Compiler now complains if an entity exposed for ODATA has an element without a type.
3035
- * View and projection elements in CSN now always have a `value` property (possibly
3036
- with a path).
3037
-
3038
- Features
3039
- * For ODATA, now also the annotations from the Analytics vocabulary are translated.
3040
-
3041
- Fixes
3042
- * Workaround for a HANA CDS issue: When providing `LargeString` or `LargeBinary` as
3043
- explicit type for a view element, HANA CDS runs into an error during the deployment
3044
- of the generated HANA CDS (fix pending). This error can be prevented by annotating
3045
- the corresponding elements in CDX with `@cds.workaround.noExplicitTypeForHANA`.
3046
- * `not null` at a managed association is no longer added to the corresponding
3047
- unmanaged association in HANA CDS, but only to the foreign keys.
3048
- * When a redirected association is used as a view element, the select item for the
3049
- corresponding MIXIN is now correctly rendered for HANA CDS and CDL (accidentally had
3050
- an explicit association type).
3051
- * MIXINs that are explicitly added to views are now correctly generated for HANA CDS
3052
- (were accidentally duplicated).
3053
- * Do not complain about `@Core.MediaType` for key-less entities.
3054
-
3055
- ## Version 1.0.17
3056
-
3057
- Changes
3058
- * Correct license in `package.json`
3059
- * `toSwagger` takes in mind only artifacts from services
3060
-
3061
- Fixes
3062
- * Handle type `cds.UUID` correctly when generating SQL.
3063
- * Handle associations in GROUP BY and ORDER BY correctly when generating HANA CDS.
3064
- * When generating MIXINs for associations in HANA CDS views, use an alias to avoid
3065
- conflicts with association usage in the SELECT.
3066
- * Wrap bound action and function definitions in an array when generating EDMX.
3067
-
3068
- ## Version 1.0.16
3069
-
3070
- Changes
3071
- * Allow artifacts to be defined in namespace `cds.foundation`.
3072
-
3073
- Features
3074
- * Support the remaining query clauses `group by`, `having`, `order by`
3075
- (with optional `asc`/`desc` and optional `nulls first`/`nulls last`),
3076
- and `limit` (with optional `offset`).
3077
- * Support the magic variables `$now` and `$user`.
3078
-
3079
- Fixes
3080
- * Complain about artifact extensions inside context/service extensions.
3081
- * For ODATA, add a `$Partner` attribute to `edm:NavigationProperty` when
3082
- appropriate for bi-directional asociations.
3083
-
3084
- There is a [new document](doc/ErrorMessages.md) which explains some error messages
3085
- (more messages will be added in the future).
3086
-
3087
- ## Version 1.0.15
3088
-
3089
- Changes
3090
- * More checks for correct ODATA input (element names, keys, ...).
3091
-
3092
- Features
3093
- * Allow `redirected to` in `select` items of views.
3094
- * Support the `@Core.MediaType` annotation for ODATA.
3095
-
3096
- Fixes
3097
- * Correct bug in the calculation of the `_finalType`,
3098
- which could lead to an internal error within the `odata` backend.
3099
- * Properly resolve filter conditions in the `from` clause of `select`,
3100
- as we do in value expressions/conditions.
3101
- * Translate associations and filters in `FROM` correctly to HANA CDS.
3102
- * Avoid error with `undefined` when checking annotations with structs in arrays.
3103
- * Provide correct defaults for `$Nullable` in ODATA V4.
3104
-
3105
- ## Version 1.0.14
3106
-
3107
- Changes
3108
- * Preserve the `key` properties of elements selected in a view (like we do in projections).
3109
- * Improve the CSN representation for views.
3110
- Represent the `where` and `on` condition of `select`s like other conditions.
3111
- * Project name in github is now `cap/cds-compiler`.
3112
-
3113
- Features
3114
- * Support `select *` in views.
3115
- * First version of transformation into OpenAPI json with `--to-swagger` option, more about it [here](doc/toSwagger.md)
3116
-
3117
- Fixes
3118
- * Resolve the `on` condition for associations defined in the `mixin` clause of a `select`.
3119
- * Produce correct `using` directives with `--to-hana` for artifacts with `implemented in`.
3120
- * Handle mixins and expression elements in views correctly with `--to-hana`.
3121
- * Improve annotation assigment checks with `--check-model`.
3122
- * Check that type declarations for ODATA do not contain anonymous struct types.
3123
-
3124
- ## Version 1.0.13
3125
-
3126
- Changes
3127
- * Rename project from `@sap/cdsv` to `@sap/cds-compiler`. Note that you will likely
3128
- __need to adapt your `package.json`__ because of that.
3129
- * Check that no sub-`select`s are used in expression and conditions
3130
- (currently: path filters and `on`-conditions of unmanaged associations);
3131
- in views, they are only allowed with option `--beta-mode`.
3132
-
3133
- Features
3134
- * Support the `mixin` clause in `select`s (to add unmanaged associations to a `view`).
3135
- * Support extending `enum` types (and elements where the `enum` type has been
3136
- defined in-place), and annotating existing enum symbols.
3137
-
3138
- Fixes
3139
- * Recognize function calls without parentheses (like `current_data`)
3140
- in all expressions and conditions (not just in `select` items and the `where` condition).
3141
- * Make layer computation respect all `using from`-dependencies.
3142
- * Make the compiler more robust regarding incomplete/unexpected sources.
3143
- * During annotation propagation in the ODATA preprocessing, handle overwriting of
3144
- annotations correctly.
3145
- * Fix foreign key checks with `--toHana`.
3146
- * The key generated for analytical views now has the name `ID__`.
3147
-
3148
- ## Version 1.0.12
3149
-
3150
- Changes
3151
- * The `--odata-and-hana-output` no longer contains the plain compiled CSN but the result
3152
- of the ODATA-specific preprocessing step. Dito for the API function `cdsv.toOdataOutput`.
3153
-
3154
- Features
3155
- * For analytical views (those annotated with `@Aggregation.ApplySupported.PropertyRestrictions`),
3156
- transform keys appropriately.
3157
-
3158
- Fixes
3159
- * Views are now handled like projections by `--toHana` (regarding struct flattening and
3160
- transformation of association-typed elements into mixins).
3161
-
3162
- ## Version 1.0.11
3163
-
3164
- Changes
3165
- * Check that user code does not define artifacts in namespace `cds`.
3166
- * It is an error to have two assignment for the same annotation on the same artifact/member
3167
- in the same file/layer (see Features below),
3168
- even if one is via `extend` and the other via `annotate`
3169
- (both still overwrite assignments provided with a definition).
3170
-
3171
- Features
3172
- * Allow arbitrary expressions and comparison operators in ON-condition of unmanaged associations
3173
- (note: in EDMX, SQL functions that are called without parentheses like `CURRENT_DATE` are not yet supported)
3174
- * Annotation assignments are now _layer_-aware:
3175
- an annotation assignment in file _A_ overwrites a annotation assignment in file _B_
3176
- if file _A_ directly or indirectly depends (via `using…from`) on file _B_, but not the other way round.
3177
- * New syntax variant `using from '<module>'` (without an artifact name)
3178
- to just add `<module>` to the model (and introduce a dependency between the two files).
3179
-
3180
- Fixes
3181
- * Reintroduced attribute `nullable` for function import parameters in edmx generation for OData V2
3182
- * Better handling of paths for `--to-hana` in views and projections by using aliases.
3183
- * SQL functions without parentheses (like `CURRENT_DATE` etc.) now correctly rendered with `--to-hana`.
3184
- * TNT only: Handle `@odata.navigable` like `@cds.odata.navigable`
3185
-
3186
- ## Version 1.0.10
3187
-
3188
- Changes
3189
- * When using the command line tool to generate edmx files, the file names have changed:
3190
- + the file name now contains the exact service name (dots are preserved and no longer replaced by underscore)
3191
- + suffix `default` has been removed
3192
- * Removed obsolete command line options `--old-cdl` and `--new-cdl`
3193
-
3194
- Features
3195
- * Backlink associations now also work for unmanaged associations
3196
- * Support for `WHERE` condition in views
3197
-
3198
- Fixes
3199
- * Views are now rendered as EntitySet/EntityType in edmx
3200
- * Abstract entities do not appear as EntitySet/EntityType in the generated edmx
3201
- * `--to-hana` now correctly handles type casts in view definitions
3202
- * In the generated edmx for OData V2, inside a `ReferentialConstraint`, the elements `Dependent` and `Principal` now have the correct order
3203
- * Remove attribute `nullable` for function import parameters in edmx generation for OData V2
3204
-
3205
- ## Version 1.0.9
3206
-
3207
- Changes
3208
- * With `--to-hana` the `$self` identifier is replaced by the absolute name of the
3209
- current artifact, when it is part of a path.
3210
- * TNT only: Remove obsolete skip options, add new skip options for remaining special cases.
3211
- * Check that non-abstract entities must have a key for ODATA.
3212
-
3213
- Features
3214
- * (experimental) Introduce shortcut for the value help annotation: `@Common.ValueList:{ type:#fixed, entity:'DeliveryStatus' }`
3215
-
3216
- Fixes
3217
- * Also consider annotations of bound actions in the edmx generation.
3218
- * Detect illegal cycles with managed associations.
3219
- * Remove `key` property from a managed association which is transformed into an unmanaged one.
3220
- * Do not swallow `key` in select items of views.
3221
- * Handle backlink associations correctly in projections and structs.
3222
- * For HANA and ODATA, correctly flatten paths starting within structs.
3223
- * With `--export-annotations`, also export view annotations.
3224
- * For nullable keys, let corresponding association foreign keys be nullable, too.
3225
- * Handle implicit redirections within structs correctly
3226
- * Render included (inherited) types and projections with `implemented in` correctly with `--cdl-output`
3227
-
3228
- ## Version 1.0.8
3229
-
3230
- Changes
3231
- * The `namespace` declaration now constructs a `.`-connected namespace,
3232
- use (final) `::` to construct a `::`-connected namespace.
3233
- The `nameprefix` declaration is considered obsolete (and leads to a warning).
3234
- * Non-context/service artifacts cannot be named like a namespace.
3235
- * New implementation of `--to-hana`, `--cdl-output` and `--odata-and-hana-output`
3236
- produces one `hdbcds` file per top-level artifact (instead of trying to emulate
3237
- the input source structure). Old implementation can still be used by specifying
3238
- `--old-cdl` (will be __removed in next version__).
3239
-
3240
- Features
3241
- * Allow path when defining new artifacts.
3242
- You can refer to a namespace in a `using` declaration`.
3243
- * Support simple single-source views, which can have expressions in select items
3244
- * With option `--beta-mode`, support multi-source views without `union` and `join` -
3245
- work in progress.
3246
- * Support more expressions: Path filters, `case`, `is null`, `not`, parentheses,
3247
- unary `-`, quantifiers (`any`, `all`, ...), `between`, `like`, SQL functions.
3248
- * Allow CDL files without definitions or extensions.
3249
- * Initial support for semantic code completion.
3250
- * Annotation assignments can be written at more places (consistently).
3251
- * Support structured elements in entities (flattened for ODATA and HANA CDS).
3252
- * Support backlink associations for `--to-hana` and `--odata-and-hana-output`
3253
-
3254
- Fixes
3255
- * All redefinitions in a source now lead to an error message.
3256
- * Always do `--to-hana` checks when necessary.
3257
- * With the new implementation, `--to-hana`, `--cdl-output` and `--odata-and-hana-output`
3258
- now handle namespaces, `using` aliases, associations in projections,
3259
- enums in entities, default values, strings without length, structured types,
3260
- managed associations and quoted identifiers correctly.
3261
- * Keys can now have the attribute `null` (unless generating for HANA, which does not
3262
- support that)
3263
- * Correctly determine multiplicity for backlink associations.
3264
-
3265
- ## Version 1.0.7
3266
-
3267
- Features
3268
- * Support for analytical annotations in ODATA V2
3269
- * Deprecated`Common.FilterExpressionRestrictions` in favor of `Capabilities.FilterRestrictions.FilterExpressionRestrictions`
3270
- * `--to-hana`: Transform managed associations to unmanaged associations (with foreign key fields generated with `_` and
3271
- appropriate ON-conditions). Please note that this __results in different field names on generated HANA tables__.
3272
-
3273
- Fixes
3274
- * Handle annotations `@Analytics.Measures` and `@Semantics.*` annotations correctly
3275
- * Check that services and contexts are not illegally nested
3276
-
3277
- ## Version 1.0.6
3278
-
3279
- Features
3280
- * Support for the `from` clause of the `using` declaration, see [the README file](README.md#using-from).
3281
-
3282
- Fixes
3283
- * EDMX generation for annotations: if an annotation value is an expression that is not a CDS path,
3284
- dots are no longer replaced by slashes
3285
- * `--to-hana`: Handle the target of associations inside views with mixins correctly, when `redirected to` is used
3286
- * Handle enums and structured types correctly in ODATA transformation
3287
- * TNT only: Apply implicit redirection also to CSN output of ODATA translation
3288
- * TNT only: Fix options `skipGeneratedFKsWithout_` and `skipAssociationSetsWithTo`
3289
-
3290
- ## Version 1.0.5
3291
-
3292
- Fixes
3293
- * Added new dependency on npm module "resolver" to npm-shrinkwrap.json
3294
-
3295
- ## Version 1.0.4
3296
-
3297
- Features
3298
- * Support for function `SESSION_CONTEXT` in the on ON-condition of unmanaged associations
3299
- * The keyword `annotate` can be used to annotate actions and functions
3300
- * Annotation translation mechanism works for annotations at actions/functions and their parameters
3301
- * Error messages that refer to csn files as input have position information
3302
-
3303
- ## Version 1.0.3
3304
-
3305
- Features
3306
- * Automatic redirection of associations: When a service contains a projection on an entity with an association
3307
- with a target that is not part of the service, the association is now automatically redirected to a corresponding
3308
- entity/projection in the service, if this new target can be determined uniquely (via following projections or includes)
3309
- * `--to-hana`: now correctly handles elements of type `Composition`, they are translated to `Association`
3310
- * Support for annotation `@odata.etag` for enabling optimistic concurrency handling in the (v2) OData provider
3311
- * Support for managed associations as foreign keys of managed associations
3312
-
3313
- Fixes
3314
- * Generated foreign key elements are now correctly marked as `key` if their association is a key element
3315
-
3316
- Other
3317
- * Removed the message "compiled successfully"
3318
- * A `service` can now be extended by `extend service` instead of `extend context`
3319
- (the latter still works, but __might lead to a compiler warning in the future__)
3320
-
3321
- ## Version 1.0.3-RC3
3322
-
3323
- Fixes
3324
- * Disable EDMX schema aliases again (apparently, not all consumers can properly digest them)
3325
- * TNT-specific `@extends`: Multiple services exposing the same inherited context with different redirections
3326
-
3327
- ## Version 1.0.3-RC2
3328
-
3329
- Features
3330
- * Support for `virtual` elements
3331
- * More semantic checks for actions, functions and managed associations
3332
- * Generation of CSDL JSON (work in progress)
3333
-
3334
- Fixes
3335
- * CDS annotations with "inline CSDL JSON" now also support `$LabeledElement`
3336
- * Version number now consistent with suffix like `-RC2` in all places
3337
- * EDMX schema aliases now use last part of service name (no dots allowed)
3338
-
3339
- ## Version 1.0.3-RC1
3340
-
3341
- Features
3342
- * Command line parameter `--new-odata' is deprecated and has no effect any more (it is ignored).
3343
- Providing this parameter __will lead to an error in future versions__, so please don't use it anymore
3344
- * New command line parameter `--odata-preprocessing`: For internal testing only (displays intermediate CSN).
3345
- * CSN now contains a `version` attribute (no strict semantic versioning yet, though)
3346
- * Allow "inline CSDL JSON" attributes to be transported through CSN to EDM annotations (still limited to a few use cases)
3347
- * Allow managed associations with `--to-hana` (work in progress)
3348
- * More semantic checks for actions and functions
3349
- * Support for multiple services in one model. This results in changes to the return value of `cdsv.toOdataOutput` resp. `toTntSpecificOutput`.
3350
- EDMX results (metadata and annotations) are now provided per-service in a dictionary `services`. For backward compatibility, the old return
3351
- value attributes are additionally provided if there is only one service. This __will be abandoned in future versions__.
3352
- * Support for entities with parameters in EDMX
3353
-
3354
- Fixes
3355
- * Fiori annotation translation for OData v2: Correctly set xmlns attribute for EntitySet annotations
3356
- * EDMX generation for actions/functions: Correctly set attribute `EntitySet` in `FunctionImport` or `ActionImport` if the return type is entity or array of entity
3357
- * TNT-specific: Ignore annotation "CoreModel" in the translation to EDMX
3358
- * Various fixes for ReferentialConstraints in EDMX
3359
-
3360
- ## Version 1.0.2
3361
-
3362
- Features
3363
- * `implemented in <id>`: Allow wider range of identifier; using `calcview` as identifier is deprecated and __will lead to an error in one of the next versions__,
3364
- please
3365
- change to another identifier
3366
- * Allow literals in ON-condition of unmanaged associations
3367
- * Name resolution in association definition
3368
-
3369
- Fixes
3370
- * Alerts are now sent to `stderr`
3371
- * Correct rendering of type `Time` in EDMX v2
3372
-
3373
- ## Version 1.0.1-MS1
3374
-
3375
- Features
3376
- * New implementation of name resolution (according to [spec](doc/NameResolution.md)
3377
- * Support for bound and unbound actions and functions
3378
- * More semantic checks
3379
- * Support for `implemented in` (HANA)
3380
- * EDMX generation now also for ODATA V4
3381
-
3382
- Fixes
3383
- * `skip` options of TNT-flavor now working correctly (TNT only)
3384
- * Fixed bug affecting elements called `items` (TNT only)
3385
- * Correctly handle `TypeDefinition` in annotations EDMX
3386
-
3387
- ## Version 1.0.0-MS9
3388
-
3389
- Features
3390
- * Support for bound functions
3391
- * EDMX annotations: Support pseudo-nested annotations, multiple enum values
3392
- * New option `--export-annos-ui5-style` for localized annotations
3393
-
3394
- Fixes
3395
- * Various fixes for annotation assignment checks
3396
- * HANA CDS output now with source files like original (fixes issues with `using`)
3397
- * Fixed multiplicity for EDMX V2
3398
- * EDMX output: Reject ON-conditions that cannot be expressed in EDMX, reject structured elements, allow service-less input
3399
- * EDMX annotation generation: More checks, better error messages
3400
- * Compiler: Better handling of errors on top of errors
3401
-
3402
- ## Version 1.0.0-MS8
3403
-
3404
- Features
3405
- * First primitive type checks with '--check-model'
3406
-
3407
- Fixes
3408
- * TNT-specific: It is in fact `@com.sap.gtt.core.CoreModel.Indexable` that should not be propagated
3409
-
3410
- ## Version 1.0.0-MS7
3411
-
3412
- Fixes
3413
- * Render view target paths in HANA CDS output like in original source
3414
- * Various fixes for EDMX generation (XML namespace headers, `EntitySet`, `EntityType`, multiplicity, ...)
3415
- * Structured elements in projections not yet supported for `--to-hana`
3416
-
3417
- Features
3418
- * TNT-specific: Do not propagate `@CoreModel.Indexable`
3419
- * New primitive datatype `UUID`
3420
- * New option `--check-model` (work in progress, starting with annotations)
3421
- * Option `--odata-and-hana-output` now also produces combined V4 EDMX file
3422
-
3423
- ## Version 1.0.0-MS6
3424
-
3425
- Fixes
3426
- * Really do not use plural form of entity names anywhere in ODATA
3427
- * Properly complain about (most) incomplete/unsupported features
3428
-
3429
- ## Version 1.0.0-MS5
3430
-
3431
- Fixes
3432
- * Use all `using` declarations for HANA CDS
3433
- * Do not use plural form of entity names for EntitySet in ODATA
3434
-
3435
- ## Version 1.0.0-MS4
3436
-
3437
- Features
3438
- * Allow multiple `ReferentialConstraint` nodes for ODATA (`--new-odata` only)
3439
- * Support `abstract`, `BaseType`, `TypeDefinition` for ODATA (`--new-odata` only)
3440
- * Digest association `ON`-conditions properly
3441
- * Support default values for entity elements
3442
- * Allow projections with actions
3443
- * Support `implemented in` for entities
3444
- * Produce combined EDMX file, too (containing both metadata and annotations)
3445
- * Support `redirected to` for associations in projections
3446
- * Allow CSN files as compiler input
3447
-
3448
- Fixes
3449
- * Preserve original order for elements and actions in EDMX
3450
- * Handle association cardinality properly for HANA CDS output
3451
- * New implementation of EDMX annotation processor
3452
- * Handle HANA-specific primitive types correctly (`LocalDate`, `UTCDateTime`, ...)
3453
-
3454
- ## Version 1.0.0-MS3
3455
-
3456
- Delivery
3457
- * Now available as scoped module `@sap/cdsv`
3458
-
3459
- Features
3460
- * New command line option `--odata-and-hana-output <dir>` to produce EDMX, HANA CDS and CSN output
3461
- * New command line option `--new-odata` to select the new ODATA backend implementation
3462
- * New command line option `--odatav4` to produce EDMX metadata with ODADA V4
3463
-
3464
- ## Version 1.0.0-MS2
3465
-
3466
- Features:
3467
- * Allow property files as compiler input (for i18n)
3468
- * Support managed associations with explicit foreign keys (for ODATA)
3469
-
3470
- Fixes:
3471
- * Improved automatic re-targeting of associations based on exposure
3472
- * Correct EDMX annotations for `Communication.Contact`
3473
- * Complete EDMX primitive type support
3474
- * Handle `one/many` cardinality correctly in HANA CDS output
3475
- * Provide complete type properties for projection elements
3476
- * Add `indexNo` also for action parameters
3477
- * Handle `self`-associations correctly in EDMX
3478
-
3479
- ## Version 1.0.0-MS1
3480
-
3481
- Features:
3482
- * Allow multiple includes for entities
3483
-
3484
- Miscellaneous:
3485
- * Improvements for delivery
3486
- * Cleanup of TNT-specific and not-yet-really-supported features
3487
-
3488
- <!-- markdownlint-disable -->
3489
-
3490
- ## Version 0.0.5: Make cdsv usable for early adopters like TNT
3491
-
3492
- Make TNT usage case work:
3493
- * Produce special output for TNT: `annotations.xml`, `metadata.xml` and `csn.json`.
3494
- * Add full TNT model, and smaller TNT examples as tests
3495
- → produce same output as produced by prototype.
3496
- * Adopt CSN format to a format expected by TNT (with option `--tnt-flavor`)
3497
-
3498
- Extended functionality:
3499
- * Support property files for internationalization (export and import).
3500
- * Support generation of CDL (CDS language source) from CSN,
3501
- with or without transformations to make it HANA-CDS compatible.
3502
- * Started support to compile CSN files together with CDL files.
3503
-
3504
- General compiler things:
3505
- * Introduce options for (temporary) language variants: `--tnt-flavor`, `--hana-flavor`.
3506
- * Support `extend` and `annotate`, and includes.
3507
- * Support projections.
3508
- * Support actions with their parameters.
3509
- * Support annotation variants and all syntax variants for annotation assignments.
3510
- Support propagation of annotation assignments.
3511
- * Support all type expressions with potential errors.
3512
- * Parse DCL constructs (no further processing yet).
3513
-
3514
- Miscellaneous:
3515
- * Provide `Promise`-less API.
3516
- * Start with some (internal) documentation.
3517
- * Much more tests.
3518
- * Remove RND-inspired grammar.
3519
- * Miscellaneous fixes and improvements.
3520
-
3521
- ## Version 0.0.4: Adapt ANTLR4 error strategy, use all HANA-CDS tests
3522
-
3523
- Adapt ANTLR4 error strategy and related things:
3524
- * Allow _unreserved keywords_ as identifier without listing them in error messages if an identifier is expected (but do list those which are to be matched as keywords!).
3525
- * Match even _reserved keywords_ as identifier (with message in the future?) if there is no alternative.
3526
- * Avoid excessive use of ANTLR's adaptive prediction, as it would slow down the parser
3527
- (done in grammar, there is a test which ensure that it stays that way).
3528
- * Proper `xmake` configuration to generate lexer and parser.
3529
- * PEG.js-based parser is discontinued.
3530
-
3531
- Use all HANA-CDS standalone tests:
3532
- * Cover the complete HANA-CDS language.
3533
- The main grammar use wildcards just for the `SERIES` and `TECHNICAL CONFIGURATION` section of entity definitions.
3534
- (There is currently a second, much slower, grammar without wildcards, which is a one-to-one transformation of the RND grammar for HANA-CDS.)
3535
- * Tests show completeness of parsing (except the wildcard use, see above),
3536
- CSN-output equivalence (on specified parts) for 80% of the test cases.
3537
-
3538
- ## Version 0.0.3: ANTLR4-based Parser and Lexer
3539
-
3540
- PEG.js-based parser still used by default, because it does not need Java to build.
3541
- Currently, we have a small ANTLR grammar in "final style",
3542
- and a full ANTLR grammar in "HANA-CDS style".
3543
-
3544
- ## Version 0.0.2: Define and Resolve – Augmented CSN
3545
-
3546
- Functionality:
3547
-
3548
- * Multi-file support with `namespace`/`nameprefix` and `using` declarations
3549
- * Context, entity, type, annotation, and element definitions
3550
- * Types: builtin (also with parameters), derived, structure types
3551
- * Unchecked annotation assignments (with absolute name calculation according to spec)
3552
- * All values: null, bool, number, string and other quoted literals (`x`, `date`, `time`, `timestamp`),
3553
- enum symbols, structure (top-level are flattened for annotation assignments) and arrays
3554
- * "Define": merge source ASTs, set `name.absolute` and `_parent` links,
3555
- * "Resolve" for main artifacts: set `type.absolute` and `_artifact` links
3556
- * Dependency cycle detection with exact error positioning
3557
- * Compact JSON: for "official" CSN and tests
3558
-
3559
- Environment:
3560
-
3561
- * Integration with xmake
3562
- * Checked accoding to our eslint rules
3563
- * Full tests: invocation, negative, positive
3564
-
3565
-
3566
- ## Version 0.0.1: Package Setup & Initial Grammar
3567
-
3568
- Done:
3569
- * `Promise` orchestration for asynchronous file processing,
3570
- * avoid checking-in the generated parser,
3571
- * proper whitespace handling in the grammar,
3572
- * source location in AST, location includes filename
3573
- * easy-to-use standard AST creation
3574
-
3575
- Our **`Promise` orchestration** must support the intended error policy:
3576
- * We do not mix error categories, e.g.,
3577
- we do not output syntax/semantic errors in CDS files
3578
- if the command invocation itself is wrong.
3579
- * Inside one error category, we (intend to) list as many errors as possible,
3580
- e.g. when two given files do not exist and another one is provided repeatedly,
3581
- we report all these 3 errors at once.
3582
-
3583
- We **do not include the generated parser**:
3584
- * As we have no `npm publish` phase at the moment,
3585
- we list the parser generator `pegjs` in `package.json`→`dependencies` and
3586
- run the parser generation in `package.json`→`scripts/postinstall`.
3587
- * If the product is published,
3588
- we list the parser generator `pegjs` in `package.json`→`devDependencies` and
3589
- run the parser generation in `package.json`→`scripts/prepublish`.
3590
-
3591
- Parsers generated by [PEG.js](http://pegjs.org) are without tokenizer –
3592
- this looks cool at first, but leads to some problems:
3593
-
3594
- * Still open: Error reporting is less then ideal –
3595
- if the intended top-level context definition start with `contxt`, you just see one char after `but`:
3596
- Expected "context", … but "c" found.
3597
- See the grammar for a potential future hack to cover at least the most common occurrences.
3598
- * We always need to think about correct whitespace handling.
3599
- See the initial comment in the grammar for details and common patterns. (_Solved_).
3600
- * In rules ending with optional whitespaces,
3601
- we need to adjust the end location – it should not include the final whitespaces!
3602
- See the initial comment in the grammar for details. (_Solved_).
3603
-
3604
- As an **alternative**, we could look at Antlr3.JavaScript, Antlr4.JavaScript, or RND.JavaScript.