Search in sources :

Example 6 with ExpandingFetchSource

use of org.hibernate.loader.plan.build.spi.ExpandingFetchSource in project hibernate-orm by hibernate.

the class AbstractLoadPlanBuildingAssociationVisitationStrategy method popFromStack.

private ExpandingFetchSource popFromStack() {
    final ExpandingFetchSource last = fetchSourceStack.removeFirst();
    log.trace("Popped fetch owner from stack : " + last);
    propertyPathStack.pop();
    return last;
}
Also used : ExpandingFetchSource(org.hibernate.loader.plan.build.spi.ExpandingFetchSource)

Example 7 with ExpandingFetchSource

use of org.hibernate.loader.plan.build.spi.ExpandingFetchSource in project hibernate-orm by hibernate.

the class AbstractLoadPlanBuildingAssociationVisitationStrategy method finishingCollectionIndex.

@Override
public void finishingCollectionIndex(CollectionIndexDefinition indexDefinition) {
    final Type indexType = indexDefinition.getType();
    if (indexType.isAnyType()) {
    // nothing to do because the index graph was not pushed in #startingCollectionIndex.
    } else if (indexType.isEntityType() || indexType.isComponentType()) {
        // todo : validate the stack?
        final ExpandingFetchSource fetchSource = popFromStack();
        if (!CollectionFetchableIndex.class.isInstance(fetchSource)) {
            throw new WalkingException("CollectionReference did not return an expected index graph : " + indexDefinition.getCollectionDefinition().getCollectionPersister().getRole());
        }
    }
    log.tracef("%s Finished collection index graph : %s", StringHelper.repeat("<<", fetchSourceStack.size()), indexDefinition.getCollectionDefinition().getCollectionPersister().getRole());
}
Also used : Type(org.hibernate.type.Type) ExpandingFetchSource(org.hibernate.loader.plan.build.spi.ExpandingFetchSource) WalkingException(org.hibernate.persister.walking.spi.WalkingException)

Aggregations

ExpandingFetchSource (org.hibernate.loader.plan.build.spi.ExpandingFetchSource)7 WalkingException (org.hibernate.persister.walking.spi.WalkingException)4 Type (org.hibernate.type.Type)3 CollectionAttributeFetch (org.hibernate.loader.plan.spi.CollectionAttributeFetch)2 AssociationAttributeDefinition (org.hibernate.persister.walking.spi.AssociationAttributeDefinition)2 FetchStrategy (org.hibernate.engine.FetchStrategy)1 ExpandingEntityIdentifierDescription (org.hibernate.loader.plan.build.spi.ExpandingEntityIdentifierDescription)1 AttributeFetch (org.hibernate.loader.plan.spi.AttributeFetch)1 CollectionReference (org.hibernate.loader.plan.spi.CollectionReference)1 CompositeAttributeFetch (org.hibernate.loader.plan.spi.CompositeAttributeFetch)1 EntityFetch (org.hibernate.loader.plan.spi.EntityFetch)1 EntityReference (org.hibernate.loader.plan.spi.EntityReference)1 EntityReturn (org.hibernate.loader.plan.spi.EntityReturn)1 FetchSource (org.hibernate.loader.plan.spi.FetchSource)1