Hi all,
I'm trying to figure out how to model my entities..
I have a big table that contains all my entities, and a smaller one that contains only some of the entities with some more data (for the same entities)
In MSSQL I did LEFT JOIN to get all entities (with or without the extra data)
I made a small example of my model in CDS:
@Catalog.tableType: #COLUMN entity FullEntity { key ID : Integer; //My Key for the entities anyField : String(50); }; entity DescriptiveEntity { key FullEntID : Association [1..1] to FullEntity {ID} ; //the ID from the fullEntity table Description : String(50); };
How can I write a view, that will basically do:
SELECT * FROM FullEntity as F LEFT JOIN DescriptiveEntity as D ON F.ID = D.FullEntID;
The opposite is very easy but gives me basically a right join
VIEW RightView as select from DescriptiveEntity { DescriptiveEntity.FullEntID.ID, DescriptiveEntity.FullEntID.anyField, DescriptiveEntity.Description };
Thank you,
Yaron