code: public UniqueEntityLoader buildLoader(
  			OuterJoinLoadable persister,
  			int batchSize,
  			LockMode lockMode,
  			SessionFactoryImplementor factory,
  			LoadQueryInfluencers influencers,
  			BatchableEntityLoaderBuilder innerEntityLoaderBuilder) {
  		if ( batchSize <= 1 ) {
  			// no batching
  			return buildNonBatchingLoader( persister, lockMode, factory, influencers, innerEntityLoaderBuilder );
  		}
  		return buildBatchingLoader( persister, batchSize, lockMode, factory, influencers, innerEntityLoaderBuilder );
  	}
docs: Builds a batch-fetch capable loader based on the given persister, lock-mode, etc.
  
  @param persister The entity persister
  @param batchSize The maximum number of ids to batch-fetch at once
  @param lockMode The lock mode
  @param factory The SessionFactory
  @param influencers Any influencers that should affect the built query
  @param innerEntityLoaderBuilder Builder of the entity loader receiving the subset of batches
  
  @return The loader.