use of com.khartec.waltz.schema.tables.records.EndUserApplicationRecord in project waltz by khartec.
the class EndUserAppMaker method main.
public static void main(String[] args) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
OrganisationalUnitDao organisationalUnitDao = ctx.getBean(OrganisationalUnitDao.class);
DSLContext dsl = ctx.getBean(DSLContext.class);
List<Long> ids = IdUtilities.toIds(organisationalUnitDao.findAll());
String[] subjects = { "Trade", "Risk", "Balance", "PnL", "Rate", "Fines", "Party", "Confirmations", "Settlement", "Instruction", "Person", "Profit", "Margin", "Finance", "Account" };
String[] types = { "Report", "Summary", "Draft", "Calculations", "Breaks", "Record", "Statement", "Information", "Pivot" };
String[] tech = { "MS ACCESS", "MS EXCEL", "VBA" };
dsl.delete(END_USER_APPLICATION).execute();
final Long[] idCounter = { 1L };
ids.forEach(ouId -> {
for (int i = 0; i < new Random().nextInt(100) + 40; i++) {
EndUserApplicationRecord record = dsl.newRecord(END_USER_APPLICATION);
String name = new StringBuilder().append(randomPick(subjects)).append(" ").append(randomPick(subjects)).append(" ").append(randomPick(types)).append(" ").append(randomPick(types)).toString();
record.setName(name);
record.setDescription("About the " + name + " End user app");
record.setKind(randomPick(tech));
record.setRiskRating(randomPick(Criticality.values()).name());
record.setLifecyclePhase(randomPick(LifecyclePhase.values()).name());
record.setOrganisationalUnitId(ouId);
record.setId(idCounter[0]++);
record.insert();
}
});
}
Aggregations