hibernate-orm/hibernate-core
Luca Molteni f8e4e6e49f HHH-16861 HQL ordinal() function
The `ordinal` function returns the `ordinal` property of Java enums, for both enums mapped as ORDINAL and enums mapped as STRING generating different SQL in each case

`ordinal(field)` is equivalent to `cast(enum as Integer)`, implementation taken from CastStrEmulation when used on ordinal mapped enums.

Lexer and parser don't need to be changed as there is nakedIdentifier that matches custom function names

`ordinal` function is validated to work only on Java enum fields

Use convertToRelationalValue to generate enum value inside the SQL query

Co-authored-by: Christian Beikov <christian.beikov@gmail.com>
2024-09-30 10:57:24 +02:00
..
src HHH-16861 HQL ordinal() function 2024-09-30 10:57:24 +02:00
hibernate-core.gradle Exclude generated sources from spotless 2024-09-18 12:06:40 +02:00