Search in sources :

Example 1 with QueryBuildingParametersImpl

use of org.hibernate.loader.plan.exec.query.internal.QueryBuildingParametersImpl 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)1 LoadQueryInfluencers (org.hibernate.engine.spi.LoadQueryInfluencers)1 EntityJoinWalker (org.hibernate.loader.entity.EntityJoinWalker)1 QueryBuildingParametersImpl (org.hibernate.loader.plan.exec.query.internal.QueryBuildingParametersImpl)1 LoadQueryDetails (org.hibernate.loader.plan.exec.spi.LoadQueryDetails)1 LoadPlan (org.hibernate.loader.plan.spi.LoadPlan)1