Skip to content
On this page

Common Annotations

Find here a reference and glossary of common annotations intrinsically supported by the CDS compiler and runtimes.

Learn more about the syntax of annotations.

General Purpose

AnnotationDescriptionAlternatives
@titleCommon.Label
@descriptionCore.Description

Access Control

AnnotationDescription
@readonlysee Input Validation
@insertonlysee Generic Handlers
@restrictsee Authorization
@requiressee Authorization

Input Validation

AnnotationDescription
@readonly see Input Validation
@mandatorysee Input Validation
@assert.uniquesee Input Validation
@assert.integritysee Input Validation
@assert.targetsee Input Validation
@assert.formatsee Input Validation
@assert.rangesee Input Validation
@assert.notNullsee Input Validation

Services / APIs

AnnotationDescription
@pathsee Services
@implsee Reuse & Compose
@odata.etagsee Providing Services
@cds.autoexposesee Providing Services
@cds.api.ignoresee OData
@cds.query.limitsee Providing Services
@cds.localizedsee Localized Data
@cds.valid.from/tosee Temporal Data
@cds.searchsee Search Capabilities

Persistence

AnnotationDescription
@cds.persistence.existstells compile.to.sql this is created otherwise
@cds.persistence.tabletells compile.to.sql to create a table, not a view
@cds.persistence.skiptells the compiler, this entity shall not exist in database at all
@cds.persistence.mockfalse excludes this entity from automatic mocking
@cds.on.insertsee Providing Services
@cds.on.updatesee Providing Services

OData

[Learn more about OData Annotations in CDS.][OData Annotations]

Shortcuts:

AnnotationDescription
@ValueList.entitysee Domain Modeling
@odata.Typesee OData
@odata.MaxLengthsee OData
@odata.Precisionsee OData
@odata.Scalesee OData
@odata.singletonsee OData

Intrinsically supported OData Annotations:

AnnotationDescription
@Core.Computedsee Providing Services
@Core.Immutablesee Providing Services
@Core.MediaTypesee Media Data
@Core.IsMediaTypesee Media Data
@Core.IsUrlsee Media Data
@Capabilities...see Fiori
@Common.FieldControlsee Input Validation)