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());
}
Aggregations