removed unnecessary method creation
This commit is contained in:
parent
841729bca3
commit
4c984dc82c
@ -118,7 +118,8 @@ public class BaseRuleChainService extends AbstractEntityService implements RuleC
|
|||||||
@Transactional
|
@Transactional
|
||||||
public RuleChain saveRuleChain(RuleChain ruleChain, boolean publishSaveEvent) {
|
public RuleChain saveRuleChain(RuleChain ruleChain, boolean publishSaveEvent) {
|
||||||
ruleChainValidator.validate(ruleChain, RuleChain::getTenantId);
|
ruleChainValidator.validate(ruleChain, RuleChain::getTenantId);
|
||||||
RuleChain savedRuleChain = saveRuleChainInternal(ruleChain);
|
try {
|
||||||
|
RuleChain savedRuleChain = ruleChainDao.saveAndFlush(ruleChain.getTenantId(), ruleChain);
|
||||||
if (ruleChain.getId() == null) {
|
if (ruleChain.getId() == null) {
|
||||||
entityCountService.publishCountEntityEvictEvent(ruleChain.getTenantId(), EntityType.RULE_CHAIN);
|
entityCountService.publishCountEntityEvictEvent(ruleChain.getTenantId(), EntityType.RULE_CHAIN);
|
||||||
}
|
}
|
||||||
@ -127,11 +128,6 @@ public class BaseRuleChainService extends AbstractEntityService implements RuleC
|
|||||||
.entity(savedRuleChain).entityId(savedRuleChain.getId()).created(ruleChain.getId() == null).build());
|
.entity(savedRuleChain).entityId(savedRuleChain.getId()).created(ruleChain.getId() == null).build());
|
||||||
}
|
}
|
||||||
return savedRuleChain;
|
return savedRuleChain;
|
||||||
}
|
|
||||||
|
|
||||||
private RuleChain saveRuleChainInternal(RuleChain ruleChain) {
|
|
||||||
try {
|
|
||||||
return ruleChainDao.saveAndFlush(ruleChain.getTenantId(), ruleChain);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
checkConstraintViolation(e, "rule_chain_external_id_unq_key", "Rule Chain with such external id already exists!");
|
checkConstraintViolation(e, "rule_chain_external_id_unq_key", "Rule Chain with such external id already exists!");
|
||||||
throw e;
|
throw e;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user