Search in sources :

Example 1 with ApplicationGroupRecord

use of org.finos.waltz.schema.tables.records.ApplicationGroupRecord in project waltz by khartec.

the class AppGroupGenerator method create.

@Override
public Map<String, Integer> create(ApplicationContext ctx) {
    DSLContext dsl = getDsl(ctx);
    List<ApplicationGroupRecord> groupRecords = Arrays.stream(names).map(n -> {
        ApplicationGroupRecord record = dsl.newRecord(APPLICATION_GROUP);
        record.setName(n);
        record.setKind(AppGroupKind.PUBLIC.name());
        record.setDescription(format("%s : Description of %s", SAMPLE_DATA_PROVENANCE, n));
        return record;
    }).collect(Collectors.toList());
    dsl.batchStore(groupRecords).execute();
    return null;
}
Also used : ApplicationGroupRecord(org.finos.waltz.schema.tables.records.ApplicationGroupRecord) AppGroupKind(org.finos.waltz.model.app_group.AppGroupKind) Arrays(java.util.Arrays) List(java.util.List) DSL(org.jooq.impl.DSL) APPLICATION_GROUP_ENTRY(org.finos.waltz.schema.tables.ApplicationGroupEntry.APPLICATION_GROUP_ENTRY) ApplicationGroupRecord(org.finos.waltz.schema.tables.records.ApplicationGroupRecord) Map(java.util.Map) APPLICATION_GROUP(org.finos.waltz.schema.tables.ApplicationGroup.APPLICATION_GROUP) DSLContext(org.jooq.DSLContext) ApplicationContext(org.springframework.context.ApplicationContext) Collectors(java.util.stream.Collectors) String.format(java.lang.String.format) DSLContext(org.jooq.DSLContext)

Aggregations

String.format (java.lang.String.format)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 AppGroupKind (org.finos.waltz.model.app_group.AppGroupKind)1 APPLICATION_GROUP (org.finos.waltz.schema.tables.ApplicationGroup.APPLICATION_GROUP)1 APPLICATION_GROUP_ENTRY (org.finos.waltz.schema.tables.ApplicationGroupEntry.APPLICATION_GROUP_ENTRY)1 ApplicationGroupRecord (org.finos.waltz.schema.tables.records.ApplicationGroupRecord)1 DSLContext (org.jooq.DSLContext)1 DSL (org.jooq.impl.DSL)1 ApplicationContext (org.springframework.context.ApplicationContext)1