static IQueryTranslator[] CreateQueryTranslators(
            IQueryExpression queryExpression,
            IASTNode ast,
            string queryIdentifier,
            string collectionRole,
            bool shallow,
            IDictionary <string, IFilter> filters,
            ISessionFactoryImplementor factory)
        {
            var polymorphicParsers = AstPolymorphicProcessor.Process(ast, factory);

            var translators = polymorphicParsers
                              .ToArray(hql => queryExpression is NhLinqExpression linqExpression
                                                        ? new QueryTranslatorImpl(queryIdentifier, hql, filters, factory, linqExpression.NamedParameters)
                                                        : new QueryTranslatorImpl(queryIdentifier, hql, filters, factory));

            foreach (var translator in translators)
            {
                if (collectionRole == null)
                {
                    translator.Compile(factory.Settings.QuerySubstitutions, shallow);
                }
                else
                {
                    translator.Compile(collectionRole, factory.Settings.QuerySubstitutions, shallow);
                }
            }

            return(translators);
        }
        public static IASTNode[] Process(IASTNode ast, ISessionFactoryImplementor factory)
        {
            var processor = new AstPolymorphicProcessor(ast, factory);

            return processor.Process();
        }
        public static IASTNode[] Process(IASTNode ast, ISessionFactoryImplementor factory)
        {
            var processor = new AstPolymorphicProcessor(ast, factory);

            return(processor.Process());
        }