-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
107 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,69 @@ | ||
namespace company.project.db; | ||
|
||
using { | ||
sap, | ||
cuid | ||
sap, | ||
cuid | ||
} from '@sap/cds/common'; | ||
|
||
using { | ||
company.project.common.SampleAspect1, | ||
company.project.common.SampleAspect2, | ||
company.project.common.SampleCommonEntity, | ||
company.project.common.SampleAssociationType, | ||
company.project.common.SampleArrayedType, | ||
company.project.common.SampleCodeListType, | ||
company.project.common.SampleAspect1, | ||
company.project.common.SampleAspect2, | ||
company.project.common.SampleCommonEntity, | ||
company.project.common.SampleAssociationType, | ||
company.project.common.SampleArrayedType, | ||
company.project.common.SampleCodeListType, | ||
} from '../db/common'; | ||
|
||
|
||
entity SampleEntity : cuid, SampleAspect1 { | ||
|
||
//======================================================================// | ||
// Built-in Types (https://cap.cloud.sap/docs/cds/types#built-in-types) // | ||
//======================================================================// | ||
//======================================================================// | ||
// Built-in Types (https://cap.cloud.sap/docs/cds/types#built-in-types) // | ||
//======================================================================// | ||
|
||
sampleUUID : UUID; // an opaque string | example: 'be071623-8699-4106-...' | sql: NVARCHAR(36) | ||
sampleUUID : UUID; // an opaque string | example: 'be071623-8699-4106-...' | sql: NVARCHAR(36) | ||
|
||
sampleBoolean : Boolean; // a boolean | example: true or false | sql: BOOLEAN | ||
sampleBoolean : Boolean; // a boolean | example: true or false | sql: BOOLEAN | ||
|
||
sampleUInt8 : UInt8; // an unsigned integer number stored with 8 bit | example: 0 to 255 | sql: TINYINT | ||
sampleUInt8 : UInt8; // an unsigned integer number stored with 8 bit | example: 0 to 255 | sql: TINYINT | ||
|
||
sampleInt16 : Int16; // an integer number stored with 16 bit | example: -32768 to 32767 | sql: SMALLINT | ||
sampleInt16 : Int16; // an integer number stored with 16 bit | example: -32768 to 32767 | sql: SMALLINT | ||
|
||
sampleInt32 : Int32; // an integer number stored with 32 bit | example: -2,147,483,648 to 2,147,483,647 | sql: INTEGER | ||
sampleInt32 : Int32; // an integer number stored with 32 bit | example: -2,147,483,648 to 2,147,483,647 | sql: INTEGER | ||
|
||
sampleInteger : Integer; // same as previous | ||
sampleInteger : Integer; // same as previous | ||
|
||
sampleInt64 : Int64; // an integer number stored with 64 bit | example: -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | sql: BIGINT | ||
sampleInt64 : Int64; // an integer number stored with 64 bit | example: -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | sql: BIGINT | ||
|
||
sampleInteger64 : Integer64; // same as previous | ||
sampleInteger64 : Integer64; // same as previous | ||
|
||
sampleDecimal : Decimal(10, 2); // a decimal number, usage -> 'Decimal(precision, scale)' | example: 15.2 | sql: DECIMAL | ||
sampleDecimal : Decimal(10, 2); // a decimal number, usage -> 'Decimal(precision, scale)' | example: 15.2 | sql: DECIMAL | ||
|
||
sampleDouble : Double; // a double number | example: DOUBLE 2.2250738585072014E-308 to 1.79769313486231570e+308d | sql: DOUBLE | ||
sampleDouble : Double; // a double number | example: DOUBLE 2.2250738585072014E-308 to 1.79769313486231570e+308d | sql: DOUBLE | ||
|
||
sampleDate : Date; // a date | example: '2021-06-27' | sql: DATE | ||
sampleDate : Date; // a date | example: '2021-06-27' | sql: DATE | ||
|
||
sampleTime : Time; // a time | example: '07:59:59' | sql: TIME | ||
sampleTime : Time; // a time | example: '07:59:59' | sql: TIME | ||
|
||
sampleDateTime : DateTime; // a Timestamp with second precision | example: '2021-06-27T14:52:23Z' | sql: TIMESTAMP | ||
sampleDateTime : DateTime; // a Timestamp with second precision | example: '2021-06-27T14:52:23Z' | sql: TIMESTAMP | ||
|
||
sampleTimestamp : Timestamp; // a Timestamp with µs precision | example: '2021-06-27T14:52:23.123Z' | sql: TIMESTAMP | ||
sampleTimestamp : Timestamp; // a Timestamp with µs precision | example: '2021-06-27T14:52:23.123Z' | sql: TIMESTAMP | ||
|
||
sampleString : String; // a String, usage -> 'String(length)' or 'String' for default length of 5000 (HANA) or 255 (Others) | example: 'hello world' | sql: NVARCHAR | ||
sampleString : String; // a String, usage -> 'String(length)' or 'String' for default length of 5000 (HANA) or 255 (Others) | example: 'hello world' | sql: NVARCHAR | ||
|
||
sampleBinary : Binary; // a String used to store binary data, usage | example: '0001 1100 1011 0101...' | sql: VARBINARY | ||
sampleBinary : Binary; // a String used to store binary data, usage | example: '0001 1100 1011 0101...' | sql: VARBINARY | ||
|
||
sampleLargeBinary : LargeBinary; // a String used to store BLOBs | example: '0001 1100 1011 0101...' | sql: BLOB | ||
sampleLargeBinary : LargeBinary; // a String used to store BLOBs | example: '0001 1100 1011 0101...' | sql: BLOB | ||
|
||
sampleLargeString : LargeString; // a Large String | example: 'Lorem Ipsum...' | sql: NCLOB | ||
sampleLargeString : LargeString; // a Large String | example: 'Lorem Ipsum...' | sql: NCLOB | ||
|
||
//=====================================================// | ||
// My own defined entities, aspects, types, code lists // | ||
//=====================================================// | ||
//=====================================================// | ||
// My own defined entities, aspects, types, code lists // | ||
//=====================================================// | ||
|
||
sampleCommonEntity : Association to one SampleCommonEntity; | ||
SampleAspect2 : Composition of one SampleAspect2; | ||
sampleAssociationType : SampleAssociationType; | ||
sampleArrayedType : SampleArrayedType; | ||
sampleCodeList : SampleCodeListType; | ||
sampleCommonEntity : Association to one SampleCommonEntity; | ||
SampleAspect2 : Composition of one SampleAspect2; | ||
sampleAssociationType : SampleAssociationType; | ||
sampleArrayedType : SampleArrayedType; | ||
sampleCodeList : SampleCodeListType; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
using {company.project.service.SampleService} from './sample-service'; | ||
|
||
annotate SampleService.SampleView with { | ||
sampleBinary @readonly; | ||
sampleLargeBinary @readonly; | ||
sampleLargeString @readonly; | ||
sampleBinary @readonly; | ||
sampleLargeBinary @readonly; | ||
sampleLargeString @readonly; | ||
}; | ||
|
||
annotate SampleService.SampleView with @Capabilities : { | ||
InsertRestrictions.Insertable : true, | ||
UpdateRestrictions.Updatable : true, | ||
DeleteRestrictions.Deletable : false | ||
}; | ||
annotate SampleService.SampleView with @Capabilities: { | ||
InsertRestrictions.Insertable: true, | ||
UpdateRestrictions.Updatable : true, | ||
DeleteRestrictions.Deletable : false | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters