## org.hibernate.loader.collection
Class BatchingCollectionInitializer

    java.lang.Object
      org.hibernate.loader.collection.BatchingCollectionInitializer

All Implemented Interfaces:
  CollectionInitializer

    public class BatchingCollectionInitializer

extends Object
implements CollectionInitializer

"Batch" loads collections, using multiple foreign key values in the SQL `where` clause.

Author:
  Gavin King
See Also:
  `BasicCollectionLoader`, `OneToManyLoader`

Constructor Summary
`BatchingCollectionInitializer(CollectionPersister collPersister, int[] batchSizes, Loader[] loaders)`

Method Summary
`static CollectionInitializer` `createBatchingCollectionInitializer(QueryableCollection persister, int maxBatchSize, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers)`
`static CollectionInitializer` `createBatchingOneToManyInitializer(QueryableCollection persister, int maxBatchSize, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers)`
`int[]` `getBatchSizes()`
`CollectionPersister` `getCollectionPersister()`
`Loader[]` `getLoaders()`
`void` `initialize(Serializable id, SessionImplementor session)` Initialize the given collection

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### BatchingCollectionInitializer

    public BatchingCollectionInitializer(CollectionPersister collPersister,
                                         int[] batchSizes,
                                         Loader[] loaders)

Method Detail

### getCollectionPersister

    public CollectionPersister getCollectionPersister()

### getLoaders

    public Loader[] getLoaders()

### getBatchSizes

    public int[] getBatchSizes()

### initialize

    public void initialize(Serializable id,
                           SessionImplementor session)
                    throws HibernateException

  Description copied from interface: `CollectionInitializer`
  Initialize the given collection

  Specified by:
    `initialize` in interface `CollectionInitializer`
  Throws:
    `HibernateException`

### createBatchingOneToManyInitializer

    public static CollectionInitializer createBatchingOneToManyInitializer(QueryableCollection persister,
                                                                           int maxBatchSize,
                                                                           SessionFactoryImplementor factory,
                                                                           LoadQueryInfluencers loadQueryInfluencers)
                                                                    throws MappingException

  Throws:
    `MappingException`

### createBatchingCollectionInitializer

    public static CollectionInitializer createBatchingCollectionInitializer(QueryableCollection persister,
                                                                            int maxBatchSize,
                                                                            SessionFactoryImplementor factory,
                                                                            LoadQueryInfluencers loadQueryInfluencers)
                                                                     throws MappingException

  Throws:
    `MappingException`

Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.