Select r from RequestInfo as r where (r.status ='QUEUED' or r.status = 'RETRYING') and r.time < :now ORDER BY r.time DESC
Select r from RequestInfo as r where (r.status ='QUEUED' or r.status ='RETRYING') and id = :id
Select r from RequestInfo as r where r.status ='RUNNING' ORDER BY r.id
Select r from RequestInfo as r where r.status ='QUEUED' ORDER BY r.id
Select r from RequestInfo as r where r.status ='QUEUED' and r.time > :now ORDER BY r.time ASC
Select r from RequestInfo as r where r.status ='DONE' ORDER BY r.id
Select r from RequestInfo as r where r.status ='ERROR' ORDER BY r.id
Select r from RequestInfo as r where r.status ='CANCELLED' ORDER BY r.id
Select r from RequestInfo as r ORDER BY r.id
Select e from ErrorInfo as e ORDER BY e.id
Select e from ErrorInfo as e where e.requestInfo.id = :id
Select r from RequestInfo as r where r.status in (:statuses) ORDER BY r.id DESC
Select r from RequestInfo as r where r.key = :businessKey ORDER BY r.id
Select r from RequestInfo as r where r.commandName = :command ORDER BY r.id
Select r from RequestInfo as r where (r.status ='QUEUED' or r.status = 'RETRYING')
and r.time < :now and (r.owner = :owner or r.owner is null) order by r.priority desc
Select r from RequestInfo as r where (r.status ='QUEUED' or r.status = 'RETRYING')
and r.id = :requestId
SELECT id,status
FROM
RequestInfo where id in (SELECT requestinf0_.id
FROM (SELECT requestinf1_.id
FROM RequestInfo requestinf1_
WHERE (requestinf1_.status = 'QUEUED' OR requestinf1_.status = 'RETRYING')
AND requestinf1_.timestamp < :now
AND (requestinf1_.owner = :owner OR requestinf1_.owner IS NULL)
ORDER BY requestinf1_.priority DESC
) requestinf0_
WHERE rownum <= 1
)
FOR UPDATE