I have something like this:
class A{
@OneToMany(mappedBy="a")
private List<B> bs;
}
class B {
@ManyToOne
private A a;
private String name;
@OneToOne(mappedBy = "image", cascade = CascadeType.ALL, fetch =
FetchType.LAZY, orphanRemoval = true)
private C c;
}
class C{
@Lob
private byte[] img;
@OneToOne(fetch = FetchType.LAZY)
private B b;
}
When I invoke getAll() method, I need to get all except class C. I set fetch lazy, but it doesn't work at all. I have an idea to create query which will be join field bs from class A with class B but without joining class C.
And when I invoke getOne(id) method, I need to get all entities.
In every class, I have obviously id field. Can you help me write this query ?
Thanks a lot.