Getting Text Using Foreign Key Associations

简介: Getting Text Using Foreign Key Associations

In addition to using the text association directly, you can also use the foreign key association CDS annotation to provide a text for a CDS Element. This is of particular importance when providing values help for CDS view elements. The value help results from foreign key associations as a kind of side-effect - without further action. As a consequence, the value help is available automatically in numerous applications through the propagation of corresponding annotations.


Steps

To retrieve texts by adding foreign key associations, proceed as follows::


Create a data definition with a CDS view that serves as text provider

As result of this step, the CDS view is specified as a text provider view using the @ObjectModel.dataCategory: #TEXT annotation. In the text view, the language key element and the text elements are also defined through appropriate CDS annotations.


Create a text association from a CDS view to the text provider.

The element that is annotated with @ObjectModel.text.association points to the text provider view, which is defined as the target of the association of the text consumer view.


Define a foreign key association to the relevant field of the consumer view.

In this step, you will define the foreign key association from the consumer view with the text consumer view (as defined in the previous step) using the @ObjectModel.foreignKey.association annotation for the relevant field.


More on this

The steps above, including the CDS annotations to be used, are described in detail in the topic: Value Help Based on Foreign Key Relationship


相关文章
|
11月前
|
关系型数据库 MySQL 数据库
解决出现的SQLIntegrityConstraintViolationExceptionw:Duplicate entry ‘10‘ for for key ‘user.PRIMARY‘问题
解决出现的SQLIntegrityConstraintViolationExceptionw:Duplicate entry ‘10‘ for for key ‘user.PRIMARY‘问题
152 0
|
关系型数据库 MySQL 索引
不会2023年你还不知道Mysql中index、primary key、unique key、foreign key是什么和如何创建吧?
不会2023年你还不知道Mysql中index、primary key、unique key、foreign key是什么和如何创建吧?
79 0
|
SQL 关系型数据库 MySQL
MySQL - key、primary key、unique key、index 区别(二)
MySQL - key、primary key、unique key、index 区别(二)
1051 0
|
存储 Oracle 关系型数据库
MySQL - key、primary key、unique key、index 区别(一)
MySQL - key、primary key、unique key、index 区别(一)
358 0
MySQL - key、primary key、unique key、index 区别(一)
|
存储