Search in sources :

Example 1 with QValidationRun

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)));
}
Also used : QTrustAnchorValidationRun(net.ripe.rpki.validator3.domain.querydsl.QTrustAnchorValidationRun) QCertificateTreeValidationRun(net.ripe.rpki.validator3.domain.querydsl.QCertificateTreeValidationRun) QValidationRun(net.ripe.rpki.validator3.domain.querydsl.QValidationRun)

Aggregations

QCertificateTreeValidationRun (net.ripe.rpki.validator3.domain.querydsl.QCertificateTreeValidationRun)1 QTrustAnchorValidationRun (net.ripe.rpki.validator3.domain.querydsl.QTrustAnchorValidationRun)1 QValidationRun (net.ripe.rpki.validator3.domain.querydsl.QValidationRun)1