/** * On server side, we need component keys and uuid */ public static IssueDto toDtoForServerInsert(DefaultIssue issue, ComponentDto component, ComponentDto project, int ruleId, long now) { return toDtoForComputationInsert(issue, ruleId, now) .setComponent(component) .setProject(project); }
private void persistNewIssues(IssueStatistics statistics, List<DefaultIssue> addedIssues, IssueMapper mapper, IssueChangeMapper changeMapper) { if (addedIssues.isEmpty()) { return; } long now = system2.now(); addedIssues.forEach(i -> { int ruleId = ruleRepository.getByKey(i.ruleKey()).getId(); IssueDto dto = IssueDto.toDtoForComputationInsert(i, ruleId, now); mapper.insert(dto); statistics.inserts++; }); addedIssues.forEach(i -> issueStorage.insertChanges(changeMapper, i)); }
/** * On server side, we need component keys and uuid */ public static IssueDto toDtoForServerInsert(DefaultIssue issue, ComponentDto component, ComponentDto project, int ruleId, long now) { return toDtoForComputationInsert(issue, ruleId, now) .setComponent(component) .setProject(project); }
private void persistNewIssue(IssueMapper mapper, DefaultIssue issue) { Integer ruleId = ruleRepository.getByKey(issue.ruleKey()).getId(); IssueDto dto = IssueDto.toDtoForComputationInsert(issue, ruleId, system2.now()); mapper.insert(dto); }