Handling nulls in hibernate equality
I'm implementing Hibernate in an existing application and I'm in the process of converting over queries to HQL syntax. I have a query (going against MySQL) that uses the <=> equality operator in a join clause. Is there an equivalent built-in mechanism in hibernate that handles null values in the same fashion or will I have to roll my own?
Update: Is it possible to have an HQL query but the join logic piece is specified using native SQL? For example with this query:
String query2 = " from Alert a ";
query2 += " left join a.alertInitialFactData fd with a.calyear=fd.calyear ";
query2 += " where a.alertTask.taskId=10 ";
query2 += " order by a.alertTimeEvent.timeEventId";
Is it possible to use native sql just for the "with a.calyear=fd.calyear" portion? Or do I have to convert the entire query over to native sql?
不管我们在我们的项目中做了什么......我们自己处理它......我不认为有这样一种内置机制来处理HQL中的空值。
链接地址: http://www.djcxy.com/p/63822.html上一篇: 我可以让Hibernate标签它与查询名称产生的SQL吗?
下一篇: 在休眠平等中处理空值