have an aggregate that has a one to one relationship, and in the second level, the child entity has a one to many relationship (a List). Currently when the entity gets saved it does what is expected, and is saving it OK. But when I try to get the entity from the database the SQL that gets generated is wrong, resulting in an error. I cant really tell what Im missing here, any help will be greatly appreciated. Im using Lombok, spring-data-jdbc, and spring-boot. Maybe Lombok has something to do but I cant tell.
The problem is that when I save a new entity it does allright, but when I try to fetch it from the database the sql generated makes a join between the tables with a column "details" that exists in the entity but obviously its not part of the table.
If I put the list on the root aggregate the SQL generated and the mapping works fine.