use of org.sonar.db.qualityprofile.OrgQProfileDto in project sonarqube by SonarSource.
the class BuiltInQProfileInsertImpl method createDefaultAndOrgQProfiles.
private void createDefaultAndOrgQProfiles(DbSession batchDbSession, BuiltInQProfile builtIn, RulesProfileDto rulesProfileDto) {
Optional<String> qProfileUuid = dbClient.defaultQProfileDao().selectDefaultQProfileUuid(batchDbSession, builtIn.getLanguage());
OrgQProfileDto dto = new OrgQProfileDto().setRulesProfileUuid(rulesProfileDto.getUuid()).setUuid(uuidFactory.create());
if (builtIn.isDefault() && qProfileUuid.isEmpty()) {
DefaultQProfileDto defaultQProfileDto = new DefaultQProfileDto().setQProfileUuid(dto.getUuid()).setLanguage(builtIn.getLanguage());
dbClient.defaultQProfileDao().insert(batchDbSession, defaultQProfileDto);
}
dbClient.qualityProfileDao().insert(batchDbSession, dto);
}
use of org.sonar.db.qualityprofile.OrgQProfileDto in project sonarqube by SonarSource.
the class QProfileFactoryImplTest method associateBuiltInProfile.
private QProfileDto associateBuiltInProfile(RulesProfileDto rulesProfile) {
OrgQProfileDto orgQProfileDto = new OrgQProfileDto().setUuid(Uuids.createFast()).setRulesProfileUuid(rulesProfile.getUuid());
db.getDbClient().qualityProfileDao().insert(dbSession, orgQProfileDto);
db.commit();
return QProfileDto.from(orgQProfileDto, rulesProfile);
}
Aggregations