Search

Common Annotations

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

Content

General Purpose

Annotation Description Alternatives
@title   Common.Label
@description   Core.Description

Access Control

Annotation Description
@readonly see Generic Handlers
@insertonly see Generic Handlers
@restrict see Authorization
@requires see Authorization

Input Validation

Annotation Description  
@readonly see Input Validation  
@mandatory see Input Validation  
@assert.unique see Input Validation
@assert.integrity see Input Validation  
@assert.format see Input Validation  
@assert.range see Input Validation  

Services / APIs

Annotation Description
@path  
@impl  
@odata.etag see Providing Services
@cds.autoexpose see Providing Services
@cds.api.ignore see Providing Services
@cds.query.limit see Providing Services
@cds.localized see Localized Data
@cds.valid.from/to see Temporal Data

Persistence

Annotation Description
@cds.persistence.exists tells compile.to.sql this is created otherwise
@cds.persistence.table tells compile.to.sql to create a table, not a view
@cds.persistence.skip tells the compiler, this entity shall not exist in database at all
@cds.persistence.mock false excludes this entity from automatic mocking
@cds.persistence.name allows to choose a different database name
@cds.on.insert see Generic Handlers
@cds.on.update see Generic Handlers
@cascade Allows to cascade insert, update, and delete operations over selected associations.

OData

Learn more on OData Annotations in CDS

Shortcuts:

Annotation Description
@ValueList.entity see Domain Modeling
@odata.Type see Domain Modeling
@odata.MaxLength see Domain Modeling
@odata.singleton Create an edmx:Singleton if evaluated as true.
@odata.singleton.nullable Create an edmx:Singleton if @odata.singleton is null or undefined.

Intrinsically supported OData Annotations:

Annotation Description
@Core.Computed see Generic Handlers
@Core.Immutable see Generic Handlers
@Core.MediaType see Generic Handlers
@Core.IsMediaType see Generic Handlers
@Core.IsUrl see Generic Handlers
@Capabilities... see Generic Handlers
@Common.FieldControl see Generic Handlers