예제 #1
0
        protected HqlTreeNode VisitNhCount(NhCountExpression expression)
        {
            string        functionName;
            HqlExpression countHqlExpression;

            if (expression is NhLongCountExpression)
            {
                functionName       = "count_big";
                countHqlExpression = _hqlTreeBuilder.CountBig(VisitExpression(expression.Expression).AsExpression());
            }
            else
            {
                functionName       = "count";
                countHqlExpression = _hqlTreeBuilder.Count(VisitExpression(expression.Expression).AsExpression());
            }

            return(IsCastRequired(functionName, expression.Expression, expression.Type)
                                ? (HqlTreeNode)_hqlTreeBuilder.Cast(countHqlExpression, expression.Type)
                                : _hqlTreeBuilder.TransparentCast(countHqlExpression, expression.Type));
        }
예제 #2
0
 protected HqlTreeNode VisitNhCount(NhCountExpression expression)
 {
     return(_hqlTreeBuilder.Cast(_hqlTreeBuilder.Count(VisitExpression(expression.Expression).AsExpression()), expression.Type));
 }