OK, so you really *do* want the model you said you wanted :-D Go figure!
So what about this? Role has a collection of ResourcePermissions (a one-to-many map with the Role as the index, the Resource as the key, and ResourcePermissions as the elements). A ResourcePermission is an object that has a many-to-one to a Resource, and a Set of Permissions.
So to give a Role a set of permissions on a Resource, you first create a ResourcePermissions object which associates those Permissions with that Resource, then you associate those ResourcePermissions with the Role.
That would certainly work. The main downside of it is that ResourcePermissions become first-class objects with IDs of their own, which isn't exactly what you wanted, but if you have a strict parent-child relationship from Role to ResourcePermission (with cascade="all") then Hibernate will handle most of the grunt work for you.
If you really, really, really want to have the table mapped the way you originally had it, then you are looking at
mapping a ternary association. This is something I personally tried to do with Hibernate 2.1.2, but it was badly broken back then.
Your problem is that you actually have a multi-valued map -- i.e. there are multiple permissions for a given role/resource combination. The issue there is not really with the database, but actually with Java -- there is no way to get Java to store multiple values in a Map for a given key.
So that's one way to think about your problem: you are trying to use Hibernate to map your relational structure into Java.
What do you want your Java code that manipulates these associations to look like? In other words, if you were writing POJO code to implement this, forgetting all about the database, what would its structure be? If you can get a happy answer to this, you'll probably see your way to implementing it in Hibernate.
If you want to get into mega-rocket science, check out
Hibernate UserCollectionTypes which let you get almost full control over collection semantics. In *fact*, this reminds me that I actually had an almost identical problem!!!
Here's the thread on that one including some comments from Gavin King.
Finally, if this has been at all helpful, could you please rate my answers accordingly? ;-)
Cheers!
Rob