X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=rulemgt%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fholmes%2Frulemgt%2Fwrapper%2FRuleQueryWrapper.java;h=1d245f823c203282cc4f63f5dbcd9027b8ce8f3e;hb=a796bda2f8e2db093ce9f528f6e5960e4aa1b22c;hp=0ad836f81c9eae217963342c7c01d28788910920;hpb=71ad58788ebfd666f6922fd9c16f77a9a4e39e27;p=holmes%2Frule-management.git diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleQueryWrapper.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleQueryWrapper.java index 0ad836f..1d245f8 100644 --- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleQueryWrapper.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleQueryWrapper.java @@ -16,37 +16,28 @@ package org.onap.holmes.rulemgt.wrapper; -import org.jvnet.hk2.annotations.Service; import org.onap.holmes.common.api.entity.CorrelationRule; import org.onap.holmes.common.exception.CorrelationException; -import org.onap.holmes.common.utils.DbDaoUtil; -import org.onap.holmes.rulemgt.db.CorrelationRuleDao; +import org.onap.holmes.rulemgt.db.CorrelationRuleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; -import javax.annotation.PostConstruct; -import javax.inject.Inject; import java.util.List; @Service public class RuleQueryWrapper { - @Inject - private DbDaoUtil daoUtil; - private CorrelationRuleDao correlationRuleDao; + @Autowired + private CorrelationRuleService correlationRuleService; - @PostConstruct - public void initDaoUtil() { - correlationRuleDao = daoUtil.getJdbiDaoByOnDemand(CorrelationRuleDao.class); - } - public List queryRuleByEnable(int enable) throws CorrelationException { - List ruleTemp = daoUtil.getJdbiDaoByOnDemand(CorrelationRuleDao.class) - .queryRuleByRuleEnable(enable); + public List queryRuleByEnable(int enable) { + List ruleTemp = correlationRuleService.queryRuleByRuleEnable(enable); return ruleTemp; } public List queryRuleByEngineInstance(String instance) throws CorrelationException { - List ruleTemp = daoUtil.getJdbiDaoByOnDemand(CorrelationRuleDao.class) - .queryRuleByRuleEngineInstance(instance); + List ruleTemp = correlationRuleService.queryRuleByRuleEngineInstance(instance); return ruleTemp; } }