}
}
- public List<RuleDto> selectBySubCharacteristicId(Integer characteristicOrSubCharacteristicId, SqlSession session) {
- return getMapper(session).selectBySubCharacteristicId(characteristicOrSubCharacteristicId);
+ /**
+ * Return all rules (even the REMOVED ones) linked on to a sub characteristic
+ */
+ public List<RuleDto> selectBySubCharacteristicId(Integer subCharacteristicId, SqlSession session) {
+ return getMapper(session).selectBySubCharacteristicId(subCharacteristicId);
}
@CheckForNull
public void select_by_sub_characteristic_id(){
setupData("select_by_sub_characteristic_id");
- // Rules from sub characteristic
+ // Rules from sub characteristic (even REMOVED ones are returned)
List<RuleDto> ruleDtos = dao.selectBySubCharacteristicId(3);
assertThat(ruleDtos).hasSize(3);
assertThat(idsFromRuleDtos(ruleDtos)).containsExactly(2, 4, 5);
}
private void disableSubCharacteristic(CharacteristicDto subCharacteristic, Date updateDate, SqlSession session) {
+ // Disable debt on all rules (even REMOVED ones, in order to have no issue if they are reactivated) linked to the sub characteristic
disableRulesDebt(ruleDao.selectBySubCharacteristicId(subCharacteristic.getId(), session), subCharacteristic.getId(), updateDate, session);
disableCharacteristic(subCharacteristic, updateDate, session);
}