public Object getEntityFromHashMap(HashMap hm) {
    ExpressionBean expressionBean = new ExpressionBean();
    this.setEntityAuditInformation(expressionBean, hm);

    expressionBean.setId(((Integer) hm.get("rule_expression_id")).intValue());
    expressionBean.setContext(Context.getByCode(((Integer) hm.get("context"))));
    expressionBean.setValue(((String) hm.get("value")));

    return expressionBean;
  }
  public EntityBean create(EntityBean eb) {
    ExpressionBean expressionBean = (ExpressionBean) eb;
    HashMap<Integer, Object> variables = new HashMap<Integer, Object>();
    HashMap<Integer, Object> nullVars = new HashMap<Integer, Object>();
    variables.put(new Integer(1), expressionBean.getContext().getCode());
    variables.put(new Integer(2), expressionBean.getValue());

    variables.put(new Integer(3), new Integer(expressionBean.getOwnerId()));
    variables.put(new Integer(4), new Integer(Status.AVAILABLE.getId()));

    execute(digester.getQuery("create"), variables, nullVars);

    if (isQuerySuccessful()) {
      expressionBean.setId(getCurrentPK());
    }
    return expressionBean;
  }
  public EntityBean update(EntityBean eb) {
    ExpressionBean expressionBean = (ExpressionBean) eb;

    expressionBean.setActive(false);

    HashMap<Integer, Object> variables = new HashMap<Integer, Object>();
    HashMap nullVars = new HashMap();
    variables.put(new Integer(1), expressionBean.getContext().getCode());
    variables.put(new Integer(2), expressionBean.getValue());
    variables.put(new Integer(3), expressionBean.getUpdaterId());
    variables.put(new Integer(4), expressionBean.getId());

    this.execute(digester.getQuery("update"), variables, nullVars);

    if (isQuerySuccessful()) {
      expressionBean.setActive(true);
    }

    return expressionBean;
  }