本文整理汇总了C#中NHibernate.Hql.Ast.HqlExpression类的典型用法代码示例。如果您正苦于以下问题:C# HqlExpression类的具体用法?C# HqlExpression怎么用?C# HqlExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HqlExpression类属于NHibernate.Hql.Ast命名空间,在下文中一共展示了HqlExpression类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddOrderByClause
public void AddOrderByClause(HqlExpression orderBy, HqlDirectionStatement direction)
{
var orderByRoot = Root.NodesPreOrder.Where(n => n is HqlOrderBy).FirstOrDefault();
if (orderByRoot == null)
{
orderByRoot = TreeBuilder.OrderBy();
Root.As<HqlQuery>().AddChild(orderByRoot);
}
orderByRoot.AddChild(orderBy);
orderByRoot.AddChild(direction);
}
示例2: ConvertBooleanToCase
public static HqlExpression ConvertBooleanToCase(HqlExpression node)
{
if (node is HqlBooleanExpression)
{
var builder = new HqlTreeBuilder();
return builder.Case(
new[] {builder.When(node, builder.True())},
builder.False());
}
return node;
}
示例3: BuildHql
public override HqlTreeNode BuildHql(MethodInfo method, Expression targetObject,
ReadOnlyCollection<Expression> arguments, HqlTreeBuilder treeBuilder, IHqlExpressionVisitor visitor)
{
// There is a problem with NHibernate when an identifier matches an entity's name. The resulting
// SQL may be null in that situation. The searchTable's name is split in 2 identifiers to mitigate the problem.
string searchTable = (string)((ConstantExpression)arguments[2]).Value;
var searchTableFullName = searchTable.Split('.');
if (searchTableFullName.Length != 2)
throw new FrameworkException("FullTextSearch table name '" + searchTable + "' must have format 'schema.table'.");
string searchColumns = (string)((ConstantExpression)arguments[3]).Value;
var parameters = new HqlExpression[]
{
visitor.Visit(arguments[0]).AsExpression(),
visitor.Visit(arguments[1]).AsExpression(),
treeBuilder.Ident(searchTableFullName[0]),
treeBuilder.Ident(searchTableFullName[1]),
treeBuilder.Ident(searchColumns),
};
return treeBuilder.BooleanMethodCall("FullTextSearch", parameters);
}
示例4: Indices
public HqlTreeNode Indices(HqlExpression dictionary)
{
return new HqlIndices(_factory, dictionary);
}
示例5: Coalesce
public HqlTreeNode Coalesce(HqlExpression lhs, HqlExpression rhs)
{
return new HqlCoalesce(_factory, lhs, rhs);
}
示例6: LeftFetchJoin
public HqlLeftFetchJoin LeftFetchJoin(HqlExpression expression, HqlAlias @alias)
{
return new HqlLeftFetchJoin(_factory, expression, @alias);
}
示例7: IsNotNull
public HqlIsNotNull IsNotNull(HqlExpression lhs)
{
return new HqlIsNotNull(_factory, lhs);
}
示例8: Join
public HqlJoin Join(HqlExpression expression, HqlAlias @alias)
{
return new HqlJoin(_factory, expression, @alias);
}
示例9: Min
public HqlMin Min(HqlExpression expression)
{
return new HqlMin(_factory, expression);
}
示例10: Select
public HqlSelect Select(HqlExpression expression)
{
return new HqlSelect(_factory, expression);
}
示例11: Take
public HqlTake Take(HqlExpression parameter)
{
return new HqlTake(_factory, parameter);
}
示例12: Skip
public HqlSkip Skip(HqlExpression parameter)
{
return new HqlSkip(_factory, parameter);
}
示例13: Where
public HqlWhere Where(HqlExpression expression)
{
return new HqlWhere(_factory, expression);
}
示例14: Dot
public HqlDot Dot(HqlExpression lhs, HqlExpression rhs)
{
return new HqlDot(_factory, lhs, rhs);
}
示例15: Divide
public HqlDivide Divide(HqlExpression lhs, HqlExpression rhs)
{
return new HqlDivide(_factory, lhs, rhs);
}