use of com.khartec.waltz.schema.tables.ChangeLog.CHANGE_LOG in project waltz by khartec.
the class ChangeLogGenerator method main.
public static void main(String[] args) {
ApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
DSLContext dsl = ctx.getBean(DSLContext.class);
// get applications and emails
List<Long> appIds = dsl.select(APPLICATION.ID).from(APPLICATION).fetch(APPLICATION.ID);
List<String> emails = dsl.select(PERSON.EMAIL).from(PERSON).fetch(PERSON.EMAIL);
Set<ChangeLogRecord> records = emails.stream().flatMap(email -> Stream.of(mkChangeLog(randomPick(appIds), email), mkChangeLog(randomPick(appIds), randomPick(emails)))).collect(toSet());
dsl.deleteFrom(CHANGE_LOG).execute();
dsl.batchInsert(records).execute();
System.out.println("Inserted " + records.size() + " change log entries");
}
Aggregations