diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/FromImplementor.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/FromImplementor.java index 26c580e7dc..0aefb558de 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/FromImplementor.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/FromImplementor.java @@ -22,8 +22,4 @@ public interface FromImplementor extends PathImplementor, From { FromImplementor correlateTo(CriteriaSubqueryImpl subquery); void prepareCorrelationDelegate(FromImplementor parent); FromImplementor getCorrelationParent(); - - default boolean shouldBeRendered(){ - return true; - } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/QueryStructure.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/QueryStructure.java index 16a097711b..df54e9c98f 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/QueryStructure.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/QueryStructure.java @@ -336,13 +336,11 @@ public class QueryStructure implements Serializable { } for ( Join join : joins ) { - if ( ((FromImplementor) join).shouldBeRendered() ) { - ((FromImplementor) join).prepareAlias( renderingContext ); - jpaqlQuery.append( renderJoinType( join.getJoinType() ) ) - .append( ((FromImplementor) join).renderTableExpression( renderingContext ) ); - renderJoins( jpaqlQuery, renderingContext, join.getJoins() ); - renderFetches( jpaqlQuery, renderingContext, join.getFetches() ); - } + ( (FromImplementor) join ).prepareAlias( renderingContext ); + jpaqlQuery.append( renderJoinType( join.getJoinType() ) ) + .append( ( (FromImplementor) join ).renderTableExpression( renderingContext ) ); + renderJoins( jpaqlQuery, renderingContext, join.getJoins() ); + renderFetches( jpaqlQuery, renderingContext, join.getFetches() ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/CollectionAttributeJoin.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/CollectionAttributeJoin.java index b813f6c53c..bc8b08884e 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/CollectionAttributeJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/CollectionAttributeJoin.java @@ -119,16 +119,6 @@ public class CollectionAttributeJoin original.setAlias( alias ); } - @Override - public boolean shouldBeRendered() { - if ( getJoins().size() > 0 ) { - return true; - } - else { - return false; - } - } - @Override public String render(RenderingContext renderingContext) { return "treat(" + original.render( renderingContext ) + " as " + treatAsType.getName() + ")"; diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/ListAttributeJoin.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/ListAttributeJoin.java index 8ed333dbb0..cd9776c1f3 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/ListAttributeJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/ListAttributeJoin.java @@ -127,16 +127,6 @@ public class ListAttributeJoin original.setAlias( alias ); } - @Override - public boolean shouldBeRendered() { - if ( getJoins().size() > 0 ) { - return true; - } - else { - return false; - } - } - @Override public String render(RenderingContext renderingContext) { return "treat(" + original.render( renderingContext ) + " as " + treatAsType.getName() + ")"; diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/MapAttributeJoin.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/MapAttributeJoin.java index 2d4ff7c59a..2e9ac06eda 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/MapAttributeJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/MapAttributeJoin.java @@ -148,16 +148,6 @@ public class MapAttributeJoin original.setAlias( alias ); } - @Override - public boolean shouldBeRendered() { - if ( getJoins().size() > 0 ) { - return true; - } - else { - return false; - } - } - @Override public String render(RenderingContext renderingContext) { return "treat(" + original.render( renderingContext ) + " as " + treatAsType.getName() + ")"; diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/SetAttributeJoin.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/SetAttributeJoin.java index 04fcaa729a..bde16c85f6 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/SetAttributeJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/SetAttributeJoin.java @@ -124,16 +124,6 @@ public class SetAttributeJoin original.setAlias( alias ); } - @Override - public boolean shouldBeRendered() { - if ( getJoins().size() > 0 ) { - return true; - } - else { - return false; - } - } - @Override public String render(RenderingContext renderingContext) { return "treat(" + original.render( renderingContext ) + " as " + treatAsType.getName() + ")"; diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/SingularAttributeJoin.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/SingularAttributeJoin.java index 8de9bd69d3..4cd9652fb1 100755 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/SingularAttributeJoin.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/path/SingularAttributeJoin.java @@ -159,16 +159,6 @@ public class SingularAttributeJoin extends AbstractJoinImpl { return criteriaBuilder().getEntityManagerFactory().getMetamodel().managedType( treatAsType ); } - @Override - public boolean shouldBeRendered() { - if ( getJoins().size() > 0 ) { - return true; - } - else { - return false; - } - } - @Override public String render(RenderingContext renderingContext) { return "treat(" + original.render( renderingContext ) + " as " + treatAsType.getName() + ")";