Example #1
0
        public SQLCustomQuery(INativeSQLQueryReturn[] queryReturns, string sqlQuery, ICollection <string> additionalQuerySpaces,
                              ISessionFactoryImplementor factory)
        {
            log.Debug("starting processing of sql query [{0}]", sqlQuery);
            SQLQueryReturnProcessor processor = new SQLQueryReturnProcessor(queryReturns, factory);

            SQLQueryReturnProcessor.ResultAliasContext aliasContext = processor.Process();

            SQLQueryParser parser = new SQLQueryParser(factory, sqlQuery, new ParserContext(aliasContext));

            sql = parser.Process();
            ArrayHelper.AddAll(customQueryReturns, processor.GenerateCustomReturns(parser.QueryHasAliases));
            parametersSpecifications = parser.CollectedParametersSpecifications.ToList();

            if (additionalQuerySpaces != null)
            {
                querySpaces.UnionWith(additionalQuerySpaces);
            }
        }
Example #2
0
        public SQLCustomQuery(INativeSQLQueryReturn[] queryReturns, string sqlQuery, ICollection <string> additionalQuerySpaces,
                              ISessionFactoryImplementor factory)
        {
            log.Debug("starting processing of sql query [" + sqlQuery + "]");
            SQLQueryReturnProcessor processor = new SQLQueryReturnProcessor(queryReturns, factory);

            SQLQueryReturnProcessor.ResultAliasContext aliasContext = processor.Process();

            SQLQueryParser parser = new SQLQueryParser(sqlQuery, new ParserContext(aliasContext));

            sql = parser.Process();
            ArrayHelper.AddAll(namedParameterBindPoints, parser.NamedParameters);
            ArrayHelper.AddAll(customQueryReturns, processor.GenerateCustomReturns(parser.QueryHasAliases));

            if (additionalQuerySpaces != null)
            {
                querySpaces.AddAll(additionalQuerySpaces);
            }
        }
Example #3
0
 public ParserContext(SQLQueryReturnProcessor.ResultAliasContext aliasContext)
 {
     this.aliasContext = aliasContext;
 }
Example #4
0
			public ParserContext(SQLQueryReturnProcessor.ResultAliasContext aliasContext)
			{
				this.aliasContext = aliasContext;
			}