0
我有兩個玩JPA對象User.java & UserRole.JavaJPDA查詢和播放 - 用戶和角色(JOIN)
public User(String email, String password, String firstName, String lastName, Status status, List<UserRole> roles){
this.email = email;
this.password = password;
this.firstName = firstName;
this.lastName = lastName;
this.status = status;
this.roles = roles;
}
UserRole的
public UserRole(User user,RoleType roleType, Status status) {
this.user = user;
this.roleType = roleType;
this.status = status;
}
是的UserRole通過
映射到用戶@OneToMany(mappedBy="user",fetch=FetchType.EAGER)
public List<UserRole> roles;
我希望寫一個播放JPQL查詢,將返回所有用戶與指定的RO這是否可能,如果是這樣,如何?