cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create entity based on another entity

dpk_bhat76
Product and Topic Expert
Product and Topic Expert
0 Likes
1,557

Hello CAP experts!

I have a requirement to create 2 entities with many common attributes. So is there any way we can create a parent entity and inherit that to different entities ? Or what is the most optimal way to achieve such requirement ?

View Entire Topic
norbert_laenger2
Discoverer

Hi,

sounds to me like the 7 attributes that are shared between the A and B should be an named aspect...
This should look like this: capire - Domain Modeling with CDS (cloud.sap)

The attributes bouth entities need would be a named aspect an both entities A and B using this context.

So both entities share the attributives (on design time and Annotation level) but each entity will have it own lifetime and is saved/change without dependencies.

regards
Norbert

dpk_bhat76
Product and Topic Expert
Product and Topic Expert
0 Likes

Thanks alot. Trying it out right away.