Suppose I have two entities...
A
B -> A
B has a ManyToOne relationship with A.
When my database is empty and I persist a valid B entity (that contains actual A reference) I observe some behavior that I'm not sure I understand.
1. In ObjectDB explorer I see Both B and A Entity classes available in sidebar but B has one row and A has none, I was expecting that one row will be created in A and B will refer to it. Please explain what is happening there? I know about cascade option, and if I use it A will be persisted under A type... but is B referring to that A or it is keeping a copy of that information?
2. In explorer in every column where a complex type is represented in json like manner i see {something, null, null, and allways nulls}, but when i retrieve that field i see that other fields are initialized (which means explorer is showing not right information).
3. Suppose above mentioned case is persisted successfully, now I remove the A and want B to return null reference (if it is actually referring and not copying information of A) when retrieved through repository, but it actually contains that A object. Is every single B persisted keeping copy of A? how do I achieve that when A is removed all objects referring to it will have null?
I know that there are many questions but I need to understand how the database manages information as this might be critical for the application and performance.
If there are any other materials (books articles) that might help me with this please link them.
Regards