|
@ -7,7 +7,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.context.ApplicationContext; |
|
|
import org.springframework.context.ApplicationContext; |
|
|
|
|
|
|
|
|
public class ConfigurationInitializer implements ApplicationInitializer { |
|
|
public class ConfigurationInitializer implements ApplicationInitializer { |
|
|
@Autowired private CfgDataExtractorService cfgDataExtractorService; |
|
|
|
|
|
@Autowired private CfgBinomialService binomialService; |
|
|
@Autowired private CfgBinomialService binomialService; |
|
|
@Autowired private CfgChiSquareService chiSquareService; |
|
|
@Autowired private CfgChiSquareService chiSquareService; |
|
|
@Autowired private CfgCutOffPointService cutOffPointService; |
|
|
@Autowired private CfgCutOffPointService cutOffPointService; |
|
@ -31,7 +30,6 @@ public class ConfigurationInitializer implements ApplicationInitializer { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void init(ApplicationContext applicationContext) { |
|
|
public void init(ApplicationContext applicationContext) { |
|
|
this.cfgDataExtractorService =applicationContext.getBean(CfgDataExtractorService.class); |
|
|
|
|
|
this.binomialService =applicationContext.getBean(CfgBinomialService.class); |
|
|
this.binomialService =applicationContext.getBean(CfgBinomialService.class); |
|
|
this.chiSquareService =applicationContext.getBean(CfgChiSquareService.class); |
|
|
this.chiSquareService =applicationContext.getBean(CfgChiSquareService.class); |
|
|
this.cutOffPointService =applicationContext.getBean(CfgCutOffPointService.class); |
|
|
this.cutOffPointService =applicationContext.getBean(CfgCutOffPointService.class); |
|
@ -48,8 +46,7 @@ public class ConfigurationInitializer implements ApplicationInitializer { |
|
|
if(isInitialized!=null) { |
|
|
if(isInitialized!=null) { |
|
|
return isInitialized; |
|
|
return isInitialized; |
|
|
} |
|
|
} |
|
|
isInitialized = ( cfgDataExtractorService.getRepository().count()>0 |
|
|
isInitialized = (binomialService.getRepository().count()>0 |
|
|
|| binomialService.getRepository().count()>0 |
|
|
|
|
|
|| chiSquareService.getRepository().count()>0 |
|
|
|| chiSquareService.getRepository().count()>0 |
|
|
|| cutOffPointService.getRepository().count()>0 |
|
|
|| cutOffPointService.getRepository().count()>0 |
|
|
|| thresholdService.getRepository().count()>0); |
|
|
|| thresholdService.getRepository().count()>0); |
|
@ -59,9 +56,6 @@ public class ConfigurationInitializer implements ApplicationInitializer { |
|
|
@Override |
|
|
@Override |
|
|
public void execute() throws ApplicationInitializerExecuteException { |
|
|
public void execute() throws ApplicationInitializerExecuteException { |
|
|
try { |
|
|
try { |
|
|
if(cfgDataExtractorService.getRepository().count()<=0){ |
|
|
|
|
|
cfgDataExtractorService.generateSample(); |
|
|
|
|
|
} |
|
|
|
|
|
if(binomialService.getRepository().count()<=0) { |
|
|
if(binomialService.getRepository().count()<=0) { |
|
|
binomialService.resetDefaultValues(); |
|
|
binomialService.resetDefaultValues(); |
|
|
} |
|
|
} |
|
|