當前位置: 首頁>>代碼示例>>C#>>正文


C# HqlTreeBuilder.AnyValueConstant方法代碼示例

本文整理匯總了C#中NHibernate.Hql.Ast.HqlTreeBuilder.AnyValueConstant方法的典型用法代碼示例。如果您正苦於以下問題:C# HqlTreeBuilder.AnyValueConstant方法的具體用法?C# HqlTreeBuilder.AnyValueConstant怎麽用?C# HqlTreeBuilder.AnyValueConstant使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NHibernate.Hql.Ast.HqlTreeBuilder的用法示例。


在下文中一共展示了HqlTreeBuilder.AnyValueConstant方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: BuildHql

        public override HqlTreeNode BuildHql(MethodInfo method, Expression targetObject, ReadOnlyCollection<Expression> arguments, HqlTreeBuilder treeBuilder, IHqlExpressionVisitor visitor)
        {
            /*
            HqlDot hqlDot = (HqlDot)visitor.Visit(arguments[0]).AsExpression();
            List<HqlTreeNode> hqlTreeNodes = hqlDot.Children.ToList();

            FieldInfo fieldInfo = typeof(HqlTreeNode).GetField("_node", BindingFlags.NonPublic | BindingFlags.Instance);

            HqlIdent node1 = (HqlIdent)hqlTreeNodes[0];
            IASTNode tableNode = (IASTNode)fieldInfo.GetValue(node1);
            string tableText = tableNode.Text;

            HqlIdent node2 = (HqlIdent)hqlTreeNodes[1];
            IASTNode columnNode = (IASTNode)fieldInfo.GetValue(node2);
            string columnText = columnNode.Text;

            string format = string.Format("{0}.{1} (+)", tableText, columnText);

            //return treeBuilder.AnyValueConstant(format);
            return treeBuilder.AnyValueConstant("customer1_.ID (+)");
            */


            HqlAnyValueConstant expression0 = treeBuilder.AnyValueConstant("+");
            HqlExpression expression1 = visitor.Visit(arguments[0]).AsExpression();

            List<HqlExpression> expressions = new List<HqlExpression>();
            expressions.Add(expression0);
            expressions.Add(expression1);
            return treeBuilder.BooleanMethodCall("", expressions);



            //treeBuilder.Equality();
            //HqlMethodCall leftSign = treeBuilder.MethodCall("", treeBuilder.Plus());

            /*
            return expression2;

            HqlDot dot = (HqlDot) expression2;
            //return treeBuilder.AnyValueConstant(" ", expression1, expression2);
            return expression1;

            /*
            return expression2;
            */
            //return leftSign;
            //return treeBuilder.Space(leftSign, );
        }
開發者ID:BosphorusTeam,項目名稱:bosphorus.dao,代碼行數:49,代碼來源:HqlGenerator.cs


注:本文中的NHibernate.Hql.Ast.HqlTreeBuilder.AnyValueConstant方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。