Hi,
I am unable to convert this SQL into HQL, any help will appriciated. I am not able to use the "group by" correctly.
String queryString =
"select message_num from rib_message msg"
+ " where message_num in ("
+ " select min(message_num)"
+ " from rib_message {msg_inner}"
+ " where (jms_queue_id = ?"
+ " or jms_queue_id is null)"
+ " group by location, family, nvl(id, message_num))"
+ " and in_queue = 0"
+ " and delete_pending = 0"
+ " and attempt_count < max_attempts"
+ " and (next_attempt_time is null or next_attempt_time <= ?)"
+ " and reason_code = ? for update nowait";
|