我正在尝试使用 Hibernate 3 和 Oracle 10 编写此查询。
from Alert alert
where alert.expiration > current_date()
order by alert.priority, alert.updated, alert.name
它正在创建这样的 SQL -
Hibernate: select alert0_.ANNOUNCEMENTS_ID as ANNOUNCE1_1_, alert0_.ANNOUNCEMENT
S_NAME as ANNOUNCE2_1_, alert0_.ANNOUNCEMENTS_PRIORITY as ANNOUNCE3_1_, alert0_.
ANNOUNCEMENTS_EXPIRATION as ANNOUNCE4_1_, alert0_.ANNOUNCEMENTS_UPDATE_DATE as A
NNOUNCE5_1_ from NYC311_ANNOUNCEMENTS alert0_ where (alert0_.ANNOUNCEMENTS_EXPIR
ATION>current_date()) order by alert0_.ANNOUNCEMENTS_PRIORITY , alert0_.ANNOUNC
EMENTS_UPDATE_DATE , alert0_.ANNOUNCEMENTS_NAME
当括号显然完全平衡时,我会遇到所有这些古怪的错误,例如“缺少右括号”。
为什么甲骨文对此感到恐惧?有没有更好的方法来编写我的 HQL 查询?