Java 类org.hibernate.loader.entity.EntityLoader 实例源码

项目:lams    文件:AbstractEntityPersister.java   
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()
        );
    }
}
项目:lams    文件:AbstractEntityPersister.java   
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
    );
}
项目:cacheonix-core    文件:AbstractEntityPersister.java   
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
                );
        }
    }
项目:cacheonix-core    文件:AbstractEntityPersister.java   
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 );
}
项目:webdsl    文件:BatchingEntityLoader.java   
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);
    }