Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore CodeList #419

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ are defined for local development:

### Testing in hybrid mode

You can test the `GenreHierarchyTest` on H2 using the profile `default` as well as on HANA using the profile `hybrid`
You can test the `GenreHierarchyTest` on H2 using the profile `default` as well as on HANA using the profile `cloud`

```
cds bind --exec -- mvn clean install -Dspring.profiles.active=hybrid
cds bind --exec -- mvn clean install -Dspring.profiles.active=cloud
```

## Using VS Code
Expand Down
5 changes: 2 additions & 3 deletions db/books.cds
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace my.bookshop;

using {
Currency,
sap,
managed,
cuid
} from '@sap/cds/common';
Expand Down Expand Up @@ -47,10 +48,8 @@ annotate Authors with
/**
* Hierarchically organized Code List for Genres
*/
entity Genres {
entity Genres : sap.common.CodeList {
Copy link
Contributor

@beckermarc beckermarc Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OlenaTi @etimr: What harm did the value help make, that's implicitly included in CodeList? If it did any harm I think the better approach would be to remove the annotation on GenreHierarchy by annotating it with @cds.odata.valuelist: false

Copy link
Contributor

@etimr etimr Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@beckermarc you are right, it also works without @cds.odata.valuelist: false now: #420

key ID : Integer;
name : localized String(255);
descr : localized String(1000);
parent : Association to Genres;
children : Composition of many Genres
on children.parent = $self;
Expand Down
3 changes: 0 additions & 3 deletions srv/cat-service.cds
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ service CatalogService @(requires: 'any') {
@readonly
entity Authors as projection on my.Authors;

@readonly
entity Genres as projection on my.Genres;

@readonly
entity Reviews as projection on my.Reviews;

Expand Down
3 changes: 0 additions & 3 deletions srv/review-service.cds
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ service ReviewService {
@readonly
entity Authors as projection on my.Authors;

@readonly
entity Genres as projection on my.Genres;

// access control restrictions
annotate Reviews with @restrict: [
{
Expand Down
Loading