Is there a way to reference the current table's alias inside of a @Formula annotation in Hibernate? I want to use the RRN() function which takes in the table name or alias if the table is aliased as a parameter. I tried specifying the table name directly in the annotation but that won't work because the table is aliased.
I also tried {alias} hoping it may be available but it didn't work either.
@Formula("RRN({alias})")
I'm looking to generate a query like this:
select alias.column1, alias.column2, alias.column3, RRN(alias) from table as alias
I believe it was fixed in Resolve {alias} in @Formula like Restrictions.sqlRestriction()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With