HHH-8276 - Integrate LoadPlans into UniqueEntityLoader (PoC)

This commit is contained in:
Gail Badner 2013-09-17 17:04:27 -07:00 committed by Steve Ebersole
parent 1e79efd10a
commit ee02fafbba
2 changed files with 9 additions and 2 deletions

View File

@ -30,6 +30,7 @@ import org.hibernate.loader.plan2.spi.CompositeQuerySpace;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.persister.entity.PropertyMapping;
import org.hibernate.persister.entity.Queryable;
import org.hibernate.persister.walking.spi.AttributeDefinition;
import org.hibernate.persister.walking.spi.CompositionDefinition;
import org.hibernate.type.AssociationType;
@ -105,7 +106,9 @@ public class CompositeQuerySpaceImpl extends AbstractQuerySpace implements Compo
EntityPersister persister,
String querySpaceUid,
boolean optional) {
final boolean required = canJoinsBeRequired() && !optional;
// TODO: Queryable.isMultiTable() may be more broad than it needs to be...
final boolean isMultiTable = Queryable.class.cast( persister ).isMultiTable();
final boolean required = canJoinsBeRequired() && !isMultiTable && !optional;
final EntityQuerySpaceImpl rhs = new EntityQuerySpaceImpl(
persister,

View File

@ -31,6 +31,8 @@ import org.hibernate.loader.plan2.spi.Join;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.persister.entity.PropertyMapping;
import org.hibernate.persister.entity.Queryable;
import org.hibernate.persister.walking.spi.AssociationAttributeDefinition;
import org.hibernate.persister.walking.spi.AttributeDefinition;
import org.hibernate.persister.walking.spi.CompositionDefinition;
import org.hibernate.type.AssociationType;
@ -106,7 +108,9 @@ public class EntityQuerySpaceImpl extends AbstractQuerySpace implements Expandin
EntityPersister persister,
String querySpaceUid,
boolean optional) {
final boolean required = canJoinsBeRequired() && !optional;
// TODO: Queryable.isMultiTable() may be more broad than it needs to be...
final boolean isMultiTable = Queryable.class.cast( persister ).isMultiTable();
final boolean required = canJoinsBeRequired() && !isMultiTable && !optional;
final EntityQuerySpaceImpl rhs = new EntityQuerySpaceImpl(
persister,