Search in sources :

Example 1 with ChangeLogService

use of org.finos.waltz.service.changelog.ChangeLogService in project waltz by khartec.

the class ChangeLogSummariesHarness method main.

public static void main(String[] args) {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    ChangeLogService svc = ctx.getBean(ChangeLogService.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    if (false) {
        // enable this if you want to randomize your changelog dates (i.e. for testing)
        dsl.update(CHANGE_LOG).set(CHANGE_LOG.CREATED_AT, DSL.timestampSub(DSL.now(), CHANGE_LOG.ID.plus(CHANGE_LOG.PARENT_ID).mod(360), DatePart.DAY)).execute();
    }
    IdSelectionOptions opts = mkOpts(mkRef(EntityKind.ORG_UNIT, 20), HierarchyQueryScope.CHILDREN);
    List<DateTally> res = time("findCountByDateForParentKindBySelector", () -> svc.findCountByDateForParentKindBySelector(EntityKind.APPLICATION, opts, Optional.empty()));
    System.out.println(res);
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) DateTally(org.finos.waltz.model.tally.DateTally) ChangeLogService(org.finos.waltz.service.changelog.ChangeLogService) DSLContext(org.jooq.DSLContext) IdSelectionOptions(org.finos.waltz.model.IdSelectionOptions)

Aggregations

IdSelectionOptions (org.finos.waltz.model.IdSelectionOptions)1 DateTally (org.finos.waltz.model.tally.DateTally)1 ChangeLogService (org.finos.waltz.service.changelog.ChangeLogService)1 DSLContext (org.jooq.DSLContext)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1