How can I write an HQL query like same SQL query like this:
select * from Users u where u.id in (1, 3, 4)
How can I write an HQL query like same SQL query like this:
select * from Users u where u.id in (1, 3, 4)
I suggest you use native query to utilize your SQL query, so that you don't have to convert to HQL.
The simplest way to do this with play is
public static void findByIds(List<Long> userIds) {
find("from Users u where u.id in (?1)", userIds).fetch();
}