Search in sources :

Example 1 with AssetCostRecord

use of com.khartec.waltz.schema.tables.records.AssetCostRecord in project waltz by khartec.

the class AssetCostGenerator method main.

public static void main(String[] args) {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    ApplicationService applicationService = ctx.getBean(ApplicationService.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    List<AssetCostRecord> appDevCosts = generateRecords(applicationService, "APPLICATION_DEVELOPMENT", 100_0000);
    List<AssetCostRecord> infraCosts = generateRecords(applicationService, "INFRASTRUCTURE", 5_000);
    dsl.deleteFrom(ASSET_COST).where(ASSET_COST.YEAR.eq(year)).and(ASSET_COST.PROVENANCE.eq(provenance)).execute();
    dsl.batchInsert(appDevCosts).execute();
    dsl.batchInsert(infraCosts).execute();
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) DSLContext(org.jooq.DSLContext) AssetCostRecord(com.khartec.waltz.schema.tables.records.AssetCostRecord) ApplicationService(com.khartec.waltz.service.application.ApplicationService)

Aggregations

AssetCostRecord (com.khartec.waltz.schema.tables.records.AssetCostRecord)1 ApplicationService (com.khartec.waltz.service.application.ApplicationService)1 DSLContext (org.jooq.DSLContext)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1