Files
cloud-cap-samples/fiori/db/hana/index.cds
2022-08-29 16:38:15 +02:00

16 lines
518 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// Add Author.age and .lifetime with a DB-specific function
//
using { AdminService, sap.common } from '@capire/bookshop';
extend projection AdminService.Authors with {
YEARS_BETWEEN(dateOfBirth, dateOfDeath) as age: Integer,
YEAR(dateOfBirth) || ' ' || YEAR(dateOfDeath) as lifetime : String
}
// Workaround: include Countries table because csv files point to it
// TODO fix by ignoring hdbtabledata generation for unused entities
annotate common.Countries with @cds.persistence.skip : false;