'How to create oneToMany join query using querydsl jpaqueryfactory
How can I write the following query using Querydsl JPAQueryFactory?
select
from team
inner join member on team.team_id = member.team_id and member.country = "US"
The team and member entities are as follows.
public class Team {
@Id
private long team_id;
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = "team_id")
private Set<Member> members;
}
public class Member {
@Id
private long member_id;
private String country;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
