// Constructors public SqlExecutor(StorageDriver driver, SqlConnection connection) { ArgumentValidator.EnsureArgumentNotNull(driver, "driver"); ArgumentValidator.EnsureArgumentNotNull(connection, "connection"); this.driver = driver; this.connection = connection; }
protected QueryRequest CreateQueryRequest(StorageDriver driver, SqlSelect statement, IEnumerable <QueryParameterBinding> parameterBindings, TupleDescriptor tupleDescriptor, QueryRequestOptions options) { if (Handlers.Domain.Configuration.ShareStorageSchemaOverNodes) { return(new QueryRequest(driver, statement, parameterBindings, tupleDescriptor, options, NodeConfiguration)); } return(new QueryRequest(driver, statement, parameterBindings, tupleDescriptor, options)); }
// Constructors public CommandFactory(StorageDriver driver, Session session, SqlConnection connection) { ArgumentValidator.EnsureArgumentNotNull(driver, "driver"); ArgumentValidator.EnsureArgumentNotNull(session, "session"); ArgumentValidator.EnsureArgumentNotNull(connection, "connection"); Driver = driver; Session = session; Connection = connection; emptyStringIsNull = driver.ProviderInfo.Supports(ProviderFeatures.TreatEmptyStringAsNull); }
internal SqlSessionHandler(Session session, SqlConnection connection, bool connectionIsExternal, bool transactionIsExternal) : base(session) { this.connection = connection; this.connectionIsExternal = connectionIsExternal; this.transactionIsExternal = transactionIsExternal; domainHandler = Handlers.DomainHandler; driver = Handlers.StorageDriver; commandProcessor = domainHandler.CommandProcessorFactory.CreateCommandProcessor(Session, connection); prefetchManager = new PrefetchManager(Session); }
// Constructors public QueryRequest( StorageDriver driver, SqlSelect statement, IEnumerable <QueryParameterBinding> parameterBindings, TupleDescriptor tupleDescriptor, QueryRequestOptions options) { ArgumentValidator.EnsureArgumentNotNull(driver, "driver"); ArgumentValidator.EnsureArgumentNotNull(statement, "statement"); ArgumentValidator.EnsureArgumentNotNull(tupleDescriptor, "tupleDescriptor"); this.driver = driver; Statement = statement; ParameterBindings = ParameterBinding.NormalizeBindings(parameterBindings); TupleDescriptor = tupleDescriptor; Options = options; }
public SequenceQueryBuilder(StorageDriver driver) { ArgumentValidator.EnsureArgumentNotNull(driver, "driver"); this.driver = driver; var providerInfo = driver.ProviderInfo; hasSequences = providerInfo.Supports(ProviderFeatures.Sequences); hasBatches = providerInfo.Supports(ProviderFeatures.DmlBatches); hasInsertDefaultValues = providerInfo.Supports(ProviderFeatures.InsertDefaultValues); storesAutoIncrementSettingsInMemory = providerInfo.Supports(ProviderFeatures.AutoIncrementSettingsInMemory); compartment = hasSequences || providerInfo.Supports(ProviderFeatures.TransactionalKeyGenerators) ? SequenceQueryCompartment.SameSession : SequenceQueryCompartment.SeparateSession; }
public PersistRequest( StorageDriver driver, SqlStatement statement, IEnumerable <PersistParameterBinding> parameterBindings, NodeConfiguration nodeConfiguration) { ArgumentValidator.EnsureArgumentNotNull(driver, "driver"); ArgumentValidator.EnsureArgumentNotNull(statement, "statement"); var compileUnit = statement as ISqlCompileUnit; if (compileUnit == null) { throw new ArgumentException("Statement is not ISqlCompileUnit"); } this.driver = driver; Statement = statement; CompileUnit = compileUnit; ParameterBindings = ParameterBinding.NormalizeBindings(parameterBindings); NodeConfiguration = nodeConfiguration; }
// Constructors public ExpressionProcessor( LambdaExpression lambda, HandlerAccessor handlers, SqlCompiler compiler, params IReadOnlyList <SqlExpression>[] sourceColumns) { ArgumentValidator.EnsureArgumentNotNull(lambda, "lambda"); ArgumentValidator.EnsureArgumentNotNull(handlers, "handlers"); ArgumentValidator.EnsureArgumentNotNull(sourceColumns, "sourceColumns"); this.compiler = compiler; // This might be null, check before use! this.lambda = lambda; this.sourceColumns = sourceColumns; providerInfo = handlers.ProviderInfo; driver = handlers.StorageDriver; fixBooleanExpressions = !providerInfo.Supports(ProviderFeatures.FullFeaturedBooleanExpressions); emptyStringIsNull = providerInfo.Supports(ProviderFeatures.TreatEmptyStringAsNull); dateTimeEmulation = providerInfo.Supports(ProviderFeatures.DateTimeEmulation); dateTimeOffsetEmulation = providerInfo.Supports(ProviderFeatures.DateTimeOffsetEmulation); memberCompilerProvider = handlers.DomainHandler.GetMemberCompilerProvider <SqlExpression>(); specialByteArrayComparison = providerInfo.ProviderName.Equals(WellKnown.Provider.Oracle); bindings = new HashSet <QueryParameterBinding>(); activeParameters = new List <ParameterExpression>(); evaluator = new ExpressionEvaluator(lambda); parameterExtractor = new ParameterExtractor(evaluator); if (fixBooleanExpressions) { booleanExpressionConverter = new BooleanExpressionConverter(driver); } if (lambda.Parameters.Count != sourceColumns.Length) { throw Exceptions.InternalError(Strings.ExParametersCountIsNotSameAsSourceColumnListsCount, OrmLog.Instance); } if (sourceColumns.Any(list => list.Any(c => c.IsNullReference()))) { throw Exceptions.InternalError(Strings.ExSourceColumnListContainsNullValues, OrmLog.Instance); } sourceMapping = new Dictionary <ParameterExpression, IReadOnlyList <SqlExpression> >(); }
// Constructors public ExpressionTranslationContext(ProviderInfo providerInfo, StorageDriver driver, BooleanExpressionConverter booleanExpressionConverter) { ProviderInfo = providerInfo; Driver = driver; BooleanExpressionConverter = booleanExpressionConverter; }
public BooleanExpressionConverter(StorageDriver driver) { booleanType = driver.MapValueType(typeof(bool)); }
public BooleanExpressionConverter(StorageDriver driver) { booleanType = driver.MapValueType(WellKnownTypes.Bool); }
// Constructors public PersistRequest( StorageDriver driver, SqlStatement statement, IEnumerable <PersistParameterBinding> parameterBindings) : this(driver, statement, parameterBindings, null) { }
// Constructors public CursorCommandFactory(StorageDriver driver, Session session, SqlConnection connection) : base(driver, session, connection) { }
public SqlExecutor(StorageDriver driver, SqlConnection connection, Session session) : this(driver, connection) { this.session = session; }
public ExpressionTranslationScope(ProviderInfo providerInfo, StorageDriver driver, BooleanExpressionConverter booleanExpressionConverter) : base(new ExpressionTranslationContext(providerInfo, driver, booleanExpressionConverter)) { }
/// <inheritdoc/> protected override void Initialize() { driver = Handlers.StorageDriver; providerInfo = Handlers.ProviderInfo; }
/// <inheritdoc/> protected override void Initialize() { driver = Handlers.StorageDriver; providerInfo = Handlers.ProviderInfo; useLargeObjects = Handlers.ProviderInfo.Supports(ProviderFeatures.LargeObjects); }