public RdbmsProviderCommandFactory( RdbmsProviderDefinition storageProviderDefinition, IDbCommandBuilderFactory dbCommandBuilderFactory, IRdbmsPersistenceModelProvider rdbmsPersistenceModelProvider, IObjectReaderFactory objectReaderFactory, ITableDefinitionFinder tableDefinitionFinder, IDataStoragePropertyDefinitionFactory dataStoragePropertyDefinitionFactory) { ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition); ArgumentUtility.CheckNotNull("dbCommandBuilderFactory", dbCommandBuilderFactory); ArgumentUtility.CheckNotNull("rdbmsPersistenceModelProvider", rdbmsPersistenceModelProvider); ArgumentUtility.CheckNotNull("objectReaderFactory", objectReaderFactory); ArgumentUtility.CheckNotNull("tableDefinitionFinder", tableDefinitionFinder); ArgumentUtility.CheckNotNull("dataStoragePropertyDefinitionFactory", dataStoragePropertyDefinitionFactory); _storageProviderDefinition = storageProviderDefinition; _dbCommandBuilderFactory = dbCommandBuilderFactory; _rdbmsPersistenceModelProvider = rdbmsPersistenceModelProvider; _objectReaderFactory = objectReaderFactory; _tableDefinitionFinder = tableDefinitionFinder; _dataStoragePropertyDefinitionFactory = dataStoragePropertyDefinitionFactory; // ReSharper disable DoNotCallOverridableMethodsInConstructor _lookupCommandFactory = CreateLookupCommandFactory(); _relationLookupCommandFactory = CreateRelationLookupCommandFactory(); _saveCommandFactory = CreateSaveCommandFactory(); _queryCommandFactory = CreateQueryCommandFactory(); // ReSharper restore DoNotCallOverridableMethodsInConstructor }
protected virtual IStorageProviderCommandFactory <IRdbmsProviderCommandExecutionContext> CreateStorageProviderCommandFactory( RdbmsProviderDefinition storageProviderDefinition, IStorageTypeInformationProvider storageTypeInformationProvider, IStorageNameProvider storageNameProvider, IRdbmsPersistenceModelProvider persistenceModelProvider, IInfrastructureStoragePropertyDefinitionProvider infrastructureStoragePropertyDefinitionProvider, IDataStoragePropertyDefinitionFactory dataStoragePropertyDefinitionFactory) { ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition); ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider); ArgumentUtility.CheckNotNull("persistenceModelProvider", persistenceModelProvider); ArgumentUtility.CheckNotNull("infrastructureStoragePropertyDefinitionProvider", infrastructureStoragePropertyDefinitionProvider); ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider); ArgumentUtility.CheckNotNull("dataStoragePropertyDefinitionFactory", dataStoragePropertyDefinitionFactory); var dataContainerValidator = CreateDataContainerValidator(storageProviderDefinition); var objectReaderFactory = new ObjectReaderFactory( persistenceModelProvider, infrastructureStoragePropertyDefinitionProvider, storageTypeInformationProvider, dataContainerValidator); var dbCommandBuilderFactory = CreateDbCommandBuilderFactory(storageProviderDefinition); return(new RdbmsProviderCommandFactory( storageProviderDefinition, dbCommandBuilderFactory, persistenceModelProvider, objectReaderFactory, new TableDefinitionFinder(persistenceModelProvider), dataStoragePropertyDefinitionFactory)); }
public override void SetUp() { base.SetUp(); _columnSerializerStub = MockRepository.GenerateStub <IColumnSerializer>(); _propertySerializer = new PropertySerializer(_columnSerializerStub); _rdbmsPersistenceModelProviderStub = MockRepository.GenerateStub <IRdbmsPersistenceModelProvider>(); }
public XElement Serialize(PropertyDefinition propertyDefinition, IRdbmsPersistenceModelProvider persistenceModelProvider) { ArgumentUtility.CheckNotNull("propertyDefinition", propertyDefinition); ArgumentUtility.CheckNotNull("persistenceModelProvider", persistenceModelProvider); _enumSerializer.CollectPropertyType(propertyDefinition); return(_propertySerializer.Serialize(propertyDefinition, persistenceModelProvider)); }
protected virtual IMappingResolver CreateMappingResolver( RdbmsProviderDefinition storageProviderDefinition, IRdbmsPersistenceModelProvider persistenceModelProvider) { ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition); ArgumentUtility.CheckNotNull("persistenceModelProvider", persistenceModelProvider); return(new MappingResolver(new StorageSpecificExpressionResolver(persistenceModelProvider))); }
public override void SetUp() { base.SetUp(); _rdbmsPersistenceModelProviderStub = MockRepository.GenerateStub <IRdbmsPersistenceModelProvider>(); _finder = new TableDefinitionFinder(_rdbmsPersistenceModelProviderStub); _tableDefinition = TableDefinitionObjectMother.Create(TestDomainStorageProviderDefinition, new EntityNameDefinition(null, "Table")); }
protected virtual IStoragePropertyDefinitionResolver CreateStoragePropertyDefinitionResolver( RdbmsProviderDefinition storageProviderDefinition, IRdbmsPersistenceModelProvider persistenceModelProvider) { ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition); ArgumentUtility.CheckNotNull("persistenceModelProvider", persistenceModelProvider); return(new StoragePropertyDefinitionResolver(persistenceModelProvider)); }
public SaveCommandFactory( IDbCommandBuilderFactory dbCommandBuilderFactory, IRdbmsPersistenceModelProvider rdbmsPersistenceModelProvider, ITableDefinitionFinder tableDefinitionFinder) { ArgumentUtility.CheckNotNull("dbCommandBuilderFactory", dbCommandBuilderFactory); ArgumentUtility.CheckNotNull("rdbmsPersistenceModelProvider", rdbmsPersistenceModelProvider); ArgumentUtility.CheckNotNull("tableDefinitionFinder", tableDefinitionFinder); _dbCommandBuilderFactory = dbCommandBuilderFactory; _rdbmsPersistenceModelProvider = rdbmsPersistenceModelProvider; _tableDefinitionFinder = tableDefinitionFinder; }
public ForeignKeyConstraintDefinitionFactory( IStorageNameProvider storageNameProvider, IRdbmsPersistenceModelProvider persistenceModelProvider, IInfrastructureStoragePropertyDefinitionProvider infrastructureStoragePropertyDefinitionProvider) { ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider); ArgumentUtility.CheckNotNull("persistenceModelProvider", persistenceModelProvider); ArgumentUtility.CheckNotNull("infrastructureStoragePropertyDefinitionProvider", infrastructureStoragePropertyDefinitionProvider); _storageNameProvider = storageNameProvider; _persistenceModelProvider = persistenceModelProvider; _infrastructureStoragePropertyDefinitionProvider = infrastructureStoragePropertyDefinitionProvider; }
public TestableSqlStorageObjectFactory(IRdbmsPersistenceModelProvider rdbmsPersistenceModelProvider, IStorageTypeInformationProvider storageTypeInformationProvider, IDbCommandBuilderFactory dbCommandBuilderFactory, IStorageNameProvider storageNameProvider, IInfrastructureStoragePropertyDefinitionProvider infrastructureStoragePropertyDefinitionProvider, IDataStoragePropertyDefinitionFactory dataStoragePropertyDefinitionFactory, IValueStoragePropertyDefinitionFactory valueStoragePropertyDefinitionFactory, IRelationStoragePropertyDefinitionFactory relationStoragePropertyDefinitionFactory, ISqlQueryGenerator sqlQueryGenerator, IForeignKeyConstraintDefinitionFactory foreignKeyConstraintDefinitionFactoryFactory, IStoragePropertyDefinitionResolver storagePropertyDefinitionResolver) { _infrastructureStoragePropertyDefinitionProvider = infrastructureStoragePropertyDefinitionProvider; _storageNameProvider = storageNameProvider; _dbCommandBuilderFactory = dbCommandBuilderFactory; _storageTypeInformationProvider = storageTypeInformationProvider; _rdbmsPersistenceModelProvider = rdbmsPersistenceModelProvider; _dataStoragePropertyDefinitionFactory = dataStoragePropertyDefinitionFactory; _valueStoragePropertyDefinitionFactory = valueStoragePropertyDefinitionFactory; _relationStoragePropertyDefinitionFactory = relationStoragePropertyDefinitionFactory; _sqlQueryGenerator = sqlQueryGenerator; _foreignKeyConstraintDefinitionFactory = foreignKeyConstraintDefinitionFactoryFactory; _storagePropertyDefinitionResolver = storagePropertyDefinitionResolver; }
public override void SetUp() { base.SetUp(); _fakeObjectIDStoragePropertyDefinition = ObjectIDStoragePropertyDefinitionObjectMother.ObjectIDProperty; _storageNameProviderMock = MockRepository.GenerateStrictMock <IStorageNameProvider>(); _persistenceModelProvider = new RdbmsPersistenceModelProvider(); _infrastructureStoragePropertyDefintionProviderMock = MockRepository.GenerateStrictMock <IInfrastructureStoragePropertyDefinitionProvider>(); _factory = new ForeignKeyConstraintDefinitionFactory( _storageNameProviderMock, _persistenceModelProvider, _infrastructureStoragePropertyDefintionProviderMock); }
protected virtual IForeignKeyConstraintDefinitionFactory CreateForeignKeyConstraintDefinitionsFactory( RdbmsProviderDefinition storageProviderDefinition, IStorageNameProvider storageNameProvider, IRdbmsPersistenceModelProvider persistenceModelProvider, IInfrastructureStoragePropertyDefinitionProvider infrastructureStoragePropertyDefinitionProvider) { ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition); ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider); ArgumentUtility.CheckNotNull("persistenceModelProvider", persistenceModelProvider); ArgumentUtility.CheckNotNull("infrastructureStoragePropertyDefinitionProvider", infrastructureStoragePropertyDefinitionProvider); return(new ForeignKeyConstraintDefinitionFactory( storageNameProvider, persistenceModelProvider, infrastructureStoragePropertyDefinitionProvider)); }
public RdbmsPersistenceModelLoader( IRdbmsStorageEntityDefinitionFactory entityDefinitionFactory, IDataStoragePropertyDefinitionFactory dataStoragePropertyDefinitionFactory, IStorageNameProvider storageNameProvider, IRdbmsPersistenceModelProvider rdbmsPersistenceModelProvider) { ArgumentUtility.CheckNotNull("entityDefinitionFactory", entityDefinitionFactory); ArgumentUtility.CheckNotNull("dataStoragePropertyDefinitionFactory", dataStoragePropertyDefinitionFactory); ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider); ArgumentUtility.CheckNotNull("rdbmsPersistenceModelProvider", rdbmsPersistenceModelProvider); _entityDefinitionFactory = entityDefinitionFactory; _dataStoragePropertyDefinitionFactory = dataStoragePropertyDefinitionFactory; _storageNameProvider = storageNameProvider; _rdbmsPersistenceModelProvider = rdbmsPersistenceModelProvider; }
public RelationLookupCommandFactory( IStorageProviderCommandFactory <IRdbmsProviderCommandExecutionContext> storageProviderCommandFactory, IDbCommandBuilderFactory dbCommandBuilderFactory, IRdbmsPersistenceModelProvider rdbmsPersistenceModelProvider, IObjectReaderFactory objectReaderFactory) { ArgumentUtility.CheckNotNull("storageProviderCommandFactory", storageProviderCommandFactory); ArgumentUtility.CheckNotNull("dbCommandBuilderFactory", dbCommandBuilderFactory); ArgumentUtility.CheckNotNull("rdbmsPersistenceModelProvider", rdbmsPersistenceModelProvider); ArgumentUtility.CheckNotNull("objectReaderFactory", objectReaderFactory); _storageProviderCommandFactory = storageProviderCommandFactory; _dbCommandBuilderFactory = dbCommandBuilderFactory; _rdbmsPersistenceModelProvider = rdbmsPersistenceModelProvider; _objectReaderFactory = objectReaderFactory; }
public override void SetUp() { base.SetUp(); _rdbmsPersistenceModelProviderStub = MockRepository.GenerateStub <IRdbmsPersistenceModelProvider>(); _rdbmsStoragePropertyDefinitionStub = MockRepository.GenerateStub <IRdbmsStoragePropertyDefinition>(); _storageSpecificExpressionResolver = new StorageSpecificExpressionResolver( _rdbmsPersistenceModelProviderStub); _classDefinition = ClassDefinitionObjectMother.CreateClassDefinition(classType: typeof(Order)); _classDefinition.SetStorageEntity( TableDefinitionObjectMother.Create( TestDomainStorageProviderDefinition, new EntityNameDefinition(null, "Order"), new EntityNameDefinition(null, "OrderView"))); }
public XElement Serialize(PropertyDefinition propertyDefinition, IRdbmsPersistenceModelProvider persistenceModelProvider) { ArgumentUtility.CheckNotNull("propertyDefinition", propertyDefinition); ArgumentUtility.CheckNotNull("persistenceModelProvider", persistenceModelProvider); var propertyType = GetPropertyType(propertyDefinition); return(new XElement( Constants.Namespace + "property", new XAttribute("name", propertyDefinition.PropertyName), new XAttribute("displayName", propertyDefinition.PropertyInfo.Name), new XAttribute("type", GetTypeName(propertyType)), new XAttribute("isNullable", propertyDefinition.IsNullable), GetMaxLenghtAttribute(propertyDefinition), _columnSerializer.Serialize(propertyDefinition, persistenceModelProvider) )); }
public void SetUp() { _rdbmsProviderDefinition = new RdbmsProviderDefinition("TestDomain", new SqlStorageObjectFactory(), "ConnectionString"); _sqlProviderFactory = new SqlStorageObjectFactory(); _persistenceExtensionStub = MockRepository.GenerateStub <IPersistenceExtension>(); _storageProviderDefinitionFinder = new StorageGroupBasedStorageProviderDefinitionFinder(DomainObjectsConfiguration.Current.Storage); _tableBuilderStub = MockRepository.GenerateStub <TableScriptBuilder> ( MockRepository.GenerateStub <ITableScriptElementFactory>(), new SqlCommentScriptElementFactory()); _viewBuilderStub = MockRepository.GenerateStub <ViewScriptBuilder> ( MockRepository.GenerateStub <IViewScriptElementFactory <TableDefinition> >(), MockRepository.GenerateStub <IViewScriptElementFactory <UnionViewDefinition> >(), MockRepository.GenerateStub <IViewScriptElementFactory <FilterViewDefinition> >(), MockRepository.GenerateStub <IViewScriptElementFactory <EmptyViewDefinition> >(), new SqlCommentScriptElementFactory()); _constraintBuilderStub = MockRepository.GenerateStub <ForeignKeyConstraintScriptBuilder> ( MockRepository.GenerateStub <IForeignKeyConstraintScriptElementFactory>(), new SqlCommentScriptElementFactory()); _indexScriptElementFactoryStub = MockRepository.GenerateStub <SqlIndexScriptElementFactory> ( MockRepository.GenerateStub <ISqlIndexDefinitionScriptElementFactory <SqlIndexDefinition> >(), MockRepository.GenerateStub <ISqlIndexDefinitionScriptElementFactory <SqlPrimaryXmlIndexDefinition> >(), MockRepository.GenerateStub <ISqlIndexDefinitionScriptElementFactory <SqlSecondaryXmlIndexDefinition> >()); _indexBuilderStub = MockRepository.GenerateStub <IndexScriptBuilder> (_indexScriptElementFactoryStub, new SqlCommentScriptElementFactory()); _synonymBuilderStub = MockRepository.GenerateStub <SynonymScriptBuilder> ( MockRepository.GenerateStub <ISynonymScriptElementFactory <TableDefinition> >(), MockRepository.GenerateStub <ISynonymScriptElementFactory <UnionViewDefinition> >(), MockRepository.GenerateStub <ISynonymScriptElementFactory <FilterViewDefinition> >(), MockRepository.GenerateStub <ISynonymScriptElementFactory <EmptyViewDefinition> >(), new SqlCommentScriptElementFactory()); _rdbmsPersistenceModelProviderStub = MockRepository.GenerateStub <IRdbmsPersistenceModelProvider>(); _storageTypeInformationProviderStub = MockRepository.GenerateStub <IStorageTypeInformationProvider>(); _dbCommandBuilderFactoryStub = MockRepository.GenerateStub <IDbCommandBuilderFactory>(); MockRepository.GeneratePartialMock <SqlSynonymScriptElementFactory>(); _storageNameProviderStub = MockRepository.GenerateStub <IStorageNameProvider>(); _infrastructureStoragePropertyDefinitionProviderStub = MockRepository.GenerateStub <IInfrastructureStoragePropertyDefinitionProvider>(); _dataStoragePropertyDefinitionFactoryStub = MockRepository.GenerateStub <IDataStoragePropertyDefinitionFactory>(); _valueStoragePropertyDefinitonFactoryStub = MockRepository.GenerateStub <IValueStoragePropertyDefinitionFactory>(); _relationStoragePropertyDefiniitonFactoryStub = MockRepository.GenerateStub <IRelationStoragePropertyDefinitionFactory>(); _methodCallTransformerProviderStub = MockRepository.GenerateStub <IMethodCallTransformerProvider>(); _resultOpertatorHandlerRegistryStub = MockRepository.GeneratePartialMock <ResultOperatorHandlerRegistry>(); _sqlQueryGeneratorStub = MockRepository.GenerateStub <ISqlQueryGenerator>(); _foreignKeyConstraintDefinitionFactoryStub = MockRepository.GenerateStub <IForeignKeyConstraintDefinitionFactory>(); _storagePropertyDefinitionResolverStub = MockRepository.GenerateStub <IStoragePropertyDefinitionResolver>(); }
public DataContainerReader( IRdbmsStoragePropertyDefinition idProperty, IRdbmsStoragePropertyDefinition timestampProperty, IColumnOrdinalProvider ordinalProvider, IRdbmsPersistenceModelProvider persistenceModelProvider, IDataContainerValidator dataContainerValidator) { ArgumentUtility.CheckNotNull("idProperty", idProperty); ArgumentUtility.CheckNotNull("timestampProperty", timestampProperty); ArgumentUtility.CheckNotNull("ordinalProvider", ordinalProvider); ArgumentUtility.CheckNotNull("persistenceModelProvider", persistenceModelProvider); ArgumentUtility.CheckNotNull("dataContainerValidator", dataContainerValidator); _idProperty = idProperty; _timestampProperty = timestampProperty; _ordinalProvider = ordinalProvider; _persistenceModelProvider = persistenceModelProvider; _dataContainerValidator = dataContainerValidator; }
protected virtual ISqlQueryGenerator CreateSqlQueryGenerator( RdbmsProviderDefinition storageProviderDefinition, IMethodCallTransformerProvider methodCallTransformerProvider, ResultOperatorHandlerRegistry resultOperatorHandlerRegistry, IRdbmsPersistenceModelProvider persistenceModelProvider) { ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition); ArgumentUtility.CheckNotNull("methodCallTransformerProvider", methodCallTransformerProvider); ArgumentUtility.CheckNotNull("resultOperatorHandlerRegistry", resultOperatorHandlerRegistry); ArgumentUtility.CheckNotNull("persistenceModelProvider", persistenceModelProvider); var generator = new UniqueIdentifierGenerator(); var resolver = CreateMappingResolver(storageProviderDefinition, persistenceModelProvider); var sqlPreparationStage = ObjectFactory.Create <DefaultSqlPreparationStage> ( ParamList.Create(methodCallTransformerProvider, resultOperatorHandlerRegistry, generator)); var mappingResolutionStage = ObjectFactory.Create <DefaultMappingResolutionStage> (ParamList.Create(resolver, generator)); var sqlGenerationStage = ObjectFactory.Create <ExtendedSqlGenerationStage> (ParamList.Empty); return(new SqlQueryGenerator(sqlPreparationStage, mappingResolutionStage, sqlGenerationStage)); }
public void SetUp() { _persistenceModelProviderStub = MockRepository.GenerateStub <IRdbmsPersistenceModelProvider>(); _resolver = new StoragePropertyDefinitionResolver(_persistenceModelProviderStub); _testModel = new RdbmsPersistenceModelLoaderTestHelper(); _fakeStorageProperyDefinition1 = SimpleStoragePropertyDefinitionObjectMother.CreateStorageProperty("Test1"); _fakeStorageProperyDefinition2 = SimpleStoragePropertyDefinitionObjectMother.CreateStorageProperty("Test2"); _fakeStorageProperyDefinition3 = SimpleStoragePropertyDefinitionObjectMother.CreateStorageProperty("Test3"); _fakeStorageProperyDefinition4 = SimpleStoragePropertyDefinitionObjectMother.CreateStorageProperty("Test4"); _fakeStorageProperyDefinition5 = SimpleStoragePropertyDefinitionObjectMother.CreateStorageProperty("Test5"); _fakeStorageProperyDefinition6 = SimpleStoragePropertyDefinitionObjectMother.CreateStorageProperty("Test6"); _fakeStorageProperyDefinition7 = SimpleStoragePropertyDefinitionObjectMother.CreateStorageProperty("Test7"); _persistenceModelProviderStub .Stub(stub => stub.GetStoragePropertyDefinition(_testModel.BaseBasePropertyDefinition)) .Return(_fakeStorageProperyDefinition1); _persistenceModelProviderStub .Stub(stub => stub.GetStoragePropertyDefinition(_testModel.BaseBasePropertyDefinition)) .Return(_fakeStorageProperyDefinition1); _persistenceModelProviderStub .Stub(stub => stub.GetStoragePropertyDefinition(_testModel.BasePropertyDefinition)) .Return(_fakeStorageProperyDefinition2); _persistenceModelProviderStub .Stub(stub => stub.GetStoragePropertyDefinition(_testModel.TablePropertyDefinition1)) .Return(_fakeStorageProperyDefinition3); _persistenceModelProviderStub .Stub(stub => stub.GetStoragePropertyDefinition(_testModel.TablePropertyDefinition2)) .Return(_fakeStorageProperyDefinition4); _persistenceModelProviderStub .Stub(stub => stub.GetStoragePropertyDefinition(_testModel.DerivedPropertyDefinition1)) .Return(_fakeStorageProperyDefinition5); _persistenceModelProviderStub .Stub(stub => stub.GetStoragePropertyDefinition(_testModel.DerivedPropertyDefinition2)) .Return(_fakeStorageProperyDefinition6); _persistenceModelProviderStub .Stub(stub => stub.GetStoragePropertyDefinition(_testModel.DerivedDerivedPropertyDefinition)) .Return(_fakeStorageProperyDefinition7); }
public override void SetUp() { base.SetUp(); _dataReaderStrictMock = MockRepository.GenerateStrictMock <IDataReader>(); _idPropertyStrictMock = MockRepository.GenerateStrictMock <IRdbmsStoragePropertyDefinition>(); _timestampPropertyStrictMock = MockRepository.GenerateStrictMock <IRdbmsStoragePropertyDefinition>(); _fileNamePropertyStrictMock = MockRepository.GenerateStrictMock <IRdbmsStoragePropertyDefinition> (); _orderPropertyStrictMock = MockRepository.GenerateStrictMock <IRdbmsStoragePropertyDefinition> (); _ordinalProviderStub = MockRepository.GenerateStub <IColumnOrdinalProvider>(); _persistenceModelProviderStub = MockRepository.GenerateStub <IRdbmsPersistenceModelProvider>(); _dataContainerValidatorStub = MockRepository.GenerateStub <IDataContainerValidator>(); _dataContainerReader = new DataContainerReader( _idPropertyStrictMock, _timestampPropertyStrictMock, _ordinalProviderStub, _persistenceModelProviderStub, _dataContainerValidatorStub); _fakeTimestamp = new object(); }
public override void SetUp() { base.SetUp(); _rdbmsPersistenceModelProviderStub = MockRepository.GenerateStub <IRdbmsPersistenceModelProvider>(); _entityDefinitionStub = MockRepository.GenerateStub <IRdbmsStorageEntityDefinition>(); _storageTypeInformationProviderStub = MockRepository.GenerateStub <IStorageTypeInformationProvider>(); _dataContainerValidatorStub = MockRepository.GenerateStub <IDataContainerValidator>(); _objectIDProperty = ObjectIDStoragePropertyDefinitionObjectMother.ObjectIDProperty; _timestampProperty = SimpleStoragePropertyDefinitionObjectMother.TimestampProperty; _entityDefinitionStub.Stub(stub => stub.ObjectIDProperty).Return(_objectIDProperty); _entityDefinitionStub.Stub(stub => stub.TimestampProperty).Return(_timestampProperty); _column1 = ColumnDefinitionObjectMother.CreateColumn("Column1"); _column2 = ColumnDefinitionObjectMother.CreateColumn("Column2"); _infrastructureStoragePropertyDefinitionProviderStub = MockRepository.GenerateStrictMock <IInfrastructureStoragePropertyDefinitionProvider> (); _factory = new ObjectReaderFactory( _rdbmsPersistenceModelProviderStub, _infrastructureStoragePropertyDefinitionProviderStub, _storageTypeInformationProviderStub, _dataContainerValidatorStub); }
protected override IStoragePropertyDefinitionResolver CreateStoragePropertyDefinitionResolver(RdbmsProviderDefinition storageProviderDefinition, IRdbmsPersistenceModelProvider persistenceModelProvider) { return(_storagePropertyDefinitionResolver ?? base.CreateStoragePropertyDefinitionResolver(storageProviderDefinition, persistenceModelProvider)); }
protected override IForeignKeyConstraintDefinitionFactory CreateForeignKeyConstraintDefinitionsFactory(RdbmsProviderDefinition storageProviderDefinition, IStorageNameProvider storageNameProvider, IRdbmsPersistenceModelProvider persistenceModelProvider, IInfrastructureStoragePropertyDefinitionProvider infrastructureStoragePropertyDefinitionProvider) { return(_foreignKeyConstraintDefinitionFactory ?? base.CreateForeignKeyConstraintDefinitionsFactory(storageProviderDefinition, storageNameProvider, persistenceModelProvider, infrastructureStoragePropertyDefinitionProvider)); }
protected override ISqlQueryGenerator CreateSqlQueryGenerator(RdbmsProviderDefinition storageProviderDefinition, IMethodCallTransformerProvider methodCallTransformerProvider, ResultOperatorHandlerRegistry resultOperatorHandlerRegistry, IRdbmsPersistenceModelProvider persistenceModelProvider) { return(_sqlQueryGenerator ?? base.CreateSqlQueryGenerator(storageProviderDefinition, methodCallTransformerProvider, resultOperatorHandlerRegistry, persistenceModelProvider)); }
public ColumnNamesAreUniqueWithinInheritanceTreeValidationRule(IRdbmsPersistenceModelProvider rdbmsPersistenceModelProvider) { ArgumentUtility.CheckNotNull("rdbmsPersistenceModelProvider", rdbmsPersistenceModelProvider); _rdbmsPersistenceModelProvider = rdbmsPersistenceModelProvider; }
public IEnumerable <XElement> Serialize(PropertyDefinition propertyDefinition, IRdbmsPersistenceModelProvider persistenceModelProvider) { ArgumentUtility.CheckNotNull("propertyDefinition", propertyDefinition); ArgumentUtility.CheckNotNull("persistenceModelProvider", persistenceModelProvider); var storagePropertyDefinition = persistenceModelProvider.GetStoragePropertyDefinition(propertyDefinition); return(storagePropertyDefinition.GetColumns().Select( columnDefinition => new XElement( Constants.Namespace + "column", new XAttribute("name", columnDefinition.Name), new XAttribute("dbType", ((StorageTypeInformation)columnDefinition.StorageTypeInfo).StorageDbType) ))); }
public StoragePropertyDefinitionResolver(IRdbmsPersistenceModelProvider persistenceModelProvider) { ArgumentUtility.CheckNotNull("persistenceModelProvider", persistenceModelProvider); _persistenceModelProvider = persistenceModelProvider; }
public StorageSpecificExpressionResolver(IRdbmsPersistenceModelProvider rdbmsPersistenceModelProvider) { ArgumentUtility.CheckNotNull("rdbmsPersistenceModelProvider", rdbmsPersistenceModelProvider); _rdbmsPersistenceModelProvider = rdbmsPersistenceModelProvider; }
public TableDefinitionFinder(IRdbmsPersistenceModelProvider rdbmsPersistenceModelProvider) { ArgumentUtility.CheckNotNull("rdbmsPersistenceModelProvider", rdbmsPersistenceModelProvider); _rdbmsPersistenceModelProvider = rdbmsPersistenceModelProvider; }