+------------------+
| ObjectA NoteMapping |
|------------------|
| String one noteId |
| String two content |
| |
+---------+--------+
|
+---------------+----------------+
| |
+--------|--------+ +--------|--------+
| ObjectAAUserNote | | ObjectAB AdminNote |
|-----------------| |-----------------|
| String three userId | | String four adminId |
| | | |
+--------+--------+ +--------+--------+
| |
| |
+--------|--------+ +--------|--------+
| ObjectAAA UserBookNote | | ObjectABA AdminBookNote |
|-----------------| |-----------------|
| String five bookId | | String five bookId |
| | | |
+-----------------+ +-----------------+
ASCII tables drawn using http://www.asciiflow.com/
Edit
I have added some class and field names to the class diagram above.
The reason bookId
cannot exist in any of the parent classes is because it is used to create a OneToOne
relationship with another class - which is not something that we always want to do.