我希望,一个人在一次查询中获得该人拥有的每个选定报价的请求列表(例如,'select * from Request r where r.selectedOffer = (select o from Offer r.offerList.owner = :owner(? ?)). 有可能吗?或者我必须使用两个查询(一个用于请求,一个用于报价),然后我必须将选定的报价设置为请求?
@Entity
public class Request() {
.....
@OneToMany(mappedBy = "requestId", fetch = FetchType.LAZY)
private Set<Offer> offerList = new HashSet<Offer>();
@Transient (or @OneToOne(mappedBy = "requestId"?? or another ways?)
private Offer selectedOffer;
.....
}