I have a problem modeling a database to store some Java objects (the classic problem of mapping objects to a relational database). An example would be much better than a long description, thatβs what.
List of available classes:
- Class A contains an array of doubles
- Class B contains an array A - Class C contains an array of B and an array A (it can go the same way)
All objects implement the same parent element (say, StorableObject). There may be as many combinations as possible.
How can I save all these values, and, in addition, how can I create a model using some FK, which removes all its children when the parent is deleted. I mean, since children can be stored in different tables, I cannot put a simple FK in the parent field.
Thanks;)
source share