Model Code
Let’s learn how to code the model.
Code the add
operation
For the multi-valued reference property Book::authors
, we need to code the operations addAuthor
and removeAuthor
. Both operations accept one parameter, which denotes an author either by ID reference (the author ID as integer or string) or by an object reference.
The code of addAuthor
is as follows:
Get hands-on with 1400+ tech skills courses.