org.hibernate.loader.JoinWalker Java Examples

The following examples show how to use org.hibernate.loader.JoinWalker. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReactiveDynamicBatchingCollectionInitializer.java    From hibernate-reactive with GNU Lesser General Public License v2.1 6 votes vote down vote up
public ReactiveDynamicBatchingCollectionInitializer(
		QueryableCollection collectionPersister,
		SessionFactoryImplementor factory,
		LoadQueryInfluencers influencers) {
	super( collectionPersister, factory, influencers );

	JoinWalker walker = buildJoinWalker( collectionPersister, factory, influencers );
	initFromWalker( walker );
	this.sqlTemplate = walker.getSQLString();
	this.alias = StringHelper.generateAlias( collectionPersister.getRole(), 0 );
	postInstantiate();

	if ( LOG.isDebugEnabled() ) {
		LOG.debugf(
				"SQL-template for dynamic collection [%s] batch-fetching : %s",
				collectionPersister.getRole(),
				sqlTemplate
		);
	}
}
 
Example #2
Source File: CascadeEntityLoader.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
public CascadeEntityLoader(
		OuterJoinLoadable persister,
		CascadingAction action,
		SessionFactoryImplementor factory) throws MappingException {
	super(
			persister,
			persister.getIdentifierType(),
			factory,
			LoadQueryInfluencers.NONE
	);

	JoinWalker walker = new CascadeEntityJoinWalker(
			persister,
			action,
			factory
	);
	initFromWalker( walker );

	postInstantiate();

	if ( LOG.isDebugEnabled() ) {
		LOG.debugf( "Static select for action %s on entity %s: %s", action, entityName, getSQLString() );
	}
}
 
Example #3
Source File: OneToManyLoader.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
public OneToManyLoader(
		QueryableCollection oneToManyPersister,
		int batchSize,
		String subquery,
		SessionFactoryImplementor factory,
		LoadQueryInfluencers loadQueryInfluencers) throws MappingException {
	super( oneToManyPersister, factory, loadQueryInfluencers );

	JoinWalker walker = new OneToManyJoinWalker(
			oneToManyPersister,
			batchSize,
			subquery,
			factory,
			loadQueryInfluencers
	);
	initFromWalker( walker );

	postInstantiate();
	if ( LOG.isDebugEnabled() ) {
		LOG.debugf( "Static select for one-to-many %s: %s", oneToManyPersister.getRole(), getSQLString() );
	}
}
 
Example #4
Source File: DynamicBatchingCollectionInitializerBuilder.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
public DynamicBatchingCollectionLoader(
		QueryableCollection collectionPersister,
		SessionFactoryImplementor factory,
		LoadQueryInfluencers influencers) {
	super( collectionPersister, factory, influencers );

	JoinWalker walker = buildJoinWalker( collectionPersister, factory, influencers );
	initFromWalker( walker );
	this.sqlTemplate = walker.getSQLString();
	this.alias = StringHelper.generateAlias( collectionPersister.getRole(), 0 );
	postInstantiate();

	if ( LOG.isDebugEnabled() ) {
		LOG.debugf(
				"SQL-template for dynamic collection [%s] batch-fetching : %s",
				collectionPersister.getRole(),
				sqlTemplate
		);
	}
}
 
Example #5
Source File: BasicCollectionLoader.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
protected BasicCollectionLoader(
		QueryableCollection collectionPersister,
		int batchSize,
		String subquery,
		SessionFactoryImplementor factory,
		LoadQueryInfluencers loadQueryInfluencers) throws MappingException {
	super( collectionPersister, factory, loadQueryInfluencers );

	JoinWalker walker = new BasicCollectionJoinWalker(
			collectionPersister,
			batchSize,
			subquery,
			factory,
			loadQueryInfluencers
	);
	initFromWalker( walker );

	postInstantiate();

	if ( LOG.isDebugEnabled() ) {
		LOG.debugf( "Static select for collection %s: %s", collectionPersister.getRole(), getSQLString() );
	}
}
 
Example #6
Source File: CascadeEntityLoader.java    From cacheonix-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
public CascadeEntityLoader(
		OuterJoinLoadable persister,
		CascadingAction action,
		SessionFactoryImplementor factory) 
