Search in sources :

Example 1 with RuleSetAuditBean

use of org.akaza.openclinica.bean.rule.RuleSetAuditBean in project OpenClinica by OpenClinica.

the class RuleSetAuditDAO method findAllByRuleSet.

public ArrayList<RuleSetAuditBean> findAllByRuleSet(RuleSetBean ruleSet) {
    ArrayList<RuleSetAuditBean> ruleSetAuditBeans = new ArrayList<RuleSetAuditBean>();
    this.setTypesExpected();
    HashMap<Integer, Object> variables = new HashMap<Integer, Object>();
    variables.put(new Integer(1), ruleSet.getId());
    String sql = digester.getQuery("findAllByRuleSet");
    ArrayList<?> alist = this.select(sql, variables);
    Iterator<?> it = alist.iterator();
    while (it.hasNext()) {
        RuleSetAuditBean ruleSetAudit = (RuleSetAuditBean) this.getEntityFromHashMap((HashMap<?, ?>) it.next());
        ruleSetAuditBeans.add(ruleSetAudit);
    }
    return ruleSetAuditBeans;
}
Also used : RuleSetAuditBean(org.akaza.openclinica.bean.rule.RuleSetAuditBean) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList)

Example 2 with RuleSetAuditBean

use of org.akaza.openclinica.bean.rule.RuleSetAuditBean in project OpenClinica by OpenClinica.

the class RuleSetAuditDAO method findByPK.

public EntityBean findByPK(int id) throws OpenClinicaException {
    RuleSetAuditBean ruleSetAudit = null;
    this.setTypesExpected();
    HashMap<Integer, Object> variables = new HashMap<Integer, Object>();
    variables.put(new Integer(1), id);
    String sql = digester.getQuery("findByPK");
    ArrayList<?> alist = this.select(sql, variables);
    Iterator<?> it = alist.iterator();
    if (it.hasNext()) {
        ruleSetAudit = (RuleSetAuditBean) this.getEntityFromHashMap((HashMap<?, ?>) it.next());
    }
    return ruleSetAudit;
}
Also used : RuleSetAuditBean(org.akaza.openclinica.bean.rule.RuleSetAuditBean) HashMap(java.util.HashMap)

Example 3 with RuleSetAuditBean

use of org.akaza.openclinica.bean.rule.RuleSetAuditBean in project OpenClinica by OpenClinica.

the class SubjectTransferDAO method findByPK.

public EntityBean findByPK(int id) throws OpenClinicaException {
    RuleSetAuditBean ruleSetAudit = null;
    this.setTypesExpected();
    HashMap<Integer, Object> variables = new HashMap<Integer, Object>();
    variables.put(new Integer(1), id);
    String sql = digester.getQuery("findByPK");
    ArrayList<?> alist = this.select(sql, variables);
    Iterator<?> it = alist.iterator();
    if (it.hasNext()) {
        ruleSetAudit = (RuleSetAuditBean) this.getEntityFromHashMap((HashMap<?, ?>) it.next());
    }
    return ruleSetAudit;
}
Also used : RuleSetAuditBean(org.akaza.openclinica.bean.rule.RuleSetAuditBean) HashMap(java.util.HashMap)

Example 4 with RuleSetAuditBean

use of org.akaza.openclinica.bean.rule.RuleSetAuditBean in project OpenClinica by OpenClinica.

the class RuleSetAuditDAO method getEntityFromHashMap.

public Object getEntityFromHashMap(HashMap hm) {
    RuleSetAuditBean ruleSetAudit = new RuleSetAuditBean();
    ruleSetAudit.setId((Integer) hm.get("rule_set_audit_id"));
    int ruleSetId = (Integer) hm.get("rule_set_id");
    int userAccountId = (Integer) hm.get("updater_id");
    int statusId = (Integer) hm.get("status_id");
    Date dateUpdated = (Date) hm.get("date_updated");
    ruleSetAudit.setDateUpdated(dateUpdated);
    ruleSetAudit.setStatus(Status.get(statusId));
    ruleSetAudit.setRuleSetBean((RuleSetBean) getRuleSetDao().findByPK(ruleSetId));
    ruleSetAudit.setUpdater((UserAccountBean) getUserAccountDao().findByPK(userAccountId));
    return ruleSetAudit;
}
Also used : RuleSetAuditBean(org.akaza.openclinica.bean.rule.RuleSetAuditBean) Date(java.util.Date)

Example 5 with RuleSetAuditBean

use of org.akaza.openclinica.bean.rule.RuleSetAuditBean in project OpenClinica by OpenClinica.

the class RuleSetAuditDAO method create.

public EntityBean create(EntityBean eb, UserAccountBean ub) {
    // INSERT INTO rule_set_audit (rule_set_audit_id,rule_set_id, status_id,updater_id,date_updated) VALUES (?,?,?,?,?)
    RuleSetBean ruleSetBean = (RuleSetBean) eb;
    RuleSetAuditBean ruleSetAudit = new RuleSetAuditBean();
    HashMap<Integer, Object> variables = new HashMap<Integer, Object>();
    variables.put(1, ruleSetBean.getId());
    variables.put(2, ruleSetBean.getStatus().getId());
    variables.put(3, ub.getId());
    this.execute(digester.getQuery("create"), variables);
    if (isQuerySuccessful()) {
        ruleSetAudit.setRuleSetBean(ruleSetBean);
        ruleSetAudit.setId(getCurrentPK());
        ruleSetAudit.setStatus(ruleSetBean.getStatus());
        ruleSetAudit.setUpdater(ub);
    }
    return ruleSetAudit;
}
Also used : RuleSetAuditBean(org.akaza.openclinica.bean.rule.RuleSetAuditBean) HashMap(java.util.HashMap) RuleSetBean(org.akaza.openclinica.bean.rule.RuleSetBean)

Aggregations

RuleSetAuditBean (org.akaza.openclinica.bean.rule.RuleSetAuditBean)7 HashMap (java.util.HashMap)6 ArrayList (java.util.ArrayList)2 Date (java.util.Date)1 SubjectTransferBean (org.akaza.openclinica.bean.managestudy.SubjectTransferBean)1 RuleSetBean (org.akaza.openclinica.bean.rule.RuleSetBean)1