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 aspect #420

Closed
wants to merge 1 commit into from
Closed
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
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 {
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
1 change: 1 addition & 0 deletions srv/admin-service.cds
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ service AdminService @(requires: 'admin') {
entity Authors as projection on my.Authors;
entity Orders as select from my.Orders;
extend my.Genres with Hierarchy;
@cds.odata.valuelist: false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it also works without this annotation now, should I still leave it there to show that we don't use a standard ValueList provided by CodeList or should I remove it?

Copy link
Contributor

Choose a reason for hiding this comment

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

If it is not required to be disabled I don't think we need to remove it. Then changes in #419 would be sufficient.

entity GenreHierarchy as projection on my.Genres;

@cds.persistence.skip
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