HHH-7841 - Redesign Loader

This commit is contained in:
Gail Badner 2013-04-18 14:23:33 -07:00
parent f3298620ee
commit 073bb53c8f
2 changed files with 3 additions and 15 deletions

View File

@ -47,32 +47,25 @@ public class AdviceHelper {
if ( attributeNode.getAttribute().isCollection() ) {
return new CollectionFetch(
(SessionFactoryImplementor) attributeNode.entityManagerFactory().getSessionFactory(),
"abc-xyz", // alias
LockMode.NONE,
fetchOwner,
new FetchStrategy( FetchTiming.IMMEDIATE, FetchStyle.SELECT ),
attributeNode.getAttributeName(),
null, // sql table alias
null // entityaliases
attributeNode.getAttributeName()
);
}
else {
return new EntityFetch(
(SessionFactoryImplementor) attributeNode.entityManagerFactory().getSessionFactory(),
"abc-xyz", // alias
LockMode.NONE,
fetchOwner,
attributeNode.getAttributeName(),
new FetchStrategy( FetchTiming.IMMEDIATE, FetchStyle.SELECT ),
null, // sql table alias
null // entityaliases
new FetchStrategy( FetchTiming.IMMEDIATE, FetchStyle.SELECT )
);
}
}
else {
return new CompositeFetch(
(SessionFactoryImplementor) attributeNode.entityManagerFactory().getSessionFactory(),
"abc-xyz", // alias
fetchOwner,
attributeNode.getAttributeName()
);

View File

@ -37,12 +37,10 @@ import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.jpa.graph.internal.EntityGraphImpl;
import org.hibernate.jpa.graph.internal.advisor.EntityGraphBasedLoadPlanAdvisor;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.loader.DefaultEntityAliases;
import org.hibernate.loader.plan.internal.LoadPlanImpl;
import org.hibernate.loader.plan.spi.EntityReturn;
import org.hibernate.loader.plan.spi.LoadPlan;
import org.hibernate.loader.spi.LoadPlanAdvisor;
import org.hibernate.persister.entity.Loadable;
import org.junit.Test;
@ -71,11 +69,8 @@ public class BasicGraphLoadPlanAdviceTests extends BaseEntityManagerFunctionalTe
return new LoadPlanImpl(
new EntityReturn(
sfi(),
"abc",
LockMode.NONE,
ENTIYT_NAME,
"a1",
new DefaultEntityAliases( (Loadable) sfi().getEntityPersister( ENTIYT_NAME ), "1" )
ENTIYT_NAME
)
);
}