public static RulesProfileDto from(QProfileDto qProfileDto) { return new RulesProfileDto() .setKee(qProfileDto.getRulesProfileUuid()) .setLanguage(qProfileDto.getLanguage()) .setName(qProfileDto.getName()) .setIsBuiltIn(qProfileDto.isBuiltIn()) .setId(qProfileDto.getId()) .setRulesUpdatedAt(qProfileDto.getRulesUpdatedAt()); } }
public static DefaultQProfileDto from(QProfileDto profile) { return new DefaultQProfileDto() .setOrganizationUuid(profile.getOrganizationUuid()) .setLanguage(profile.getLanguage()) .setQProfileUuid(profile.getKee()); }
/** * Nested DTO ActiveRuleParams */ public List<ActiveRuleParamDto> selectParamsByActiveRuleId(DbSession dbSession, Integer activeRuleId) { return mapper(dbSession).selectParamsByActiveRuleId(activeRuleId); }
public static QProfileDto from(OrgQProfileDto org, RulesProfileDto rules) { return new QProfileDto() .setIsBuiltIn(rules.isBuiltIn()) .setKee(org.getUuid()) .setParentKee(org.getParentUuid()) .setOrganizationUuid(org.getOrganizationUuid()) .setId(rules.getId()) .setRulesProfileUuid(rules.getKee()) .setLanguage(rules.getLanguage()) .setName(rules.getName()) .setRulesUpdatedAt(rules.getRulesUpdatedAt()) .setLastUsed(org.getLastUsed()) .setUserUpdatedAt(org.getUserUpdatedAt()); } }
public static OrgQProfileDto from(QProfileDto qProfileDto) { return new OrgQProfileDto() .setUuid(qProfileDto.getKee()) .setOrganizationUuid(qProfileDto.getOrganizationUuid()) .setRulesProfileUuid(qProfileDto.getRulesProfileUuid()) .setParentUuid(qProfileDto.getParentKee()) .setLastUsed(qProfileDto.getLastUsed()) .setUserUpdatedAt(qProfileDto.getUserUpdatedAt()); } }
public ActiveRuleDto insert(DbSession dbSession, ActiveRuleDto item) { checkArgument(item.getProfileId() != null, QUALITY_PROFILE_IS_NOT_PERSISTED); checkArgument(item.getRuleId() != null, RULE_IS_NOT_PERSISTED); checkArgument(item.getId() == null, ACTIVE_RULE_IS_ALREADY_PERSISTED); mapper(dbSession).insert(item); return item; }
public ActiveRuleDto update(DbSession dbSession, ActiveRuleDto item) { checkArgument(item.getProfileId() != null, QUALITY_PROFILE_IS_NOT_PERSISTED); checkArgument(item.getRuleId() != null, ActiveRuleDao.RULE_IS_NOT_PERSISTED); checkArgument(item.getId() != null, ACTIVE_RULE_IS_NOT_PERSISTED); mapper(dbSession).update(item); return item; }
public ActiveRuleParamDto insertParam(DbSession dbSession, ActiveRuleDto activeRule, ActiveRuleParamDto activeRuleParam) { checkArgument(activeRule.getId() != null, ACTIVE_RULE_IS_NOT_PERSISTED); checkArgument(activeRuleParam.getId() == null, ACTIVE_RULE_PARAM_IS_ALREADY_PERSISTED); Preconditions.checkNotNull(activeRuleParam.getRulesParameterId(), RULE_PARAM_IS_NOT_PERSISTED); activeRuleParam.setActiveRuleId(activeRule.getId()); mapper(dbSession).insertParameter(activeRuleParam); return activeRuleParam; }
private ActiveRuleDto activate(QProfileDto profile, RuleDefinitionDto rule, RuleParamDto param) { ActiveRuleDto activeRule = db.qualityProfiles().activateRule(profile, rule); ActiveRuleParamDto dto = ActiveRuleParamDto.createFor(param) .setValue("20") .setActiveRuleId(activeRule.getId()); db.getDbClient().activeRuleDao().insertParam(db.getSession(), activeRule, dto); return activeRule; }
private Statistics(DbSession dbSession, OrganizationDto organization, List<QProfileDto> profiles) { ActiveRuleDao dao = dbClient.activeRuleDao(); ActiveRuleCountQuery.Builder builder = ActiveRuleCountQuery.builder().setOrganization(organization); countRulesByProfileKey = dao.countActiveRulesByQuery(dbSession, builder.setProfiles(profiles).build()); countOverridingRulesByProfileKey = dao.countActiveRulesByQuery(dbSession, builder.setProfiles(profiles).setInheritance(OVERRIDES).build()); } }
public Optional<ActiveRuleDto> delete(DbSession dbSession, ActiveRuleKey key) { Optional<ActiveRuleDto> activeRule = selectByKey(dbSession, key); if (activeRule.isPresent()) { mapper(dbSession).deleteParameters(activeRule.get().getId()); mapper(dbSession).delete(activeRule.get().getId()); } return activeRule; }
/** * Create a key. Parameters are NOT null. */ public static ActiveRuleKey of(QProfileDto profile, RuleKey ruleKey) { return new ActiveRuleKey(profile.getRulesProfileUuid(), ruleKey); }
public List<QProfileDto> selectQProfilesByRuleProfile(DbSession dbSession, RulesProfileDto rulesProfile) { return mapper(dbSession).selectQProfilesByRuleProfileUuid(rulesProfile.getKee()); }
public List<ActiveRuleDto> selectByRuleProfile(DbSession dbSession, RulesProfileDto ruleProfileDto) { return mapper(dbSession).selectByRuleProfileUuid(ruleProfileDto.getKee()); }
public void deleteParamById(DbSession dbSession, int id) { mapper(dbSession).deleteParameter(id); }
/** * Active rule on removed rule are NOT returned */ public List<OrgActiveRuleDto> selectByProfileUuid(DbSession dbSession, String uuid) { return mapper(dbSession).selectByProfileUuid(uuid); }
public List<ActiveRuleDto> selectByRuleIdOfAllOrganizations(DbSession dbSession, int ruleId) { return mapper(dbSession).selectByRuleIdOfAllOrganizations(ruleId); }
public SearchGroupsQuery build() { initMembership(); return new SearchGroupsQuery(this); } }
/** * Note: offset and limit of the query object will be ignored */ public int countByQuery(DbSession dbSession, QProfileChangeQuery query) { return mapper(dbSession).countByQuery(query); }
public List<UserMembershipDto> selectByQuery(DbSession dbSession, SearchUsersQuery query, Pagination pagination) { return mapper(dbSession).selectByQuery(query, pagination); }