protected void test() {
    for (int i = 0; i <= 1; i++) {
      getSession().getPlatform().setShouldBindAllParameters(i != 0);
      for (int j = 0; j <= 2; j++) {
        query = new ReadAllQuery(Employee.class);
        ExpressionBuilder builder = new ExpressionBuilder();
        Vector vExp = new Vector(2);
        vExp.add(builder.getParameter("p1"));
        query.addArgument("p1");
        vExp.add(builder.getParameter("p2"));
        query.addArgument("p2");
        Expression exp = builder.get("id").in(vExp);
        query.setSelectionCriteria(exp);

        switch (j) {
          case 0:
            // nothing to do - just test the default:
            // query.bindAllParameters == Undefined
            break;
          case 1:
            // query.bindAllParameters == False
            query.setShouldBindAllParameters(false);
            break;
          case 2:
            // query.bindAllParameters == True
            query.setShouldBindAllParameters(true);
            break;
        }

        // clear the writer's buffer
        ((StringWriter) getSession().getLog()).getBuffer().setLength(0);
        try {
          getSession().executeQuery(query, v);
        } catch (DatabaseException e) {
          throw new TestProblemException("executeQuery threw DatabaseException");
        }
        if (shouldBind() != wasBound()) {
          return;
        }
      }
    }
  }
  protected void test() {
    query = new ReadAllQuery();
    query.setReferenceClass(referenceClass);

    ReportQuery hierarchyQuery = new ReportQuery();
    hierarchyQuery.setReferenceClass(referenceClass);
    // The #employeeId is what would cause the error
    hierarchyQuery.setCall(new SQLCall("SELECT EMP_ID FROM EMPLOYEE WHERE MANAGER_ID=#employeeId"));

    query.setSelectionCriteria(query.getExpressionBuilder().get("id").in(hierarchyQuery));
    // want the argument at the top level query
    query.addArgument("employeeId");
  }
 public void test() {
   ReadAllQuery q = new ReadAllQuery();
   q.setBatchFetchType(batchType);
   q.setReferenceClass(Shipment.class);
   q.addBatchReadAttribute("employee");
   q.setSelectionCriteria(
       q.getExpressionBuilder()
           .get("employee")
           .get("address")
           .equal(q.getExpressionBuilder().getParameter("ADDRESS")));
   q.addArgument("ADDRESS");
   Vector r = new Vector();
   r.addElement("885 Meadowlands Dr.");
   UnitOfWork uow = getSession().acquireUnitOfWork();
   v = (java.util.Vector) uow.executeQuery(q, r);
 }
  public void setup() {
    // JGL: If the arguments are already set by the test, don't
    // set them again
    if (!hasArguments()) {
      setArgumentsForTestUsing(getSomeEmployees());
    }
    ReadAllQuery raq = new ReadAllQuery();
    raq.setReferenceClass(Employee.class);
    raq.setSelectionCriteria(getOriginalObjectExpression());
    // Add all the arguments to the query
    Enumeration enumtr = getExpressionParameters().elements();
    while (enumtr.hasMoreElements()) {
      raq.addArgument((String) enumtr.nextElement());
    }

    // Save the retrieved employees for the verify
    setOriginalOject(getSession().executeQuery(raq, getArguments()));

    // Finish the setup
    super.setup();
  }