use of org.finos.waltz.schema.tables.records.ReportGridRecord in project waltz by khartec.
the class ReportGridDao method create.
public long create(ReportGridCreateCommand createCommand, String username) {
ReportGridRecord record = dsl.newRecord(rg);
record.setName(createCommand.name());
record.setExternalId(createCommand.toExtId(username));
record.setDescription(createCommand.description());
record.setLastUpdatedAt(DateTimeUtilities.nowUtcTimestamp());
record.setLastUpdatedBy(username);
record.setProvenance("waltz");
record.setKind(createCommand.kind().name());
try {
int insert = record.insert();
return record.getId();
} catch (DataIntegrityViolationException exception) {
throw new DataIntegrityViolationException(format("Grid already exists with the name: %s for user.", createCommand.name()));
}
}
Aggregations