use of com.khartec.waltz.data.database_information.DatabaseInformationDao in project waltz by khartec.
the class DatabaseHarness method main.
public static void main(String[] args) throws ParseException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
DatabaseInformationService databaseInfoService = ctx.getBean(DatabaseInformationService.class);
DatabaseInformationDao databaseDao = ctx.getBean(DatabaseInformationDao.class);
DSLContext dsl = ctx.getBean(DSLContext.class);
/*
List<DatabaseInformation> dbs = databaseDao.findByApplicationId(801L);
System.out.println(dbs.size());
List<Tally<String>> eolCounts = calculateStringTallies(
dsl,
DATABASE_INFORMATION,
DSL.when(DATABASE_INFORMATION.END_OF_LIFE_DATE.lt(DSL.currentDate()), DSL.inline(EndOfLifeStatus.END_OF_LIFE.name()))
.otherwise(DSL.inline(EndOfLifeStatus.NOT_END_OF_LIFE.name())),
DSL.trueCondition());
System.out.println(eolCounts);
*/
IdSelectionOptions options = ImmutableIdSelectionOptions.builder().entityReference(ImmutableEntityReference.builder().kind(EntityKind.ORG_UNIT).id(10).build()).scope(HierarchyQueryScope.CHILDREN).build();
for (int i = 0; i < 5; i++) {
HarnessUtilities.time("stats", () -> databaseInfoService.findStatsForAppIdSelector(options));
}
}
Aggregations