https://www.baeldung.com/jpa-joincolumn-vs-mappedby
followed the same approach for creating oneToMany & ManyToOne relation mapping.
Even though used the @JoinColumn in owning side entity, as per "baeldung" example in the "email entity" but it keeps the foreign key as null.
When I used the @JoinColumn in parent entity i.e. as per in above example in "Employee" entity, then it worked.
but what's the reason behind this behavior of relation mapping ? why this example approach is incorrect ?
Here is my code repo link : https://github.com/TamtePrathamesh/sb_mapping between 'User' & 'mobile' while keeping oneToMany/ManyToOne mapping the mobile table not maintaining the foreign key the entry comes as "NULL". Mobile Mapping Table