Esempio n. 1
0
        public override void SetUp()
        {
            base.SetUp();

            _storageNameProviderMock                  = MockRepository.GenerateStrictMock <IStorageNameProvider>();
            _storageProviderDefinitionFinderStub      = MockRepository.GenerateStub <IStorageProviderDefinitionFinder>();
            _storageTypeInformationProviderStrictMock = MockRepository.GenerateStrictMock <IStorageTypeInformationProvider> ();

            _factory = new RelationStoragePropertyDefinitionFactory(TestDomainStorageProviderDefinition,
                                                                    false, _storageNameProviderMock, _storageTypeInformationProviderStrictMock, _storageProviderDefinitionFinderStub);

            _fakeStorageTypeInformation1 = StorageTypeInformationObjectMother.CreateStorageTypeInformation();
            _fakeStorageTypeInformation2 = StorageTypeInformationObjectMother.CreateStorageTypeInformation();
        }
Esempio n. 2
0
        public RelationStoragePropertyDefinitionFactory(
            StorageProviderDefinition storageProviderDefinition,
            bool forceClassIDColumnInForeignKeyProperties,
            IStorageNameProvider storageNameProvider,
            IStorageTypeInformationProvider storageTypeInformationProvider,
            IStorageProviderDefinitionFinder providerDefinitionFinder)
        {
            ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition);
            ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider);
            ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider);
            ArgumentUtility.CheckNotNull("providerDefinitionFinder", providerDefinitionFinder);

            _storageProviderDefinition = storageProviderDefinition;
            _forceClassIDColumnInForeignKeyProperties = forceClassIDColumnInForeignKeyProperties;
            _storageNameProvider            = storageNameProvider;
            _storageTypeInformationProvider = storageTypeInformationProvider;
            _providerDefinitionFinder       = providerDefinitionFinder;
        }
        protected virtual IRelationStoragePropertyDefinitionFactory CreateRelationStoragePropertyDefinitionFactory(
            RdbmsProviderDefinition storageProviderDefinition,
            IStorageTypeInformationProvider storageTypeInformationProvider,
            IStorageNameProvider storageNameProvider,
            IStorageProviderDefinitionFinder providerDefinitionFinder)
        {
            ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition);
            ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider);
            ArgumentUtility.CheckNotNull("providerDefinitionFinder", providerDefinitionFinder);
            ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider);

            return(new RelationStoragePropertyDefinitionFactory(
                       storageProviderDefinition,
                       false,
                       storageNameProvider,
                       storageTypeInformationProvider,
                       providerDefinitionFinder));
        }
        public virtual IPersistenceModelLoader CreatePersistenceModelLoader(
            StorageProviderDefinition storageProviderDefinition,
            IStorageProviderDefinitionFinder storageProviderDefinitionFinder)
        {
            var rdmsStorageProviderDefinition =
                ArgumentUtility.CheckNotNullAndType <RdbmsProviderDefinition> ("storageProviderDefinition", storageProviderDefinition);

            ArgumentUtility.CheckNotNull("storageProviderDefinitionFinder", storageProviderDefinitionFinder);

            var storageTypeInformationProvider    = CreateStorageTypeInformationProvider(rdmsStorageProviderDefinition);
            var storageNameProvider               = CreateStorageNameProvider(rdmsStorageProviderDefinition);
            var persistenceModelProvider          = CreateRdbmsPersistenceModelProvider(rdmsStorageProviderDefinition);
            var storagePropertyDefinitionResolver = CreateStoragePropertyDefinitionResolver(rdmsStorageProviderDefinition, persistenceModelProvider);

            var dataStoragePropertyDefinitionFactory = CreateDataStoragePropertyDefinitionFactory(
                rdmsStorageProviderDefinition,
                storageTypeInformationProvider,
                storageNameProvider,
                storageProviderDefinitionFinder);

            var infrastructureStoragePropertyDefinitionFactory = CreateInfrastructureStoragePropertyDefinitionProvider(
                rdmsStorageProviderDefinition,
                storageTypeInformationProvider,
                storageNameProvider);

            var foreignKeyConstraintDefinitionFactory = CreateForeignKeyConstraintDefinitionsFactory(
                rdmsStorageProviderDefinition,
                storageNameProvider,
                persistenceModelProvider,
                infrastructureStoragePropertyDefinitionFactory);

            var entityDefinitionFactory = CreateEntityDefinitionFactory(
                rdmsStorageProviderDefinition,
                storageNameProvider,
                infrastructureStoragePropertyDefinitionFactory,
                foreignKeyConstraintDefinitionFactory,
                storagePropertyDefinitionResolver);

            return(new RdbmsPersistenceModelLoader(
                       entityDefinitionFactory,
                       dataStoragePropertyDefinitionFactory,
                       storageNameProvider,
                       persistenceModelProvider));
        }
        protected virtual IDataStoragePropertyDefinitionFactory CreateDataStoragePropertyDefinitionFactory(
            RdbmsProviderDefinition storageProviderDefinition,
            IStorageTypeInformationProvider storageTypeInformationProvider,
            IStorageNameProvider storageNameProvider,
            IStorageProviderDefinitionFinder providerDefinitionFinder)
        {
            ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition);
            ArgumentUtility.CheckNotNull("storageNameProvider", storageNameProvider);
            ArgumentUtility.CheckNotNull("providerDefinitionFinder", providerDefinitionFinder);
            ArgumentUtility.CheckNotNull("storageTypeInformationProvider", storageTypeInformationProvider);

            var valueStoragePropertyDefinitionFactory = CreateValueStoragePropertyDefinitionFactory(
                storageProviderDefinition,
                storageTypeInformationProvider,
                storageNameProvider);

            var relationStoragePropertyDefinitionFactory = CreateRelationStoragePropertyDefinitionFactory(
                storageProviderDefinition,
                storageTypeInformationProvider,
                storageNameProvider,
                providerDefinitionFinder);

            return(new DataStoragePropertyDefinitionFactory(valueStoragePropertyDefinitionFactory, relationStoragePropertyDefinitionFactory));
        }
 protected override IRelationStoragePropertyDefinitionFactory CreateRelationStoragePropertyDefinitionFactory(RdbmsProviderDefinition storageProviderDefinition, IStorageTypeInformationProvider storageTypeInformationProvider, IStorageNameProvider storageNameProvider, IStorageProviderDefinitionFinder providerDefinitionFinder)
 {
     return(_relationStoragePropertyDefinitionFactory ?? base.CreateRelationStoragePropertyDefinitionFactory(storageProviderDefinition, storageTypeInformationProvider, storageNameProvider, providerDefinitionFinder));
 }
        public IPersistenceModelLoader CreatePersistenceModelLoader(StorageProviderDefinition storageProviderDefinition, IStorageProviderDefinitionFinder storageProviderDefinitionFinder)
        {
            ArgumentUtility.CheckNotNull("storageProviderDefinition", storageProviderDefinition);

            return(new SqlStorageObjectFactory().CreatePersistenceModelLoader(storageProviderDefinition, storageProviderDefinitionFinder));
        }
Esempio n. 8
0
 public IPersistenceModelLoader CreatePersistenceModelLoader(
     StorageProviderDefinition storageProviderDefinition, IStorageProviderDefinitionFinder storageProviderDefinitionFinder)
 {
     throw new NotImplementedException();
 }
Esempio n. 9
0
        public PersistenceModelLoader(IStorageProviderDefinitionFinder storageProviderDefinitionFinder)
        {
            ArgumentUtility.CheckNotNull("storageProviderDefinitionFinder", storageProviderDefinitionFinder);

            _storageProviderDefinitionFinder = storageProviderDefinitionFinder;
        }
Esempio n. 10
0
 public IRelationStoragePropertyDefinitionFactory CreateRelationStoragePropertyDefinitionFactory(StorageProviderDefinition storageProviderDefinition, IStorageProviderDefinitionFinder storageProviderDefinitionFinder)
 {
     throw new NotImplementedException();
 }
Esempio n. 11
0
 public void SetUp()
 {
     _storageProviderDefinitionStub = MockRepository.GenerateStub <IStorageProviderDefinitionFinder> ();
     _persistenceModelLoader        = new PersistenceModelLoader(_storageProviderDefinitionStub);
     _classDefinition = ClassDefinitionObjectMother.CreateClassDefinition(classType: typeof(Order), baseClass: null);
 }