@Override
public void setSetting(String key, String value) {
verifyContextOpen();
List list = hibernateSession.createCriteria(ProcessToolSetting.class).add(Restrictions.eq("key", key)).list();
ProcessToolSetting setting;
if (list.isEmpty()) {
setting = new ProcessToolSetting();
setting.setKey(key);
} else {
setting = (ProcessToolSetting) list.get(0);
}
setting.setValue(value);
hibernateSession.saveOrUpdate(setting);
}