本文整理汇总了C#中NHibernate.Hql.Classic.QueryTranslator.AppendScalarSelectParameter方法的典型用法代码示例。如果您正苦于以下问题:C# QueryTranslator.AppendScalarSelectParameter方法的具体用法?C# QueryTranslator.AppendScalarSelectParameter怎么用?C# QueryTranslator.AppendScalarSelectParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NHibernate.Hql.Classic.QueryTranslator
的用法示例。
在下文中一共展示了QueryTranslator.AppendScalarSelectParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Token
//.........这里部分代码省略.........
funcStack.Push(GetFunction(lctoken, q));
q.AppendScalarSelectToken(token);
if (!funcStack.SqlFunction.HasArguments && !funcStack.SqlFunction.HasParenthesesIfNoArguments)
{
q.AddSelectScalar(funcStack.GetReturnType());
funcStack.Pop();
readyForAliasOrExpression = funcStack.HasFunctions;
}
}
}
else if (funcStack.HasFunctions)
{
bool constantToken = false;
var expectedParen = parenCount + ((insideNew) ? -1 : 0);
if (!readyForAliasOrExpression && expectedParen != funcStack.NestedFunctionCount)
{
throw new QueryException("'(' expected after HQL function in SELECT");
}
try
{
ParserHelper.Parse(funcStack.PathExpressionParser, q.Unalias(token), ParserHelper.PathSeparators, q);
}
catch (QueryException)
{
if (IsPathExpression(token))
throw;
// If isn't a path the token is added like part of function arguments
constantToken = true;
}
if (token.StartsWith(ParserHelper.HqlVariablePrefix))
{
q.AddNamedParameter(token.Substring(1));
q.AppendScalarSelectParameter();
}
else if (constantToken)
{
q.AppendScalarSelectToken(token);
}
else
{
if (funcStack.PathExpressionParser.IsCollectionValued)
{
q.AddCollection(
funcStack.PathExpressionParser.CollectionName,
funcStack.PathExpressionParser.CollectionRole);
}
q.AppendScalarSelectToken(funcStack.PathExpressionParser.WhereColumn);
funcStack.PathExpressionParser.AddAssociation(q);
}
// after a function argument
readyForAliasOrExpression = false;
}
else
{
if (!readyForAliasOrExpression)
{
throw new QueryException("',' expected in SELECT before:" + token);
}
try
{
//High probablly to find a valid pathExpression
ParserHelper.Parse(pathExpressionParser, q.Unalias(token), ParserHelper.PathSeparators, q);
if (pathExpressionParser.IsCollectionValued)
{