本文整理匯總了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)
{