QueryDSL中的多个“ WHERE”参数

时间:2018-09-03 18:44:56

标签: mysql spring spring-data-jpa spring-data querydsl

我有以下mysql查询:

select * from traintable
where (train, time) in (select train, max(time) from traintable group by train);

如何在QueryDSL的WHERE方法中放置多个参数?

query.select(qtraintable).from(qtraintable)
     .where(qtraintable.train, qtraintable.time) // How should I do it here?
     .in(JPAExpressions.select(qtraintable.train, qtraintable.time.max())
                       .from(qtraintable)
                       .groupby(qtraintable.train))

0 个答案:

没有答案