I have Java Spring 4 entities with that structure:
EntityA {
@ManyToOne(fetch = LAZY)
EntityB b1;
@ManyToOne(fetch = LAZY)
EntityB b2;
}
EntityB {
@OneToMany(fetch = LAZY, cascade=ALL)
List<EntityC> c1;
}
EntityC {
@ManyToOne(fetch = LAZY)
EntityD d1;
}
EntityD {
Boolean disable;
}
I tried to get HQL request like this:
@Query(value = """
select a from EntityA a
join fetch a.b1 ab1
join fetch a.b2 ab2
""")
In debug i see that i get from DB fetching all values before d1. d1 get from HibernateProxy.
How can i improve my request for getting only EntitiesC where d1.disable = false?