Search in sources :

Example 1 with ImmutableIdSelectionOptions

use of com.khartec.waltz.model.ImmutableIdSelectionOptions in project waltz by khartec.

the class SurveyInstanceIdSelectorFactory method mkForOrgUnit.

private SelectConditionStep<Record1<Long>> mkForOrgUnit(EntityReference ref, HierarchyQueryScope scope) {
    ImmutableIdSelectionOptions ouSelectorOptions = ImmutableIdSelectionOptions.builder().entityReference(ref).scope(scope).build();
    Select<Record1<Long>> ouSelector = orgUnitIdSelectorFactory.apply(ouSelectorOptions);
    return dsl.selectDistinct(SURVEY_INSTANCE.ID).from(SURVEY_INSTANCE).where(SURVEY_INSTANCE.ENTITY_KIND.eq(ref.kind().name()).and(SURVEY_INSTANCE.ENTITY_ID.in(ouSelector)));
}
Also used : ImmutableIdSelectionOptions(com.khartec.waltz.model.ImmutableIdSelectionOptions) Record1(org.jooq.Record1)

Example 2 with ImmutableIdSelectionOptions

use of com.khartec.waltz.model.ImmutableIdSelectionOptions in project waltz by khartec.

the class ApplicationIdSelectorFactory method mkForOrgUnit.

private SelectConditionStep<Record1<Long>> mkForOrgUnit(IdSelectionOptions options) {
    ImmutableIdSelectionOptions ouSelectorOptions = ImmutableIdSelectionOptions.builder().entityReference(options.entityReference()).scope(options.scope()).build();
    Select<Record1<Long>> ouSelector = orgUnitIdSelectorFactory.apply(ouSelectorOptions);
    return dsl.selectDistinct(app.ID).from(app).where(dsl.renderInlined(app.ORGANISATIONAL_UNIT_ID.in(ouSelector))).and(app.ENTITY_LIFECYCLE_STATUS.in(options.entityLifecycleStatuses()));
}
Also used : ImmutableIdSelectionOptions(com.khartec.waltz.model.ImmutableIdSelectionOptions)

Aggregations

ImmutableIdSelectionOptions (com.khartec.waltz.model.ImmutableIdSelectionOptions)2 Record1 (org.jooq.Record1)1