Search in sources :

Example 1 with EntityJoinWalker

use of org.hibernate.loader.entity.EntityJoinWalker in project hibernate-orm by hibernate.

the class EncapsulatedCompositeAttributeResultSetProcessorTest method doCompare.

private void doCompare(SessionFactoryImplementor sf, OuterJoinLoadable persister) {
    final LoadQueryInfluencers influencers = LoadQueryInfluencers.NONE;
    final LockMode lockMode = LockMode.NONE;
    final int batchSize = 1;
    final EntityJoinWalker walker = new EntityJoinWalker(persister, persister.getKeyColumnNames(), batchSize, lockMode, sf, influencers);
    final LoadQueryDetails details = Helper.INSTANCE.buildLoadQueryDetails(persister, sf);
    compare(walker, details);
}
Also used : LoadQueryInfluencers(org.hibernate.engine.spi.LoadQueryInfluencers) LoadQueryDetails(org.hibernate.loader.plan.exec.spi.LoadQueryDetails) EntityJoinWalker(org.hibernate.loader.entity.EntityJoinWalker) LockMode(org.hibernate.LockMode)

Example 2 with EntityJoinWalker

use of org.hibernate.loader.entity.EntityJoinWalker in project hibernate-orm by hibernate.

the class LoadPlanStructureAssertionHelper method performBasicComparison.

/**
 * Performs a basic comparison.  Builds a LoadPlan for the given persister and compares it against the
 * expectations according to the Loader/Walker corollary.
 *
 * @param sf The SessionFactory
 * @param persister The entity persister for which to build a LoadPlan and compare against the Loader/Walker
 * expectations.
 */
public void performBasicComparison(SessionFactoryImplementor sf, OuterJoinLoadable persister) {
    // todo : allow these to be passed in by tests?
    final LoadQueryInfluencers influencers = LoadQueryInfluencers.NONE;
    final LockMode lockMode = LockMode.NONE;
    final int batchSize = 1;
    // legacy Loader-based contracts...
    final EntityJoinWalker walker = new EntityJoinWalker(persister, persister.getKeyColumnNames(), batchSize, lockMode, sf, influencers);
    // final EntityLoader loader = new EntityLoader( persister, lockMode, sf, influencers );
    LoadPlan plan = buildLoadPlan(sf, persister, influencers, lockMode);
    LoadQueryDetails details = BatchingLoadQueryDetailsFactory.INSTANCE.makeEntityLoadQueryDetails(plan, persister.getKeyColumnNames(), new QueryBuildingParametersImpl(influencers, batchSize, lockMode, null), sf);
    compare(walker, details);
}
Also used : LoadQueryInfluencers(org.hibernate.engine.spi.LoadQueryInfluencers) QueryBuildingParametersImpl(org.hibernate.loader.plan.exec.query.internal.QueryBuildingParametersImpl) LoadPlan(org.hibernate.loader.plan.spi.LoadPlan) LoadQueryDetails(org.hibernate.loader.plan.exec.spi.LoadQueryDetails) EntityJoinWalker(org.hibernate.loader.entity.EntityJoinWalker) LockMode(org.hibernate.LockMode)

Aggregations

LockMode (org.hibernate.LockMode)2 LoadQueryInfluencers (org.hibernate.engine.spi.LoadQueryInfluencers)2 EntityJoinWalker (org.hibernate.loader.entity.EntityJoinWalker)2 LoadQueryDetails (org.hibernate.loader.plan.exec.spi.LoadQueryDetails)2 QueryBuildingParametersImpl (org.hibernate.loader.plan.exec.query.internal.QueryBuildingParametersImpl)1 LoadPlan (org.hibernate.loader.plan.spi.LoadPlan)1