Hello.
I want to use Lazy loading, so I have next entitys:
Code:
class BigEntity {
@ManyToOne(fetch = LAZY)
@LazyToOne(NO_PROXY)
private InnerEntity inner;
}
I want to get the next behavior:
Code:
BigEntity big = em.find(BigEntity.class, id);
hibernate: select * from BigEntity where id = ?
Code:
InnerEntity inner = big.getInner();
hibernate: select * from InnerEntity where id = ?
But I have next situation:
select * from InnerEntity where id = ? send to DB when I get some property of InnerEntity, but not when I call big.getInner();