org.hibernate.loader.collection.OneToManyLoader Java Examples
The following examples show how to use
org.hibernate.loader.collection.OneToManyLoader.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LegacyBatchingCollectionInitializerBuilder.java From lams with GNU General Public License v2.0 | 5 votes |
@Override public CollectionInitializer createRealBatchingOneToManyInitializer( QueryableCollection persister, int maxBatchSize, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) throws MappingException { final int[] batchSizes = ArrayHelper.getBatchSizes( maxBatchSize ); final Loader[] loaders = new Loader[ batchSizes.length ]; for ( int i = 0; i < batchSizes.length; i++ ) { loaders[i] = new OneToManyLoader( persister, batchSizes[i], factory, loadQueryInfluencers ); } return new LegacyBatchingCollectionInitializer( persister, batchSizes, loaders ); }
Example #2
Source File: BatchingCollectionInitializer.java From webdsl with Apache License 2.0 | 5 votes |
public static BatchingCollectionInitializer createBatchingOneToManyInitializer( final QueryableCollection persister, final int maxBatchSize, final SessionFactoryImplementor factory, final LoadQueryInfluencers loadQueryInfluencers) throws MappingException { int[] batchSizesToCreate = ArrayHelper.getBatchSizes(maxBatchSize > DEFAULT_MAX_BATCH_SIZE ? maxBatchSize : DEFAULT_MAX_BATCH_SIZE); Loader[] loadersToCreate = new Loader[ batchSizesToCreate.length ]; for ( int i=0; i<batchSizesToCreate.length; i++ ) { loadersToCreate[i] = new OneToManyLoader( persister, batchSizesToCreate[i], factory, loadQueryInfluencers ); } return new BatchingCollectionInitializer( persister, batchSizesToCreate, loadersToCreate, maxBatchSize ); }