diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/SetAttributeImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/SetAttributeImpl.java index 71f10314c9..14edb928ad 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/SetAttributeImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/SetAttributeImpl.java @@ -11,6 +11,7 @@ import java.util.Set; import org.hibernate.metamodel.internal.MetadataContext; import org.hibernate.metamodel.model.domain.SetPersistentAttribute; import org.hibernate.query.hql.spi.SqmCreationState; +import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.tree.SqmJoinType; import org.hibernate.query.sqm.tree.domain.SqmSetJoin; import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmBagJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmBagJoin.java index 9685803e07..5cb6dec29f 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmBagJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmBagJoin.java @@ -8,20 +8,16 @@ package org.hibernate.query.sqm.tree.domain; import java.util.Collection; import javax.persistence.criteria.Expression; -import javax.persistence.criteria.JoinType; import javax.persistence.criteria.Predicate; -import javax.persistence.metamodel.PluralAttribute; -import javax.persistence.metamodel.SingularAttribute; -import org.hibernate.NotYetImplementedFor6Exception; import org.hibernate.metamodel.model.domain.BagPersistentAttribute; import org.hibernate.metamodel.model.domain.EntityDomainType; import org.hibernate.query.PathException; import org.hibernate.query.criteria.JpaCollectionJoin; import org.hibernate.query.criteria.JpaExpression; import org.hibernate.query.criteria.JpaPredicate; -import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.hql.spi.SqmCreationProcessingState; +import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.tree.SqmJoinType; import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.query.sqm.tree.from.SqmFrom; @@ -43,8 +39,7 @@ public class SqmBagJoin extends AbstractSqmPluralJoin, E> @Override public BagPersistentAttribute getReferencedPathSource() { - //noinspection unchecked - return (BagPersistentAttribute) super.getReferencedPathSource(); + return (BagPersistentAttribute) super.getReferencedPathSource(); } @Override @@ -85,36 +80,6 @@ public class SqmBagJoin extends AbstractSqmPluralJoin, E> // todo (6.0) : need to resolve these fetches against the element/index descriptors - @Override - public SqmSingularJoin fetch(SingularAttribute attribute) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmSingularJoin fetch(SingularAttribute attribute, JoinType jt) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmAttributeJoin fetch(PluralAttribute attribute) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmAttributeJoin fetch(PluralAttribute attribute, JoinType jt) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmAttributeJoin fetch(String attributeName) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmAttributeJoin fetch(String attributeName, JoinType jt) { - throw new NotYetImplementedFor6Exception(); - } - @Override public SqmCorrelatedBagJoin createCorrelation() { return new SqmCorrelatedBagJoin<>( this ); diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmListJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmListJoin.java index 9b98c594ad..33bd54c3e6 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmListJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmListJoin.java @@ -8,12 +8,8 @@ package org.hibernate.query.sqm.tree.domain; import java.util.List; import javax.persistence.criteria.Expression; -import javax.persistence.criteria.JoinType; import javax.persistence.criteria.Predicate; -import javax.persistence.metamodel.PluralAttribute; -import javax.persistence.metamodel.SingularAttribute; -import org.hibernate.NotYetImplementedFor6Exception; import org.hibernate.metamodel.model.domain.EntityDomainType; import org.hibernate.metamodel.model.domain.ListPersistentAttribute; import org.hibernate.query.NavigablePath; @@ -21,8 +17,8 @@ import org.hibernate.query.PathException; import org.hibernate.query.criteria.JpaExpression; import org.hibernate.query.criteria.JpaListJoin; import org.hibernate.query.criteria.JpaPredicate; -import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.hql.spi.SqmCreationProcessingState; +import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.tree.SqmJoinType; import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.query.sqm.tree.from.SqmFrom; @@ -116,36 +112,6 @@ public class SqmListJoin return new SqmTreatedListJoin( this, treatTarget, null ); } - @Override - public SqmSingularJoin fetch(SingularAttribute attribute) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmSingularJoin fetch(SingularAttribute attribute, JoinType jt) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmAttributeJoin fetch(PluralAttribute attribute) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmAttributeJoin fetch(PluralAttribute attribute, JoinType jt) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmAttributeJoin fetch(String attributeName) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmAttributeJoin fetch(String attributeName, JoinType jt) { - throw new NotYetImplementedFor6Exception(); - } - @Override public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) { //noinspection unchecked diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmSetJoin.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmSetJoin.java index 95df70839b..772930566a 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmSetJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmSetJoin.java @@ -10,10 +10,7 @@ import java.util.Set; import javax.persistence.criteria.Expression; import javax.persistence.criteria.JoinType; import javax.persistence.criteria.Predicate; -import javax.persistence.metamodel.PluralAttribute; -import javax.persistence.metamodel.SingularAttribute; -import org.hibernate.NotYetImplementedFor6Exception; import org.hibernate.metamodel.model.domain.EntityDomainType; import org.hibernate.metamodel.model.domain.SetPersistentAttribute; import org.hibernate.query.PathException; @@ -99,36 +96,9 @@ public class SqmSetJoin return new SqmTreatedSetJoin<>( this, treatTarget, null ); } - // todo (6.0) : need to resolve these fetches against the element/index descriptors - - @Override - public SqmSingularJoin fetch(SingularAttribute attribute) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmSingularJoin fetch(SingularAttribute attribute, JoinType jt) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmAttributeJoin fetch(PluralAttribute attribute) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmAttributeJoin fetch(PluralAttribute attribute, JoinType jt) { - throw new NotYetImplementedFor6Exception(); - } - @Override public SqmAttributeJoin fetch(String attributeName) { - throw new NotYetImplementedFor6Exception(); - } - - @Override - public SqmAttributeJoin fetch(String attributeName, JoinType jt) { - throw new NotYetImplementedFor6Exception(); + return fetch( attributeName, JoinType.INNER); } @Override