SQL करने के लिए यहाँ ntranslated नहीं मेरी HQL है:कोष्ठक
delete from `email` where `status`=? and `creation_time`<=? or `status`=? and `attempts`>=?
प्रश्न:: क्यों कोष्ठक एसक्यूएल में नहीं हैं
Query query = createQueryOnCurrentSession("DELETE Email e " +
"where " +
"(status = :sent and creationTime <= :creation)" +
"or " +
"(status = :error and maxEttempts >= :maxEttempts)");
यहाँ उत्पन्न एसक्यूएल है?
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`>=?
की तरह तो कोष्ठकों से बचने की कोशिश का पालन करें: '\ (' –
एकल '" \ ("' संकलित नहीं करता है (निश्चित रूप से) और डबल '" \\ ("' अपवाद फेंक दें: 'org.hibernate.QueryException: अप्रत्याशित चार:' \ '[हटाएं com.grroo.model.Email e जहां \ (स्थिति =: भेजा और निर्माण समय <=: निर्माण \) या \ (स्थिति =: त्रुटि और प्रयास> =: maxAttempts \)] ' – urir
मुझे लगता है कि आप आपकी स्थिति के रूप में क्वेरी स्ट्रिंग को जोड़ सकते हैं और फिर –