Пример #1
0
  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;
  }
Пример #2
0
  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;
  }