HHH-7841 - Redesign Loader
This commit is contained in:
parent
f3298620ee
commit
073bb53c8f
|
@ -47,32 +47,25 @@ public class AdviceHelper {
|
||||||
if ( attributeNode.getAttribute().isCollection() ) {
|
if ( attributeNode.getAttribute().isCollection() ) {
|
||||||
return new CollectionFetch(
|
return new CollectionFetch(
|
||||||
(SessionFactoryImplementor) attributeNode.entityManagerFactory().getSessionFactory(),
|
(SessionFactoryImplementor) attributeNode.entityManagerFactory().getSessionFactory(),
|
||||||
"abc-xyz", // alias
|
|
||||||
LockMode.NONE,
|
LockMode.NONE,
|
||||||
fetchOwner,
|
fetchOwner,
|
||||||
new FetchStrategy( FetchTiming.IMMEDIATE, FetchStyle.SELECT ),
|
new FetchStrategy( FetchTiming.IMMEDIATE, FetchStyle.SELECT ),
|
||||||
attributeNode.getAttributeName(),
|
attributeNode.getAttributeName()
|
||||||
null, // sql table alias
|
|
||||||
null // entityaliases
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return new EntityFetch(
|
return new EntityFetch(
|
||||||
(SessionFactoryImplementor) attributeNode.entityManagerFactory().getSessionFactory(),
|
(SessionFactoryImplementor) attributeNode.entityManagerFactory().getSessionFactory(),
|
||||||
"abc-xyz", // alias
|
|
||||||
LockMode.NONE,
|
LockMode.NONE,
|
||||||
fetchOwner,
|
fetchOwner,
|
||||||
attributeNode.getAttributeName(),
|
attributeNode.getAttributeName(),
|
||||||
new FetchStrategy( FetchTiming.IMMEDIATE, FetchStyle.SELECT ),
|
new FetchStrategy( FetchTiming.IMMEDIATE, FetchStyle.SELECT )
|
||||||
null, // sql table alias
|
|
||||||
null // entityaliases
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return new CompositeFetch(
|
return new CompositeFetch(
|
||||||
(SessionFactoryImplementor) attributeNode.entityManagerFactory().getSessionFactory(),
|
(SessionFactoryImplementor) attributeNode.entityManagerFactory().getSessionFactory(),
|
||||||
"abc-xyz", // alias
|
|
||||||
fetchOwner,
|
fetchOwner,
|
||||||
attributeNode.getAttributeName()
|
attributeNode.getAttributeName()
|
||||||
);
|
);
|
||||||
|
|
|
@ -37,12 +37,10 @@ import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||||
import org.hibernate.jpa.graph.internal.EntityGraphImpl;
|
import org.hibernate.jpa.graph.internal.EntityGraphImpl;
|
||||||
import org.hibernate.jpa.graph.internal.advisor.EntityGraphBasedLoadPlanAdvisor;
|
import org.hibernate.jpa.graph.internal.advisor.EntityGraphBasedLoadPlanAdvisor;
|
||||||
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
|
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
|
||||||
import org.hibernate.loader.DefaultEntityAliases;
|
|
||||||
import org.hibernate.loader.plan.internal.LoadPlanImpl;
|
import org.hibernate.loader.plan.internal.LoadPlanImpl;
|
||||||
import org.hibernate.loader.plan.spi.EntityReturn;
|
import org.hibernate.loader.plan.spi.EntityReturn;
|
||||||
import org.hibernate.loader.plan.spi.LoadPlan;
|
import org.hibernate.loader.plan.spi.LoadPlan;
|
||||||
import org.hibernate.loader.spi.LoadPlanAdvisor;
|
import org.hibernate.loader.spi.LoadPlanAdvisor;
|
||||||
import org.hibernate.persister.entity.Loadable;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -71,11 +69,8 @@ public class BasicGraphLoadPlanAdviceTests extends BaseEntityManagerFunctionalTe
|
||||||
return new LoadPlanImpl(
|
return new LoadPlanImpl(
|
||||||
new EntityReturn(
|
new EntityReturn(
|
||||||
sfi(),
|
sfi(),
|
||||||
"abc",
|
|
||||||
LockMode.NONE,
|
LockMode.NONE,
|
||||||
ENTIYT_NAME,
|
ENTIYT_NAME
|
||||||
"a1",
|
|
||||||
new DefaultEntityAliases( (Loadable) sfi().getEntityPersister( ENTIYT_NAME ), "1" )
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue