diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/JoinedSubclassEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/JoinedSubclassEntityPersister.java index 5f90a58b96..14836c0f33 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/JoinedSubclassEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/JoinedSubclassEntityPersister.java @@ -1260,8 +1260,6 @@ public class JoinedSubclassEntityPersister extends AbstractEntityPersister { final BasicType discriminatorType = (BasicType) getDiscriminatorType(); final CaseSearchedExpression caseSearchedExpression = new CaseSearchedExpression( discriminatorType ); - caseSearchedExpression.setColumnExpression( getDiscriminatorColumnName() ); - tableReferenceJoins.forEach( tableReferenceJoin -> { final TableReference joinedTableReference = tableReferenceJoin.getJoinedTableReference(); diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/ANSICaseExpressionWalker.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/ANSICaseExpressionWalker.java index 31373c8ef0..b8750703ca 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/ANSICaseExpressionWalker.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/ANSICaseExpressionWalker.java @@ -36,11 +36,5 @@ public class ANSICaseExpressionWalker implements CaseExpressionWalker { } sqlBuffer.append( " end" ); - - final String columnExpression = caseSearchedExpression.getColumnExpression(); - - if ( columnExpression != null ) { - sqlBuffer.append( " as " ).append( columnExpression ); - } } } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/DecodeCaseExpressionWalker.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/DecodeCaseExpressionWalker.java index fb041a9b42..82c948cdff 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/DecodeCaseExpressionWalker.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/DecodeCaseExpressionWalker.java @@ -49,11 +49,5 @@ public class DecodeCaseExpressionWalker implements CaseExpressionWalker { } sqlBuffer.append( ')' ); - - final String columnExpression = caseSearchedExpression.getColumnExpression(); - - if ( columnExpression != null ) { - sqlBuffer.append( " as " ).append( columnExpression ); - } } } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/DerbyCaseExpressionWalker.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/DerbyCaseExpressionWalker.java index 4ef6c7e875..9053c23507 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/DerbyCaseExpressionWalker.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/DerbyCaseExpressionWalker.java @@ -51,11 +51,5 @@ public class DerbyCaseExpressionWalker implements CaseExpressionWalker { } } sqlBuffer.append( " end" ); - - final String columnExpression = caseSearchedExpression.getColumnExpression(); - - if ( columnExpression != null ) { - sqlBuffer.append( " as " ).append( columnExpression ); - } } } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/MckoiCaseExpressionWalker.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/MckoiCaseExpressionWalker.java index 196da2dfe2..ca2894b864 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/MckoiCaseExpressionWalker.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/MckoiCaseExpressionWalker.java @@ -39,11 +39,5 @@ public class MckoiCaseExpressionWalker implements CaseExpressionWalker { sqlBuffer.append( "null" ); } sqlBuffer.append(buf2); - - final String columnExpression = caseSearchedExpression.getColumnExpression(); - - if ( columnExpression != null ) { - sqlBuffer.append( " as " ).append( columnExpression ); - } } } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/CaseSearchedExpression.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/CaseSearchedExpression.java index a2624ec692..a481eeae2e 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/CaseSearchedExpression.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/CaseSearchedExpression.java @@ -31,20 +31,11 @@ public class CaseSearchedExpression implements Expression, DomainResultProducer private List whenFragments = new ArrayList<>(); private Expression otherwise; - private String columnExpression; public CaseSearchedExpression(MappingModelExpressable type) { this.type = (BasicType) type; } - public void setColumnExpression(String columnExpression) { - this.columnExpression = columnExpression; - } - - public String getColumnExpression(){ - return columnExpression; - } - public List getWhenFragments() { return whenFragments; }