HHH-16767 From#getJoins throws exception if non-attribute was joined
This commit is contained in:
parent
c6ae189ca5
commit
7d0f313efe
|
@ -320,7 +320,7 @@ public abstract class AbstractSqmFrom<O,T> extends AbstractSqmPath<T> implements
|
|||
public Set<Join<T, ?>> getJoins() {
|
||||
//noinspection unchecked
|
||||
return (Set<Join<T, ?>>) (Set<?>) getSqmJoins().stream()
|
||||
.filter( sqmJoin -> ! ( sqmJoin instanceof SqmAttributeJoin && ( (SqmAttributeJoin<?, ?>) sqmJoin ).isFetched() ) )
|
||||
.filter( sqmJoin -> sqmJoin instanceof SqmAttributeJoin && !( (SqmAttributeJoin<?, ?>) sqmJoin ).isFetched() )
|
||||
.collect( Collectors.toSet() );
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ public class FromClauseTests extends BaseSqmUnitTest {
|
|||
final SqmRoot<?> sqmRoot = fromClause.getRoots().get( 0 );
|
||||
assertThat( sqmRoot, notNullValue() );
|
||||
assertThat( sqmRoot.getExplicitAlias(), is( "p" ) );
|
||||
assertThat( sqmRoot.getJoins(), hasSize( 1 ) );
|
||||
assertThat( sqmRoot.getSqmJoins(), hasSize( 1 ) );
|
||||
assertThat( sqmRoot.getSqmJoins().get( 0 ).getExplicitAlias(), is( "p2" ) );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue