コード例 #1
0
        public static ICollectionInitializer CreateBatchingOneToManyInitializer(OneToManyPersister persister, int maxBatchSize,
                                                                                ISessionFactoryImplementor factory,
                                                                                IDictionary <string, IFilter> enabledFilters)
        {
            if (maxBatchSize > 1)
            {
                int[]    batchSizesToCreate = ArrayHelper.GetBatchSizes(maxBatchSize);
                Loader[] loadersToCreate    = new Loader[batchSizesToCreate.Length];
                for (int i = 0; i < batchSizesToCreate.Length; i++)
                {
                    loadersToCreate[i] = new OneToManyLoader(persister, batchSizesToCreate[i], factory, enabledFilters);
                }

                return(new BatchingCollectionInitializer(persister, batchSizesToCreate, loadersToCreate));
            }
            else
            {
                return(new OneToManyLoader(persister, factory, enabledFilters));
            }
        }
コード例 #2
0
		public static ICollectionInitializer CreateBatchingOneToManyInitializer(OneToManyPersister persister, int maxBatchSize,
		                                                                        ISessionFactoryImplementor factory,
		                                                                        IDictionary<string, IFilter> enabledFilters)
		{
			if (maxBatchSize > 1)
			{
				int[] batchSizesToCreate = ArrayHelper.GetBatchSizes(maxBatchSize);
				Loader[] loadersToCreate = new Loader[batchSizesToCreate.Length];
				for (int i = 0; i < batchSizesToCreate.Length; i++)
				{
					loadersToCreate[i] = new OneToManyLoader(persister, batchSizesToCreate[i], factory, enabledFilters);
				}

				return new BatchingCollectionInitializer(persister, batchSizesToCreate, loadersToCreate);
			}
			else
			{
				return new OneToManyLoader(persister, factory, enabledFilters);
			}
		}