use of net.ripe.rpki.validator3.domain.querydsl.QValidationRun in project rpki-validator-3 by RIPE-NCC.
the class JPAValidationRuns method validationChecksQuery.
private JPAQuery<ValidationCheck> validationChecksQuery(long validationRunId, SearchTerm searchTerm) {
QValidationRun latest = new QValidationRun("latest");
JPQLQuery<Long> validationRunIds = JPAExpressions.select(latest.id.max()).where(latest.status.eq(ValidationRun.Status.SUCCEEDED).and(latest.as(QCertificateTreeValidationRun.class).trustAnchor.id.eq(validationRunId))).groupBy(JPAExpressions.type(latest), latest.as(QTrustAnchorValidationRun.class).trustAnchor, latest.as(QCertificateTreeValidationRun.class).trustAnchor).from(latest);
return queryFactory.selectFrom(validationCheck).where(validationCheck.validationRun.id.in(validationRunIds).and(toPredicate(searchTerm)));
}
Aggregations