throws MappingException {
	super(
			persister, 
			persister.getIdentifierType(), 
			factory, 
			CollectionHelper.EMPTY_MAP
		);

	JoinWalker walker = new CascadeEntityJoinWalker(
			persister, 
			action,
			factory
		);
	initFromWalker( walker );

	postInstantiate();
	
	log.debug( "Static select for action " + action + " on entity " + entityName + ": " + getSQLString() );

}
 
Example #7
Source File: OneToManyLoader.java    From cacheonix-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
public OneToManyLoader(
		QueryableCollection oneToManyPersister, 
		int batchSize, 
		String subquery, 
		SessionFactoryImplementor factory, 
		Map enabledFilters)
throws MappingException {

	super(oneToManyPersister, factory, enabledFilters);
	
	JoinWalker walker = new OneToManyJoinWalker(
			oneToManyPersister, 
			batchSize, 
			subquery, 
			factory, 
			enabledFilters
		);
	initFromWalker( walker );

	postInstantiate();

	log.debug( "Static select for one-to-many " + oneToManyPersister.getRole() + ": " + getSQLString() );
}
 
Example #8
Source File: BasicCollectionLoader.java    From cacheonix-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
protected BasicCollectionLoader(
		QueryableCollection collectionPersister, 
		int batchSize, 
		String subquery, 
		SessionFactoryImplementor factory, 
		Map enabledFilters)
throws MappingException {
	
	super(collectionPersister, factory, enabledFilters);
	
	JoinWalker walker = new BasicCollectionJoinWalker(
			collectionPersister, 
			batchSize, 
			subquery, 
			factory, 
			enabledFilters
		);
	initFromWalker( walker );

	postInstantiate();

	log.debug( "Static select for collection " + collectionPersister.getRole() + ": " + getSQLString() );
}
 
Example #9
Source File: CollectionElementLoader.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public CollectionElementLoader(
		QueryableCollection collectionPersister,
		SessionFactoryImplementor factory,
		LoadQueryInfluencers loadQueryInfluencers) throws MappingException {
	super( factory, loadQueryInfluencers );

	this.keyType = collectionPersister.getKeyType();
	this.indexType = collectionPersister.getIndexType();
	this.persister = (OuterJoinLoadable) collectionPersister.getElementPersister();
	this.entityName = persister.getEntityName();

	JoinWalker walker = new EntityJoinWalker(
			persister,
			ArrayHelper.join(
					collectionPersister.getKeyColumnNames(),
					collectionPersister.toColumns( "index" )
			),
			1,
			LockMode.NONE,
			factory,
			loadQueryInfluencers
	);
	initFromWalker( walker );

	postInstantiate();

	if ( LOG.isDebugEnabled() ) {
		LOG.debugf( "Static select for entity %s: %s", entityName, getSQLString() );
	}

}
 
Example #10
Source File: EntityLoader.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public EntityLoader(
		OuterJoinLoadable persister, 
		String[] uniqueKey, 
		Type uniqueKeyType, 
		int batchSize, 
		LockMode lockMode,
		SessionFactoryImplementor factory, 
		Map enabledFilters) 
throws MappingException {
	super(persister, uniqueKeyType, factory, enabledFilters);

	JoinWalker walker = new EntityJoinWalker(
			persister, 
			uniqueKey, 
			batchSize, 
			lockMode, 
			factory, 
			enabledFilters
		);
	initFromWalker( walker );

	postInstantiate();

	batchLoader = batchSize > 1;
	
	log.debug( "Static select for entity " + entityName + ": " + getSQLString() );

}
 
Example #11
Source File: CollectionElementLoader.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public CollectionElementLoader(
		QueryableCollection collectionPersister,
		SessionFactoryImplementor factory, 
		Map enabledFilters) 
throws MappingException {
	super(factory, enabledFilters);

	this.keyType = collectionPersister.getKeyType();
	this.indexType = collectionPersister.getIndexType();
	this.persister = (OuterJoinLoadable) collectionPersister.getElementPersister();
	this.entityName = persister.getEntityName();
	
	JoinWalker walker = new EntityJoinWalker(
			persister, 
			ArrayHelper.join( 
					collectionPersister.getKeyColumnNames(), 
					collectionPersister.getIndexColumnNames()
				),
			1, 
			LockMode.NONE, 
			factory, 
			enabledFilters
		);
	initFromWalker( walker );

	postInstantiate();
	
	log.debug( "Static select for entity " + entityName + ": " + getSQLString() );

}