需要在 Hibernate 中的 @Formula 注释中使用表别名

Gun*_*nny 5 java hibernate

有没有办法在 Hibernate 中的 @Formula 注释中引用当前表的别名?如果表别名为参数,我想使用 RRN() 函数接收表名或别名。我尝试直接在注释中指定表名,但这不起作用,因为表是别名的。

我也试过 {alias} 希望它可能可用,但它也不起作用。

@Formula("RRN({alias})")
Run Code Online (Sandbox Code Playgroud)

我正在寻找生成这样的查询:

select alias.column1, alias.column2, alias.column3, RRN(alias) from table as alias
Run Code Online (Sandbox Code Playgroud)

sib*_*ick 4

我相信它已在 @Formula 中的 Resolve {alias} 中修复,如 Restrictions.sqlRestriction()