/// <summary> /// Creates new <see cref="ShardedQueryImpl"/> instance. /// </summary> /// <param name="session">The Sharded session on which this query is to be executed.</param> /// <param name="unshardedQueryExpressionPlan">A shard-local <see cref="IQueryExpressionPlan"/> that represents /// a parsed HQL string or the HQL equivalent of a Linq expression.</param> public ShardedQueryImpl(IShardedSessionImplementor session, IQueryExpressionPlan unshardedQueryExpressionPlan) { Preconditions.CheckNotNull(session); Preconditions.CheckNotNull(unshardedQueryExpressionPlan); this.session = session; this.unshardedQueryExpressionPlan = unshardedQueryExpressionPlan; this.queryFactory = s => ApplyLimits(s.GetSessionImplementation().CreateQuery(this.QueryExpression)); }
public ShardedQueryExpression(IQueryExpressionPlan unshardedQueryExpressionPlan, ExitOperationBuilder exitOperationBuilder) { Preconditions.CheckNotNull(unshardedQueryExpressionPlan); this.unshardedQueryExpressionPlan = unshardedQueryExpressionPlan; this.exitOperationBuilder = exitOperationBuilder; this.parameterValuesByName = unshardedQueryExpressionPlan.QueryExpression is NhLinqExpression linqExpression ? new Dictionary <string, Tuple <object, IType> >(linqExpression.ParameterValuesByName) : new Dictionary <string, Tuple <object, IType> >(); }