The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Has anyone had any experience associating a class to itself in a many-to-many relationship in Hibernate? We have a need to associate users to each other as "friends" with no duplicate relationships. This should be equivalent to a graph of users. Each user has a set of friends. Our java code correctly manipulates the set for each friend. I.e., if B is added to A's set of friends, A is also added to B's set of friends without duplication.