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> >();
        }
Beispiel #2
0
        public ShardedCriteriaImpl(ShardedCriteriaImpl other)
        {
            Preconditions.CheckNotNull(other);

            this.session              = other.session;
            this.criteriaFactory      = other.criteriaFactory;
            this.exitOperationBuilder = new ExitOperationBuilder(other.exitOperationBuilder);
            this.establishActions     = other.establishActions;
            this.subcriteriaByAlias   = new Dictionary <string, ICriteria>(other.subcriteriaByAlias);
            this.subcriteriaByPath    = new Dictionary <string, Subcriteria>(other.subcriteriaByPath);
        }
 public ShardedHqlGenerator(
     IASTNode unshardedHql,
     IClassMetadata rootClassMetadata,
     IDictionary <string, Tuple <object, IType> > namedParameters,
     ExitOperationBuilder exitOperationBuilder)
 {
     this.rootClassMetadata    = rootClassMetadata;
     this.exitOperationBuilder = exitOperationBuilder;
     this.namedParameters      = namedParameters;
     this.shardedQuery         = ToShardedHql(unshardedHql);
 }
Beispiel #4
0
 public ShardedCriteriaImpl(IShardedSessionImplementor session, string entityName, Func <ISession, ICriteria> criteriaFactory)
 {
     Preconditions.CheckNotNull(session);
     Preconditions.CheckNotNull(entityName);
     Preconditions.CheckNotNull(criteriaFactory);
     this.session              = session;
     this.entityName           = entityName;
     this.criteriaFactory      = criteriaFactory;
     this.exitOperationBuilder = new ExitOperationBuilder();
     this.subcriteriaByAlias   = new Dictionary <string, ICriteria> {
         { CriteriaSpecification.RootAlias, this }
     };
     this.subcriteriaByPath = new Dictionary <string, Subcriteria>();
 }