Andrunevchyn

Recent Posts


Recent Comments


Archives


Categories


Meta


Andrunevchyn


jpql1

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 AndrunevchynAndriy Andrunevchyn