Search in sources :

Example 16 with RuleSetBean

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;
}
Also used : HashMap(java.util.HashMap) RuleSetBean(org.akaza.openclinica.bean.rule.RuleSetBean)

Example 17 with 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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) RuleSetBean(org.akaza.openclinica.bean.rule.RuleSetBean)

Example 18 with 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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) RuleSetBean(org.akaza.openclinica.bean.rule.RuleSetBean)

Example 19 with RuleSetBean

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);
}
Also used : HashMap(java.util.HashMap) RuleSetBean(org.akaza.openclinica.bean.rule.RuleSetBean)

Aggregations

RuleSetBean (org.akaza.openclinica.bean.rule.RuleSetBean)19 HashMap (java.util.HashMap)17 ArrayList (java.util.ArrayList)10 Iterator (java.util.Iterator)5 UserAccountBean (org.akaza.openclinica.bean.login.UserAccountBean)1 RuleSetAuditBean (org.akaza.openclinica.bean.rule.RuleSetAuditBean)1 Context (org.akaza.openclinica.bean.rule.expression.Context)1 ExpressionBean (org.akaza.openclinica.bean.rule.expression.ExpressionBean)1