In hibernate how to use not in clause

后端 未结 2 986

i am having two table

jobs and production

production table has jobid field which refers jobid of jobs table.

In hibernate how to use not in clause

2条回答
  •  我在风中等你
    2021-01-19 05:12

    You can use HQL:

    List jobs = session.createQuery(
            "from Job where id not in (select jobId from Production)"
        ).list();
    

提交回复
热议问题