This is kind of a duplicate to a post on the newbie forum. The reason for the duplicate is the other is a request for a solution to the problem. This is a recommendation that you include an example in the book (though tbe answer would also be nice).
The Hibernate In Action book recommends that many-to-many relationships are often best mapped as two one-to-many 's in several places. I wish they gave an example..
My question regards how to navigate to the desired set. If I have a many-to-many of User to Roles, how do I get a set of Roles when mapped as two one-to-many 's. When I map a one-to-many from User to UserRole, I get a set of UserRoles, not Users.
PS The book is very good, up to both Manning's and Hibernate's high standards. Thanks.
|