当前位置: 首页>>代码示例>>Java>>正文


Java Loader类代码示例

本文整理汇总了Java中org.hibernate.loader.Loader的典型用法代码示例。如果您正苦于以下问题:Java Loader类的具体用法?Java Loader怎么用?Java Loader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Loader类属于org.hibernate.loader包,在下文中一共展示了Loader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doBatchLoad

import org.hibernate.loader.Loader; //导入依赖的package包/类
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()
		);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:BatchingEntityLoader.java

示例2: AbstractScrollableResults

import org.hibernate.loader.Loader; //导入依赖的package包/类
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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:AbstractScrollableResults.java

示例3: createBatchingEntityLoader

import org.hibernate.loader.Loader; //导入依赖的package包/类
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);
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:21,代码来源:BatchingEntityLoader.java

示例4: createBatchingOneToManyInitializer

import org.hibernate.loader.Loader; //导入依赖的package包/类
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);
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:20,代码来源:BatchingCollectionInitializer.java

示例5: createBatchingCollectionInitializer

import org.hibernate.loader.Loader; //导入依赖的package包/类
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);
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:20,代码来源:BatchingCollectionInitializer.java

示例6: AbstractScrollableResults

import org.hibernate.loader.Loader; //导入依赖的package包/类
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;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:19,代码来源:AbstractScrollableResults.java

示例7: LegacyBatchingEntityLoader

import org.hibernate.loader.Loader; //导入依赖的package包/类
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);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:LegacyBatchingEntityLoaderBuilder.java

示例8: PaddedBatchingEntityLoader

import org.hibernate.loader.Loader; //导入依赖的package包/类
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 );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:PaddedBatchingEntityLoaderBuilder.java

示例9: createRealBatchingCollectionInitializer

import org.hibernate.loader.Loader; //导入依赖的package包/类
@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 );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:LegacyBatchingCollectionInitializerBuilder.java

示例10: createRealBatchingOneToManyInitializer

import org.hibernate.loader.Loader; //导入依赖的package包/类
@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 );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:LegacyBatchingCollectionInitializerBuilder.java

示例11: LegacyBatchingCollectionInitializer

import org.hibernate.loader.Loader; //导入依赖的package包/类
public LegacyBatchingCollectionInitializer(
		QueryableCollection persister,
		int[] batchSizes,
		Loader[] loaders) {
	super( persister );
	this.batchSizes = batchSizes;
	this.loaders = loaders;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:LegacyBatchingCollectionInitializerBuilder.java

示例12: createRealBatchingCollectionInitializer

import org.hibernate.loader.Loader; //导入依赖的package包/类
@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 );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:PaddedBatchingCollectionInitializerBuilder.java

示例13: createRealBatchingOneToManyInitializer

import org.hibernate.loader.Loader; //导入依赖的package包/类
@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 );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:PaddedBatchingCollectionInitializerBuilder.java

示例14: createRealBatchingCollectionInitializer

import org.hibernate.loader.Loader; //导入依赖的package包/类
@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 );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:LegacyBatchingCollectionInitializerBuilder.java

示例15: createRealBatchingOneToManyInitializer

import org.hibernate.loader.Loader; //导入依赖的package包/类
@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 );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:LegacyBatchingCollectionInitializerBuilder.java


注:本文中的org.hibernate.loader.Loader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。