public AssignmentSpecification(AST eq, Queryable persister) {
    if (eq.getType() != HqlSqlTokenTypes.EQ) {
      throw new QueryException("assignment in set-clause not associated with equals");
    }

    this.eq = eq;
    this.factory = persister.getFactory();

    // Needed to bump this up to DotNode, because that is the only thing which currently
    // knows about the property-ref path in the correct format; it is either this, or
    // recurse over the DotNodes constructing the property path just like DotNode does
    // internally
    final PathSeparatorNode lhs = (PathSeparatorNode) eq.getFirstChild();
    final SqlNode rhs = (SqlNode) lhs.getNextSibling();

    validateLhs(lhs);

    final String propertyPath = lhs.getPropertyPath();
    Set<String> temp = new HashSet<String>();
    // yuck!
    if (persister instanceof UnionSubclassEntityPersister) {
      final String[] tables = persister.getConstraintOrderedTableNameClosure();
      Collections.addAll(temp, tables);
    } else {
      temp.add(
          persister.getSubclassTableName(persister.getSubclassPropertyTableNumber(propertyPath)));
    }
    this.tableNames = Collections.unmodifiableSet(temp);

    if (rhs == null) {
      hqlParameters = new ParameterSpecification[0];
    } else if (isParam(rhs)) {
      hqlParameters =
          new ParameterSpecification[] {((ParameterNode) rhs).getHqlParameterSpecification()};
    } else {
      List parameterList =
          ASTUtil.collectChildren(
              rhs,
              new ASTUtil.IncludePredicate() {
                public boolean include(AST node) {
                  return isParam(node);
                }
              });
      hqlParameters = new ParameterSpecification[parameterList.size()];
      Iterator itr = parameterList.iterator();
      int i = 0;
      while (itr.hasNext()) {
        hqlParameters[i++] = ((ParameterNode) itr.next()).getHqlParameterSpecification();
      }
    }
  }
  @Test
  public void testEjb3PositionalParameters() throws Exception {
    QueryTranslatorImpl qt = compile("from Animal a where a.bodyWeight = ?1");
    AST ast = (AST) qt.getSqlAST();

    // make certain that the ejb3-positional param got recognized as a named param
    List namedParams =
        ASTUtil.collectChildren(
            ast,
            new ASTUtil.FilterPredicate() {
              public boolean exclude(AST n) {
                return n.getType() != HqlSqlTokenTypes.NAMED_PARAM;
              }
            });
    assertTrue("ejb3 positional param not recognized as a named param", namedParams.size() > 0);
  }