File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed
hibernate-core/src/main/java/org/hibernate/dialect/function Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change 66
77import java .util .List ;
88
9+ import org .hibernate .QueryException ;
910import org .hibernate .metamodel .mapping .JdbcMapping ;
1011import org .hibernate .query .ReturnableType ;
1112import org .hibernate .query .sqm .function .AbstractSqmSelfRenderingFunctionDescriptor ;
2021import org .hibernate .type .descriptor .jdbc .JdbcType ;
2122import org .hibernate .type .spi .TypeConfiguration ;
2223
23- import static java .lang .String .format ;
24-
2524
2625/**
2726 * The HQL {@code ordinal()} function returns the ordinal value of an enum
@@ -56,8 +55,6 @@ public void render(
5655 JdbcMapping singleJdbcMapping = singleExpression .getExpressionType ().getSingleJdbcMapping ();
5756 JdbcType argumentType = singleJdbcMapping .getJdbcType ();
5857
59- String columnNameExpression = singleExpression .getColumnReference ().getColumnExpression ();
60-
6158 if ( argumentType .isInteger () ) {
6259 singleExpression .accept ( walker );
6360 }
@@ -72,7 +69,6 @@ else if ( argumentType.isString() || argumentType.isEnum() ) {
7269 Enum <?> enumValue = (Enum <?>) e ;
7370 sqlAppender .appendSql ( " when " );
7471 sqlAppender .appendSingleQuoteEscapedString ( enumValue .toString () );
75- sqlAppender .append ( format ( "'%s'" , enumValue .toString () ) );
7672 sqlAppender .appendSql ( " then " );
7773 sqlAppender .appendSql ( enumValue .ordinal () );
7874 }
You can’t perform that action at this time.
0 commit comments