/** 更新Conf */ public Conf update(Conf conf) { cache.clear(); Assert.notNull(conf, "'conf' must be not null"); trimConf(conf); new ConfChecker().checkUpdateConf(conf); confDao.update(conf); return conf; }
/** 创建Conf */ public Conf create(Conf conf) { cache.clear(); Assert.notNull(conf, "'conf' must be not null"); trimConf(conf); initDefaultValuesForCreate(conf); new ConfChecker().checkCreateConf(conf); confDao.insert(conf); return conf; }
private synchronized Properties getByGroup0(String confGroup) { ConfQuery query = new ConfQuery(); query.setConfGroup(confGroup); List<Conf> confList = confDao.findByGroup(confGroup); Properties props = new Properties(); for (Conf conf : confList) { String key = conf.getConfKey(); String value = conf.getConfValue(); if (StringUtils.isBlank(value)) { value = conf.getConfDefaultValue(); } if (StringUtils.isNotBlank(key) && StringUtils.isNotBlank(value)) props.put(key, value); } return props; }
/** 分页查询: Conf */ @Transactional(readOnly = true) public Page<Conf> findPage(ConfQuery query) { Assert.notNull(query, "'query' must be not null"); return confDao.findPage(query); }
/** 根据ID得到Conf */ public Conf getById(String confGroup, String confKey) { return confDao.getById(confGroup, confKey); }
/** 删除Conf */ public void removeById(String confGroup, String confKey) { cache.clear(); confDao.deleteById(confGroup, confKey); }
@Override public List<String> findAllGroup() { return confDao.findAllGroup(); }