| I think there are two issues. The first one is that I expect the Address entity to be loaded lazily. My expectation is fulfilled at sql query level, only the id of Address is loaded in:
select
customer0_.ID as col_0_0_,
customer0_.FK6_FOR_CUSTOMER_TABLE as col_1_0_
from
CUSTOMER_TABLE customer0_
inner join
ADDRESS address1_
on customer0_.FK6_FOR_CUSTOMER_TABLE=address1_.ID
where
customer0_.ID=?
I would expect the join to be created only if I pass an EntityGraph referring address or if I declare the relation as EAGER. So there is clearly no need to left join or inner join on address, isn't it? The second one is that if a join is made, it should be at least a left join since the relation of customer to address is optional. |