Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add Role.roleName to Object Page: dominique aprch
  • Loading branch information
Sergio Congia authored and Sergio Congia committed May 1, 2020
1 parent cfa0e09 commit 994cb18
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions srv/admin-service.cds
Expand Up @@ -11,20 +11,20 @@ service AdminService @(path:'/admin') {
// qmacro approach from https://blogs.sap.com/2019/08/21/computed-field-example-in-cap/
// Results in error "SQLITE_ERROR: no such column: roleName"
// Does not conflict with auto-exposure, but requires logic in Srv to insert as
entity Person_Role as select from db.Person_Role{
*,
null as roleName : db.RoleName
};
// entity Person_Role as select from db.Person_Role{
// *,
// null as roleName : db.RoleName
// };

// Pierre Dominique approach in "Answers section of" https://blogs.sap.com/2019/08/21/computed-field-example-in-cap/
// Note: Conflicts with auto-exposed from @odata.draft.enabled
//
// entity Person_Role as select from db.Person_Role, db.Roles {
// Person_Role.ID,
// Person_Role.parent,
// Person_Role.role,
// Roles.roleName
// } where Person_Role.ID = Roles.ID;
entity Person_Role as select from db.Person_Role, db.Roles {
Person_Role.ID,
Person_Role.parent,
Person_Role.role,
Roles.roleName
} where Person_Role.ID = Roles.ID;

entity Roles as projection on db.Roles;

Expand Down

0 comments on commit 994cb18

Please sign in to comment.