spring-data-relational
spring-data-relational copied to clipboard
Allow for FK in normal direction [DATAJDBC-128]
Jens Schauder opened DATAJDBC-128 and commented
Currently; if we have an aggregate root A referencing a single B the FK on the tables have to actually go in the opposite direction:
A(id); B(id, a)
This choice was made since it is similar to what we need for collections. But it is a little weird and gets even weirder when there are multiple references from A to B
No further details from DATAJDBC-128
Jens Schauder commented
I consider this really low priority by now.
The direction of the foreign key is actual really natural once one realises that the referencing entity is the Aggregate Root (or at least closer to the Aggregate Root) and it should be able to exist without any of its element existing first. After all these can't exist by definition without the AR