[英]Hibernate is using wrong table name for order by expression with three level inheritance
[英]Hibernate : invalid ORDER BY expression
我試圖像這樣在我的Criteria
添加一些Order。
crit.addOrder(Order.asc("priority")); // Not the real property though
並使用帶有HSQLDialect的MsAccess數據庫在我的系統上進行測試
引起:org.hsqldb.HsqlException:ORDER BY表達式無效
所以我試圖顯示查詢,它看起來像這樣:
Hibernate:
/* criteria query */ select
distinct this_.i_id as y0_
from
T_FIT_ARTICLE this_
where
(
this_.b_export_ready=?
or this_.d_application_deadline>=?
)
order by
this_.d_application_deadline asc limit ?
//FROM HERE THE STACK TRACE
問題是,我之前在我的集合上使用了@OrderBy
注釋,它產生了相同的查詢,這有效:
order by
elements2_.i_order_nr asc limit ?
但是使用我的實體中的屬性,它會導致異常。
順便說一句,如果我嘗試使用MYSQLSERVER
測試相同的程序,它可以完美地工作。
知道為什么或如何避免這種情況?
非常感謝 !
對於仍然感興趣的人:問題是我設置了屬性的投影並設置了另一個屬性的訂單。 這顯然不受方言或數據庫的支持。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.