I would like to implement a User-Friend relationship in Hibernate/JPA, something like:
class User {
Set<User> friends;
}
Let's say that user A and user B are friends. If user A unfriends user B, list of friends of User B should not contain user A anymore.
Is there any clean way to model this kind of relation in Hibernate/JPA (and, of course, in the underlying DB tables)?