use of org.akaza.openclinica.bean.rule.RuleSetBean in project OpenClinica by OpenClinica.
the class RuleSetDAO method update.
public EntityBean update(EntityBean eb) {
RuleSetBean ruleSetBean = (RuleSetBean) eb;
ruleSetBean.setActive(false);
HashMap<Integer, Object> variables = new HashMap<Integer, Object>();
HashMap nullVars = new HashMap();
this.execute(digester.getQuery("update"), variables, nullVars);
if (isQuerySuccessful()) {
ruleSetBean.setActive(true);
}
return ruleSetBean;
}
use of org.akaza.openclinica.bean.rule.RuleSetBean in project OpenClinica by OpenClinica.
the class RuleSetDAO method findByPK.
public EntityBean findByPK(int ID) {
RuleSetBean ruleSetBean = null;
this.setTypesExpected();
HashMap<Integer, Object> variables = new HashMap<Integer, Object>();
variables.put(new Integer(1), new Integer(ID));
String sql = digester.getQuery("findByPK");
ArrayList alist = this.select(sql, variables);
Iterator it = alist.iterator();
if (it.hasNext()) {
ruleSetBean = (RuleSetBean) this.getEntityFromHashMap((HashMap) it.next());
}
return ruleSetBean;
}
use of org.akaza.openclinica.bean.rule.RuleSetBean in project OpenClinica by OpenClinica.
the class RuleDAO method findAll.
public Collection findAll() {
this.setTypesExpected();
ArrayList alist = this.select(digester.getQuery("findAll"));
ArrayList<RuleSetBean> ruleSetBeans = new ArrayList<RuleSetBean>();
Iterator it = alist.iterator();
while (it.hasNext()) {
RuleSetBean ruleSet = (RuleSetBean) this.getEntityFromHashMap((HashMap) it.next());
ruleSetBeans.add(ruleSet);
}
return ruleSetBeans;
}
use of org.akaza.openclinica.bean.rule.RuleSetBean in project OpenClinica by OpenClinica.
the class RuleSetRuleDAO method removeByRuleSet.
public void removeByRuleSet(RuleSetBean eb) {
RuleSetBean ruleSetBean = eb;
HashMap<Integer, Integer> variables = new HashMap<Integer, Integer>();
variables.put(new Integer(1), ruleSetBean.getUpdaterId());
variables.put(new Integer(2), Status.DELETED.getId());
variables.put(new Integer(3), ruleSetBean.getId());
execute(digester.getQuery("updateStatusByRuleSet"), variables);
}
Aggregations