Hi all I'm new to hibernate, this is my first post.
I'm trying to do somethig that I don't know if it's posible, so please guide me:
I have a tables structure like this: [User] -> [UserXRole] <- [Role] -> [RoleXOption] <- [Option]
UserXRole and RoleXOption are created because of the n to m association between Users-Roles and Roles-Options respectively.
From simple many-to-many asociations I can get the user roles and then iterating the user roles I can get the options.
I would like to know is there is a way to configure relationships/asociations to get the options of an user more "directly", something like user.getOptions();
As an example of what I would like to do here is this pseudo SQL: Select distinct O.name from User U inner join UserXRole UR inner join Role R inner join RoleXOption RO inner join Option O where U.id = ?
|