1 package org.hibernate.loader.collection; 3 4 import java.util.Map ; 5 6 import org.apache.commons.logging.Log; 7 import org.apache.commons.logging.LogFactory; 8 import org.hibernate.MappingException; 9 import org.hibernate.engine.SessionFactoryImplementor; 10 import org.hibernate.loader.JoinWalker; 11 import org.hibernate.persister.collection.QueryableCollection; 12 13 22 public class OneToManyLoader extends CollectionLoader { 23 24 private static final Log log = LogFactory.getLog(OneToManyLoader.class); 25 26 public OneToManyLoader( 27 QueryableCollection oneToManyPersister, 28 SessionFactoryImplementor session, 29 Map enabledFilters) 30 throws MappingException { 31 this(oneToManyPersister, 1, session, enabledFilters); 32 } 33 34 public OneToManyLoader( 35 QueryableCollection oneToManyPersister, 36 int batchSize, 37 SessionFactoryImplementor factory, 38 Map enabledFilters) 39 throws MappingException { 40 this(oneToManyPersister, batchSize, null, factory, enabledFilters); 41 } 42 43 public OneToManyLoader( 44 QueryableCollection oneToManyPersister, 45 int batchSize, 46 String subquery, 47 SessionFactoryImplementor factory, 48 Map enabledFilters) 49 throws MappingException { 50 51 super(oneToManyPersister, factory, enabledFilters); 52 53 JoinWalker walker = new OneToManyJoinWalker( 54 oneToManyPersister, 55 batchSize, 56 subquery, 57 factory, 58 enabledFilters 59 ); 60 initFromWalker( walker ); 61 62 postInstantiate(); 63 64 log.debug( "Static select for one-to-many " + oneToManyPersister.getRole() + ": " + getSQLString() ); 65 } 66 67 } 68 | Popular Tags |