private EntityLoader getAppropriateUniqueKeyLoader(String propertyName, SessionImplementor session) { final boolean useStaticLoader = !session.getLoadQueryInfluencers().hasEnabledFilters() && !session.getLoadQueryInfluencers().hasEnabledFetchProfiles() && propertyName.indexOf('.')<0; //ugly little workaround for fact that createUniqueKeyLoaders() does not handle component properties if ( useStaticLoader ) { return ( EntityLoader ) uniqueKeyLoaders.get( propertyName ); } else { return createUniqueKeyLoader( propertyMapping.toType( propertyName ), propertyMapping.toColumns( propertyName ), session.getLoadQueryInfluencers() ); } }
private EntityLoader createUniqueKeyLoader( Type uniqueKeyType, String[] columns, LoadQueryInfluencers loadQueryInfluencers) { if ( uniqueKeyType.isEntityType() ) { String className = ( ( EntityType ) uniqueKeyType ).getAssociatedEntityName(); uniqueKeyType = getFactory().getEntityPersister( className ).getIdentifierType(); } return new EntityLoader( this, columns, uniqueKeyType, 1, LockMode.NONE, getFactory(), loadQueryInfluencers ); }
private EntityLoader getAppropriateUniqueKeyLoader(String propertyName, Map enabledFilters) { final boolean useStaticLoader = ( enabledFilters == null || enabledFilters.isEmpty() ) && propertyName.indexOf('.')<0; //ugly little workaround for fact that createUniqueKeyLoaders() does not handle component properties if ( useStaticLoader ) { return (EntityLoader) uniqueKeyLoaders.get( propertyName ); } else { return createUniqueKeyLoader( propertyMapping.toType(propertyName), propertyMapping.toColumns(propertyName), enabledFilters ); } }
private EntityLoader createUniqueKeyLoader(Type uniqueKeyType, String[] columns, Map enabledFilters) { if ( uniqueKeyType.isEntityType() ) { String className = ( ( EntityType ) uniqueKeyType ).getAssociatedEntityName(); uniqueKeyType = getFactory().getEntityPersister( className ).getIdentifierType(); } return new EntityLoader( this, columns, uniqueKeyType, 1, LockMode.NONE, getFactory(), enabledFilters ); }
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); }