protected Object doBatchLoad( Serializable id, Loader loaderToUse, SessionImplementor session, Serializable[] ids, Object optionalObject, LockOptions lockOptions) { if ( log.isDebugEnabled() ) { log.debugf( "Batch loading entity: %s", MessageHelper.infoString( persister, ids, session.getFactory() ) ); } QueryParameters qp = buildQueryParameters( id, ids, optionalObject, lockOptions ); try { final List results = loaderToUse.doQueryAndInitializeNonLazyCollections( session, qp, false ); log.debug( "Done entity batch load" ); return getObjectFromList(results, id, session); } catch ( SQLException sqle ) { throw session.getFactory().getSQLExceptionHelper().convert( sqle, "could not load an entity batch: " + MessageHelper.infoString( persister(), ids, session.getFactory() ), loaderToUse.getSQLString() ); } }
protected AbstractScrollableResults( ResultSet rs, PreparedStatement ps, SessionImplementor sess, Loader loader, QueryParameters queryParameters, Type[] types, HolderInstantiator holderInstantiator) { this.resultSet=rs; this.ps=ps; this.session = sess; this.loader = loader; this.queryParameters = queryParameters; this.types = types; this.holderInstantiator = holderInstantiator!=null && holderInstantiator.isRequired() ? holderInstantiator : null; }
public static UniqueEntityLoader createBatchingEntityLoader( final OuterJoinLoadable persister, final int maxBatchSize, final LockMode lockMode, final SessionFactoryImplementor factory, final Map enabledFilters) throws MappingException { 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 EntityLoader(persister, batchSizesToCreate[i], lockMode, factory, enabledFilters); } return new BatchingEntityLoader(persister, batchSizesToCreate, loadersToCreate); } else { return new EntityLoader(persister, lockMode, factory, enabledFilters); } }
public static CollectionInitializer createBatchingOneToManyInitializer( final QueryableCollection persister, final int maxBatchSize, final SessionFactoryImplementor factory, final Map enabledFilters) throws MappingException { 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); } }
public static CollectionInitializer createBatchingCollectionInitializer( final QueryableCollection persister, final int maxBatchSize, final SessionFactoryImplementor factory, final Map enabledFilters) throws MappingException { 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 BasicCollectionLoader(persister, batchSizesToCreate[i], factory, enabledFilters); } return new BatchingCollectionInitializer(persister, batchSizesToCreate, loadersToCreate); } else { return new BasicCollectionLoader(persister, factory, enabledFilters); } }
public AbstractScrollableResults( ResultSet rs, PreparedStatement ps, SessionImplementor sess, Loader loader, QueryParameters queryParameters, Type[] types, HolderInstantiator holderInstantiator) throws MappingException { this.resultSet=rs; this.ps=ps; this.session = sess; this.loader = loader; this.queryParameters = queryParameters; this.types = types; this.holderInstantiator = holderInstantiator!=null && holderInstantiator.isRequired() ? holderInstantiator : null; }
public LegacyBatchingEntityLoader( OuterJoinLoadable persister, int maxBatchSize, LockMode lockMode, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) { super( persister ); this.batchSizes = ArrayHelper.getBatchSizes( maxBatchSize ); this.loaders = new Loader[ batchSizes.length ]; for ( int i = 0; i < batchSizes.length; i++ ) { this.loaders[i] = new EntityLoader( persister, batchSizes[i], lockMode, factory, loadQueryInfluencers); } }
public LegacyBatchingEntityLoader( OuterJoinLoadable persister, int maxBatchSize, LockOptions lockOptions, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) { super( persister ); this.batchSizes = ArrayHelper.getBatchSizes( maxBatchSize ); this.loaders = new Loader[ batchSizes.length ]; for ( int i = 0; i < batchSizes.length; i++ ) { this.loaders[i] = new EntityLoader( persister, batchSizes[i], lockOptions, factory, loadQueryInfluencers); } }
public PaddedBatchingEntityLoader( OuterJoinLoadable persister, int maxBatchSize, LockMode lockMode, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) { super( persister ); this.batchSizes = ArrayHelper.getBatchSizes( maxBatchSize ); this.loaders = new Loader[ batchSizes.length ]; for ( int i = 0; i < batchSizes.length; i++ ) { this.loaders[i] = new EntityLoader( persister, batchSizes[i], lockMode, factory, loadQueryInfluencers); } validate( maxBatchSize ); }
public PaddedBatchingEntityLoader( OuterJoinLoadable persister, int maxBatchSize, LockOptions lockOptions, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) { super( persister ); this.batchSizes = ArrayHelper.getBatchSizes( maxBatchSize ); this.loaders = new Loader[ batchSizes.length ]; for ( int i = 0; i < batchSizes.length; i++ ) { this.loaders[i] = new EntityLoader( persister, batchSizes[i], lockOptions, factory, loadQueryInfluencers); } validate( maxBatchSize ); }
@Override protected CollectionInitializer createRealBatchingCollectionInitializer( QueryableCollection persister, int maxBatchSize, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) throws MappingException { int[] batchSizes = ArrayHelper.getBatchSizes( maxBatchSize ); Loader[] loaders = new Loader[ batchSizes.length ]; for ( int i = 0; i < batchSizes.length; i++ ) { loaders[i] = new BasicCollectionLoader( persister, batchSizes[i], factory, loadQueryInfluencers ); } return new LegacyBatchingCollectionInitializer( persister, batchSizes, loaders ); }
@Override protected 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 ); }
public LegacyBatchingCollectionInitializer( QueryableCollection persister, int[] batchSizes, Loader[] loaders) { super( persister ); this.batchSizes = batchSizes; this.loaders = loaders; }
@Override public CollectionInitializer createRealBatchingCollectionInitializer( QueryableCollection persister, int maxBatchSize, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) throws MappingException { int[] batchSizes = ArrayHelper.getBatchSizes( maxBatchSize ); Loader[] loaders = new Loader[ batchSizes.length ]; for ( int i = 0; i < batchSizes.length; i++ ) { loaders[i] = new BasicCollectionLoader( persister, batchSizes[i], factory, loadQueryInfluencers ); } return new PaddedBatchingCollectionInitializer( persister, batchSizes, loaders ); }
@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 PaddedBatchingCollectionInitializer( persister, batchSizes, loaders ); }
@Override public CollectionInitializer createRealBatchingCollectionInitializer( QueryableCollection persister, int maxBatchSize, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) throws MappingException { int[] batchSizes = ArrayHelper.getBatchSizes( maxBatchSize ); Loader[] loaders = new Loader[ batchSizes.length ]; for ( int i = 0; i < batchSizes.length; i++ ) { loaders[i] = new BasicCollectionLoader( persister, batchSizes[i], factory, loadQueryInfluencers ); } return new LegacyBatchingCollectionInitializer( persister, batchSizes, loaders ); }
@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 ); }
public FetchingScrollableResultsImpl( ResultSet rs, PreparedStatement ps, SessionImplementor sess, Loader loader, QueryParameters queryParameters, Type[] types, HolderInstantiator holderInstantiator) throws MappingException { super( rs, ps, sess, loader, queryParameters, types, holderInstantiator ); }
public ScrollableResultsImpl( ResultSet rs, PreparedStatement ps, SessionImplementor sess, Loader loader, QueryParameters queryParameters, Type[] types, HolderInstantiator holderInstantiator) throws MappingException { super( rs, ps, sess, loader, queryParameters, types, holderInstantiator ); }
public static BatchingEntityLoader createBatchingEntityLoader( final OuterJoinLoadable persister, final SessionFactoryImplementor factory) throws MappingException { int[] batchSizesToCreate = ArrayHelper.getBatchSizes(DEFAULT_MAX_BATCH_SIZE); //System.out.print("created loader"); Loader[] loadersToCreate = new Loader[ batchSizesToCreate.length ]; for ( int i=0; i<batchSizesToCreate.length; i++ ) { loadersToCreate[i] = new EntityLoader(persister, batchSizesToCreate[i], LockMode.NONE, factory, LoadQueryInfluencers.NONE); // System.out.print(", " + batchSizesToCreate[i]); } // org.webdsl.logging.Logger.info(); return new BatchingEntityLoader(persister, batchSizesToCreate, loadersToCreate); }
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 ); }
public static BatchingCollectionInitializer createBatchingCollectionInitializer( 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 BasicCollectionLoader( persister, batchSizesToCreate[i], factory, loadQueryInfluencers ); } return new BatchingCollectionInitializer(persister, batchSizesToCreate, loadersToCreate, maxBatchSize); }
public PaddedBatchingCollectionInitializer(QueryableCollection persister, int[] batchSizes, Loader[] loaders) { super( persister ); this.batchSizes = batchSizes; this.loaders = loaders; }
protected Loader getLoader() { return loader; }
public BatchingEntityLoader(EntityPersister persister, int[] batchSizes, Loader[] loaders) { this.batchSizes = batchSizes; this.loaders = loaders; this.persister = persister; idType = persister.getIdentifierType(); }
public BatchingCollectionInitializer(CollectionPersister collPersister, int[] batchSizes, Loader[] loaders) { this.loaders = loaders; this.batchSizes = batchSizes; this.collectionPersister = collPersister; }
public BatchingCollectionInitializer(CollectionPersister collPersister, int[] batchSizes, Loader[] loaders, int maxBatchSizeCfg) { this.loaders = loaders; this.batchSizes = batchSizes; this.collectionPersister = collPersister; this.maxBatchSizeCfg = maxBatchSizeCfg; }
public Loader[] getLoaders() { return loaders; }
/** * Constructs a FetchingScrollableResultsImpl. * * @param rs The scrollable result set * @param ps The prepared statement used to obtain the result set * @param sess The originating session * @param loader The loader * @param queryParameters query parameters * @param types The result types * @param holderInstantiator Ugh */ public FetchingScrollableResultsImpl( ResultSet rs, PreparedStatement ps, SessionImplementor sess, Loader loader, QueryParameters queryParameters, Type[] types, HolderInstantiator holderInstantiator) { super( rs, ps, sess, loader, queryParameters, types, holderInstantiator ); }
/** * Constructs a ScrollableResultsImpl using the specified information. * * @param rs The scrollable result set * @param ps The prepared statement used to obtain the result set * @param sess The originating session * @param loader The loader * @param queryParameters query parameters * @param types The result types * @param holderInstantiator Ugh */ public ScrollableResultsImpl( ResultSet rs, PreparedStatement ps, SessionImplementor sess, Loader loader, QueryParameters queryParameters, Type[] types, HolderInstantiator holderInstantiator) { super( rs, ps, sess, loader, queryParameters, types, holderInstantiator ); }