I can tell you
a way to map it if you like, bit it's probably not what you're thinking about.
If I were mapping this, unless there were some other reason I couldn't (that you haven't mentioned), I'd model the relationship class explicitly.
That is, I'd have a class named something like ChatUserRoleRelationship.
It's look something like
Code:
class ChatUserRolRelationship {
protected Chat chat;
protected User user;
protected Role role;
}
I don't think this class is exactly what you want, but I hope you get my drift.
This is the way I model pretty much all of the many-many relationships on our project, ternary or otherwise.
Yes, it results in an extra class, but if you name it right, it won't confuse your codebase and it actually makes things much easier for the non-hibernate-guru developers on your project to understand.
I think what you want to do is also doable without an explicit class modelling the relationship, but someone else will have to explain it for you (I haven't even read the relevant manual section).