Java 类org.hibernate.loader.Loader 实例源码

项目:lams    文件:BatchingEntityLoader.java   
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()
        );
    }
}
项目:lams    文件:BatchingEntityLoader.java   
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()
        );
    }
}
项目:lams    文件:AbstractScrollableResults.java   
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;
}
项目:cacheonix-core    文件:BatchingEntityLoader.java   
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);
    }
}
项目:cacheonix-core    文件:BatchingCollectionInitializer.java   
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);
    }
}
项目:cacheonix-core    文件:BatchingCollectionInitializer.java   
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);
    }
}
项目:cacheonix-core    文件:AbstractScrollableResults.java   
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;
}
项目:lams    文件:LegacyBatchingEntityLoaderBuilder.java   
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);
    }
}
项目:lams    文件:LegacyBatchingEntityLoaderBuilder.java   
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);
    }
}
项目:lams    文件:PaddedBatchingEntityLoaderBuilder.java   
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 );
}
项目:lams    文件:PaddedBatchingEntityLoaderBuilder.java   
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 );
}
项目:lams    文件:LegacyBatchingCollectionInitializerBuilder.java   
@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 );
}
项目:lams    文件:LegacyBatchingCollectionInitializerBuilder.java   
@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 );
}
项目:lams    文件:LegacyBatchingCollectionInitializerBuilder.java   
public LegacyBatchingCollectionInitializer(
        QueryableCollection persister,
        int[] batchSizes,
        Loader[] loaders) {
    super( persister );
    this.batchSizes = batchSizes;
    this.loaders = loaders;
}
项目:lams    文件:PaddedBatchingCollectionInitializerBuilder.java   
@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 );
}
项目:lams    文件:PaddedBatchingCollectionInitializerBuilder.java   
@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 );
}
项目:lams    文件:LegacyBatchingCollectionInitializerBuilder.java   
@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 );
}
项目:lams    文件:LegacyBatchingCollectionInitializerBuilder.java   
@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 );
}
项目:lams    文件:LegacyBatchingCollectionInitializerBuilder.java   
public LegacyBatchingCollectionInitializer(
        QueryableCollection persister,
        int[] batchSizes,
        Loader[] loaders) {
    super( persister );
    this.batchSizes = batchSizes;
    this.loaders = loaders;
}
项目:cacheonix-core    文件:FetchingScrollableResultsImpl.java   
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 );
}
项目:cacheonix-core    文件:ScrollableResultsImpl.java   
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 );
}
项目:webdsl    文件:BatchingEntityLoader.java   
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);
    }
项目:webdsl    文件:BatchingCollectionInitializer.java   
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 );
}
项目:webdsl    文件:BatchingCollectionInitializer.java   
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);
}
项目:lams    文件:PaddedBatchingCollectionInitializerBuilder.java   
public PaddedBatchingCollectionInitializer(QueryableCollection persister, int[] batchSizes, Loader[] loaders) {
    super( persister );

    this.batchSizes = batchSizes;
    this.loaders = loaders;
}
项目:lams    文件:AbstractScrollableResults.java   
protected Loader getLoader() {
    return loader;
}
项目:cacheonix-core    文件:BatchingEntityLoader.java   
public BatchingEntityLoader(EntityPersister persister, int[] batchSizes, Loader[] loaders) {
    this.batchSizes = batchSizes;
    this.loaders = loaders;
    this.persister = persister;
    idType = persister.getIdentifierType();
}
项目:cacheonix-core    文件:BatchingCollectionInitializer.java   
public BatchingCollectionInitializer(CollectionPersister collPersister, int[] batchSizes, Loader[] loaders) {
    this.loaders = loaders;
    this.batchSizes = batchSizes;
    this.collectionPersister = collPersister;
}
项目:cacheonix-core    文件:AbstractScrollableResults.java   
protected Loader getLoader() {
    return loader;
}
项目:webdsl    文件:BatchingEntityLoader.java   
public BatchingEntityLoader(EntityPersister persister, int[] batchSizes, Loader[] loaders) {
    this.batchSizes = batchSizes;
    this.loaders = loaders;
    this.persister = persister;
    idType = persister.getIdentifierType();
}
项目:webdsl    文件:BatchingCollectionInitializer.java   
public BatchingCollectionInitializer(CollectionPersister collPersister, int[] batchSizes, Loader[] loaders, int maxBatchSizeCfg) {
    this.loaders = loaders;
    this.batchSizes = batchSizes;
    this.collectionPersister = collPersister;
    this.maxBatchSizeCfg = maxBatchSizeCfg;
}
项目:webdsl    文件:BatchingCollectionInitializer.java   
public Loader[] getLoaders() {
    return loaders;
}
项目:lams    文件:FetchingScrollableResultsImpl.java   
/**
 * 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 );
}
项目:lams    文件:ScrollableResultsImpl.java   
/**
 * 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 );
}