Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
特定の日付より前に作成された特定のユーザーを含むすべてのグループを返す単一の HQL クエリが必要です。どういうわけか私はそれを正しくすることができません。
public class Group { @ManyToMany Set<User> users; Date created; } public class User { ... }
II-Bhima の答えは基本的に正しいです。ここに少し修正があります。
select g from Group as g inner join g.users as user where g.created < :createdDate and user = :user
Group-User 2-tuples を持つ Object[] ではなく Groups が返されるようにするために必要です。