JPQL: self join
Assume we have following classes class Storage{ @OneToMany(mappedBy = "storage", cascade = CascadeType.ALL, targetEntity = Fruit.class, fetch = FetchType.LAZY) List fruits; } class Fruit{ String name; String owner; @ManyToOne @JoinColumn(name = "STORAGE_ID") Storage storage; } What you have to do if you would like find all storages with [...]
Andriy Andrunevchyn
Recent Comments