@sap/cds-compiler 2.15.4 → 3.0.0

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