/** Returns the locations of all occurrences of the named parameter. */
 public int[] getNamedParameterLocations(String name) throws QueryException {
   Object o = namedParameters.get(name);
   if (o == null) {
     QueryException qe =
         new QueryException(QueryTranslator.ERROR_NAMED_PARAMETER_DOES_NOT_APPEAR + name);
     qe.setQueryString(queryTranslatorImpl.getQueryString());
     throw qe;
   }
   if (o instanceof Integer) {
     return new int[] {((Integer) o).intValue()};
   } else {
     return ArrayHelper.toIntArray((ArrayList) o);
   }
 }
  protected void prepareFromClauseInputTree(AST fromClauseInput) {
    // Handle fiter compilation.
    // IMPORTANT NOTE: This is modifying the INPUT (HQL) tree, not the output tree!
    if (isFilter() && !isSubQuery()) {
      QueryableCollection persister =
          sessionFactoryHelper.getCollectionPersister(filterCollectionRole);
      Type collectionElementType = persister.getElementType();
      if (!collectionElementType.isEntityType()) {
        throw new QueryException("collection of values in filter: this");
      }

      String collectionElementEntityName = persister.getElementPersister().getEntityName();
      ASTFactory inputAstFactory = hqlParser.getASTFactory();
      AST fromElement =
          ASTUtil.create(inputAstFactory, HqlTokenTypes.FILTER_ENTITY, collectionElementEntityName);
      ASTUtil.createSibling(inputAstFactory, HqlTokenTypes.ALIAS, "this", fromElement);
      fromClauseInput.addChild(fromElement);
      // Show the modified AST.
      if (log.isDebugEnabled()) {
        log.debug("prepareFromClauseInputTree() : Filter - Added 'this' as a from element...");
      }
      queryTranslatorImpl.showHqlAst(hqlParser.getAST());
    }
  }
 public Map getEnabledFilters() {
   return queryTranslatorImpl.getEnabledFilters();
 }
 public boolean isShallowQuery() {
   // select clauses for insert statements should alwasy be treated as shallow
   return getStatementType() == INSERT || queryTranslatorImpl.isShallowQuery();
 }