Hi Ray,
Let me address a few things so we can get on the same page.
Is it necessary to relate the objects in each table?
No, using relations is not necessary, but using relations leads to cleaner database design, which in turn leads to simpler data management. Consider the following example:
In there we have a one-to-one relation between the
Person and the Address table. Every person object may have a related address. Is it necessary to do it that way? No, you could alternatively have the following way where the city name is a part of the Person table:
It may be OK with something as simple as this, however, in real applications where you may have a dozen of entities, flattening database structures this way would result in a number of problems such as performance, duplication of data, inability to understand how one entity relates to another.
I’m assuming that the only way the object data can be passed along in the frontend is if they are referenced in the backend.
Data in the frontend needs to come from somewhere. If the data resides in the database, then yes, it needs to come from the backend.
I added a new record to the order table to test things and I expected that it would automatically create the link for the objects
How would it automatically know what customer that order is for? When you save an order, you save just order. The relationship to a customer is done by establishing a relationship between an order that is saved in the database and a customer that is also in there.
I hope this brings some clarity. If not, please ask.
Regards,
Mark
