本文整理汇总了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()
);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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 );
}
示例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 );
}
示例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 );
}
示例11: LegacyBatchingCollectionInitializer
import org.hibernate.loader.Loader; //导入依赖的package包/类
public LegacyBatchingCollectionInitializer(
QueryableCollection persister,
int[] batchSizes,
Loader[] loaders) {
super( persister );
this.batchSizes = batchSizes;
this.loaders = loaders;
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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 );
}