Search in sources :

Example 11 with IdSelectionOptions

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

the class LogicalFlowStatsHarness method main.

public static void main(String[] args) throws ParseException {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    LogicalFlowService service = ctx.getBean(LogicalFlowService.class);
    IdSelectionOptions options = IdSelectionOptions.mkOpts(EntityReference.mkRef(EntityKind.ORG_UNIT, 50L), HierarchyQueryScope.CHILDREN);
    service.calculateStats(options);
    System.out.println("--done");
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) LogicalFlowService(com.khartec.waltz.service.logical_flow.LogicalFlowService) DSLContext(org.jooq.DSLContext) IdSelectionOptions(com.khartec.waltz.model.IdSelectionOptions)

Example 12 with IdSelectionOptions

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

the class EndUserAppIdSelectorFactory method mkForOrgUnit.

@Override
protected Select<Record1<Long>> mkForOrgUnit(EntityReference ref, HierarchyQueryScope scope) {
    IdSelectionOptions ouSelectorOptions = ImmutableIdSelectionOptions.builder().entityReference(ref).scope(scope).build();
    Select<Record1<Long>> ouSelector = orgUnitIdSelectorFactory.apply(ouSelectorOptions);
    return dsl.selectDistinct(eua.ID).from(eua).where(dsl.renderInlined(eua.ORGANISATIONAL_UNIT_ID.in(ouSelector)));
}
Also used : ImmutableIdSelectionOptions(com.khartec.waltz.model.ImmutableIdSelectionOptions) IdSelectionOptions(com.khartec.waltz.model.IdSelectionOptions) Record1(org.jooq.Record1)

Aggregations

IdSelectionOptions (com.khartec.waltz.model.IdSelectionOptions)12 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)6 Record1 (org.jooq.Record1)5 EntityReference (com.khartec.waltz.model.EntityReference)4 DSLContext (org.jooq.DSLContext)4 ApplicationIdSelectorFactory (com.khartec.waltz.data.application.ApplicationIdSelectorFactory)3 LogicalFlowDao (com.khartec.waltz.data.logical_flow.LogicalFlowDao)2 LogicalFlowIdSelectorFactory (com.khartec.waltz.data.logical_flow.LogicalFlowIdSelectorFactory)2 EntityKind (com.khartec.waltz.model.EntityKind)2 HierarchyQueryScope (com.khartec.waltz.model.HierarchyQueryScope)2 IdSelectionOptions.mkOpts (com.khartec.waltz.model.IdSelectionOptions.mkOpts)2 RollupKind (com.khartec.waltz.model.entity_statistic.RollupKind)2 LogicalFlow (com.khartec.waltz.model.logical_flow.LogicalFlow)2 LogicalFlowService (com.khartec.waltz.service.logical_flow.LogicalFlowService)2 Collection (java.util.Collection)2 Select (org.jooq.Select)2 Checks.checkNotNull (com.khartec.waltz.common.Checks.checkNotNull)1 OptionalUtilities (com.khartec.waltz.common.OptionalUtilities)1 SetUtilities (com.khartec.waltz.common.SetUtilities)1 SetUtilities.fromCollection (com.khartec.waltz.common.SetUtilities.fromCollection)1