Skip to content

Commit

Permalink
Fix SmqBagJoin, SqmSetJoin and SqmListJoin throwing NotYetImplemented…
Browse files Browse the repository at this point in the history
…For6Exception
  • Loading branch information
dreab8 committed May 27, 2021
1 parent cbeedd1 commit 629b318
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 103 deletions.
Expand Up @@ -11,6 +11,7 @@
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;
Expand Down
Expand Up @@ -8,20 +8,16 @@

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;
Expand All @@ -43,8 +39,7 @@ public SqmBagJoin(

@Override
public BagPersistentAttribute<O,E> getReferencedPathSource() {
//noinspection unchecked
return (BagPersistentAttribute) super.getReferencedPathSource();
return (BagPersistentAttribute<O,E>) super.getReferencedPathSource();
}

@Override
Expand Down Expand Up @@ -85,36 +80,6 @@ public SqmBagJoin<O, E> on(Predicate... restrictions) {

// todo (6.0) : need to resolve these fetches against the element/index descriptors

@Override
public <A> SqmSingularJoin<E, A> fetch(SingularAttribute<? super E, A> attribute) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <A> SqmSingularJoin<E,A> fetch(SingularAttribute<? super E, A> attribute, JoinType jt) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <F> SqmAttributeJoin<E,F> fetch(PluralAttribute<? super E, ?, F> attribute) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <F> SqmAttributeJoin<E,F> fetch(PluralAttribute<? super E, ?, F> attribute, JoinType jt) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <X,Y> SqmAttributeJoin<X,Y> fetch(String attributeName) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <X,Y> SqmAttributeJoin<X,Y> fetch(String attributeName, JoinType jt) {
throw new NotYetImplementedFor6Exception();
}

@Override
public SqmCorrelatedBagJoin<O, E> createCorrelation() {
return new SqmCorrelatedBagJoin<>( this );
Expand Down
Expand Up @@ -8,21 +8,17 @@

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;
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;
Expand Down Expand Up @@ -116,36 +112,6 @@ public <S extends E> SqmTreatedListJoin<O,E,S> treatAs(EntityDomainType<S> treat
return new SqmTreatedListJoin( this, treatTarget, null );
}

@Override
public <A> SqmSingularJoin<E, A> fetch(SingularAttribute<? super E, A> attribute) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <A> SqmSingularJoin<E,A> fetch(SingularAttribute<? super E, A> attribute, JoinType jt) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <F> SqmAttributeJoin<E,F> fetch(PluralAttribute<? super E, ?, F> attribute) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <F> SqmAttributeJoin<E,F> fetch(PluralAttribute<? super E, ?, F> attribute, JoinType jt) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <X,Y> SqmAttributeJoin<X,Y> fetch(String attributeName) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <X,Y> SqmAttributeJoin<X,Y> fetch(String attributeName, JoinType jt) {
throw new NotYetImplementedFor6Exception();
}

@Override
public SqmAttributeJoin makeCopy(SqmCreationProcessingState creationProcessingState) {
//noinspection unchecked
Expand Down
Expand Up @@ -10,10 +10,7 @@
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;
Expand Down Expand Up @@ -99,36 +96,9 @@ public <S extends E> SqmTreatedSetJoin<O,E,S> treatAs(EntityDomainType<S> treatT
return new SqmTreatedSetJoin<>( this, treatTarget, null );
}

// todo (6.0) : need to resolve these fetches against the element/index descriptors

@Override
public <A> SqmSingularJoin<E, A> fetch(SingularAttribute<? super E, A> attribute) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <A> SqmSingularJoin<E, A> fetch(SingularAttribute<? super E, A> attribute, JoinType jt) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <F> SqmAttributeJoin<E, F> fetch(PluralAttribute<? super E, ?, F> attribute) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <F> SqmAttributeJoin<E, F> fetch(PluralAttribute<? super E, ?, F> attribute, JoinType jt) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <X, Y> SqmAttributeJoin<X, Y> fetch(String attributeName) {
throw new NotYetImplementedFor6Exception();
}

@Override
public <X, Y> SqmAttributeJoin<X, Y> fetch(String attributeName, JoinType jt) {
throw new NotYetImplementedFor6Exception();
return fetch( attributeName, JoinType.INNER);
}

@Override
Expand Down

0 comments on commit 629b318

Please sign in to comment.