Search in sources :

Example 1 with AssetCostStatsDao

use of com.khartec.waltz.data.asset_cost.AssetCostStatsDao in project waltz by khartec.

the class AssetCostHarness method main.

public static void main(String[] args) {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    AssetCostService service = ctx.getBean(AssetCostService.class);
    AssetCostStatsDao statsDao = ctx.getBean(AssetCostStatsDao.class);
    AssetCostDao costDao = ctx.getBean(AssetCostDao.class);
    ApplicationIdSelectorFactory selectorFactory = ctx.getBean(ApplicationIdSelectorFactory.class);
    long st = System.currentTimeMillis();
    System.out.println("-- start");
    IdSelectionOptions appIdSelectionOptions = ImmutableIdSelectionOptions.builder().scope(HierarchyQueryScope.CHILDREN).entityReference(ImmutableEntityReference.builder().id(5600).kind(EntityKind.ORG_UNIT).build()).build();
    List<Tuple2<Long, BigDecimal>> costs = service.calculateCombinedAmountsForSelector(appIdSelectionOptions);
    System.out.println("-- end, dur: " + (System.currentTimeMillis() - st));
    System.out.println(costs);
    System.out.println(costs.size());
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) AssetCostStatsDao(com.khartec.waltz.data.asset_cost.AssetCostStatsDao) ApplicationIdSelectorFactory(com.khartec.waltz.data.application.ApplicationIdSelectorFactory) Tuple2(org.jooq.lambda.tuple.Tuple2) AssetCostDao(com.khartec.waltz.data.asset_cost.AssetCostDao) DSLContext(org.jooq.DSLContext) AssetCostService(com.khartec.waltz.service.asset_cost.AssetCostService)

Aggregations

ApplicationIdSelectorFactory (com.khartec.waltz.data.application.ApplicationIdSelectorFactory)1 AssetCostDao (com.khartec.waltz.data.asset_cost.AssetCostDao)1 AssetCostStatsDao (com.khartec.waltz.data.asset_cost.AssetCostStatsDao)1 AssetCostService (com.khartec.waltz.service.asset_cost.AssetCostService)1 DSLContext (org.jooq.DSLContext)1 Tuple2 (org.jooq.lambda.tuple.Tuple2)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1