Z
Z
Zunga2019-08-14 15:26:49
Java
Zunga, 2019-08-14 15:26:49

Remake sql with criteria api(hibernate)?

Hello everyone, I ask you to help translate the sql query into the criteria api format.
SELECT name FROM sys_accounts WHERE guid=(SELECT account_guid FROM sys_activities WHERE (extract(day from now() - datefinish))>30 ORDER BY datefinish DESC LIMIT 1.
This query cannot be used in hibernate, because the limit construct is not supported. The second way is to use the criteria api, but I can't figure it out yet
In general, the company has tasks (oneToMany c) , you need to get a list of companies that have more than 30 days since the last closed task

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question