Augment `AdminService.Author` by 2 fields `age` and `lifetime` whose values are computed by SQLite and HANA-specific functions. Don't do this in bookshop directly, to keep it simple. Instead, use the fiori module, which also allows to integrate the fields in the UI. Co-authored-by: Daniel <daniel.hutzel@sap.com>
11 lines
329 B
Plaintext
11 lines
329 B
Plaintext
//
|
||
// Add Author.age and .lifetime with a DB-specific function
|
||
//
|
||
|
||
using { AdminService } from '..';
|
||
|
||
extend projection AdminService.Authors with {
|
||
strftime('%Y',dateOfDeath)-strftime('%Y',dateOfBirth) as age: Integer,
|
||
strftime('%Y',dateOfBirth) || ' – ' || strftime('%Y',dateOfDeath) as lifetime : String
|
||
}
|