これが私のHQLです:
Query query = createQueryOnCurrentSession("DELETE Email e " +
"where " +
"(status = :sent and creationTime <= :creation)" +
"or " +
"(status = :error and maxEttempts >= :maxEttempts)");
生成されたSQLは次のとおりです。
delete from `email` where `status`=? and `creation_time`<=? or `status`=? and `attempts`>=?
質問:角かっこがSQLにないのはなぜですか?私はそれが次のようになることを期待します:
delete from `email` where (`status`=? and `creation_time`<=?) or (`status`=? and `attempts`>=?)
代わりに、2つのリクエストで削除する可能性がありますか?
delete from `email` where `status`=? and `creation_time`<=?
delete from `email` where `status`=? and `attempts`>=?