Java Code Examples for org.hibernate.persister.entity.OuterJoinLoadable#getEntityName()

The following examples show how to use org.hibernate.persister.entity.OuterJoinLoadable#getEntityName() . 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: AbstractLoadPlanBasedEntityLoader.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
protected AbstractLoadPlanBasedEntityLoader(
		OuterJoinLoadable entityPersister,
		SessionFactoryImplementor factory,
		EntityLoadQueryDetails entityLoaderQueryDetailsTemplate,
		Type uniqueKeyType,
		QueryBuildingParameters buildingParameters) {
	super( factory );
	this.entityPersister = entityPersister;
	this.uniqueKeyType = uniqueKeyType;
	this.entityName = entityPersister.getEntityName();

	this.staticLoadQuery = BatchingLoadQueryDetailsFactory.INSTANCE.makeEntityLoadQueryDetails(
			entityLoaderQueryDetailsTemplate,
			buildingParameters
	);
}
 
Example 2
Source File: AbstractEntityJoinWalker.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
protected final boolean isJoinFetchEnabledByProfile(OuterJoinLoadable persister, PropertyPath path, int propertyNumber) {
	if ( !getLoadQueryInfluencers().hasEnabledFetchProfiles() ) {
		// perf optimization
		return false;
	}

	// ugh, this stuff has to be made easier...
	final String fullPath = path.getFullPath();
	String rootPropertyName = persister.getSubclassPropertyName( propertyNumber );
	int pos = fullPath.lastIndexOf( rootPropertyName );
	String relativePropertyPath = pos >= 0
			? fullPath.substring( pos )
			: rootPropertyName;
	String fetchRole = persister.getEntityName() + "." + relativePropertyPath;

	for ( String profileName : getLoadQueryInfluencers().getEnabledFetchProfileNames() ) {
		final FetchProfile profile = getFactory().getFetchProfile( profileName );
		final Fetch fetch = profile.getFetchByRole( fetchRole );
		if ( fetch != null && Fetch.Style.JOIN == fetch.getStyle() ) {
			return true;
		}
	}
	return false;
}
 
Example 3
Source File: AbstractEntityLoader.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public AbstractEntityLoader(
		OuterJoinLoadable persister,
		Type uniqueKeyType,
		SessionFactoryImplementor factory,
		LoadQueryInfluencers loadQueryInfluencers) {
	super( factory, loadQueryInfluencers );
	this.uniqueKeyType = uniqueKeyType;
	this.entityName = persister.getEntityName();
	this.persister = persister;

}
 
Example 4
Source File: AbstractLoadPlanBasedEntityLoader.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public AbstractLoadPlanBasedEntityLoader(
		OuterJoinLoadable entityPersister,
		SessionFactoryImplementor factory,
		String[] uniqueKeyColumnNames,
		Type uniqueKeyType,
		QueryBuildingParameters buildingParameters) {
	super( factory );
	this.entityPersister = entityPersister;
	this.uniqueKeyType = uniqueKeyType;
	this.entityName = entityPersister.getEntityName();

	final LoadPlanBuildingAssociationVisitationStrategy strategy;
	if ( buildingParameters.getQueryInfluencers().getFetchGraph() != null ) {
		strategy = new FetchGraphLoadPlanBuildingStrategy(
				factory, buildingParameters.getQueryInfluencers(),
				buildingParameters.getLockOptions() != null ? buildingParameters.getLockOptions().getLockMode() : buildingParameters.getLockMode()
		);
	}
	else if ( buildingParameters.getQueryInfluencers().getLoadGraph() != null ) {
		strategy = new LoadGraphLoadPlanBuildingStrategy(
				factory, buildingParameters.getQueryInfluencers(),
				buildingParameters.getLockOptions() != null ? buildingParameters.getLockOptions().getLockMode() : buildingParameters.getLockMode()
		);
	}
	else {
		strategy = new FetchStyleLoadPlanBuildingAssociationVisitationStrategy(
				factory, buildingParameters.getQueryInfluencers(),
				buildingParameters.getLockOptions() != null ? buildingParameters.getLockOptions().getLockMode() : buildingParameters.getLockMode()
		);
	}

	final LoadPlan plan = MetamodelDrivenLoadPlanBuilder.buildRootEntityLoadPlan( strategy, entityPersister );
	this.staticLoadQuery = BatchingLoadQueryDetailsFactory.INSTANCE.makeEntityLoadQueryDetails(
			plan,
			uniqueKeyColumnNames,
			buildingParameters,
			factory
	);
}
 
Example 5
Source File: AbstractEntityLoader.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public AbstractEntityLoader(
		OuterJoinLoadable persister, 
		Type uniqueKeyType, 
		SessionFactoryImplementor factory, 
		Map enabledFilters) {
	super( factory, enabledFilters );
	this.uniqueKeyType = uniqueKeyType;
	this.entityName = persister.getEntityName();
	this.persister = persister;
	
}