I have some class C that contains Map<A, Set<B>>, where A and B has long id and mapped in tables a and b. I want do some mapping of C into table with 2 attributes a_id and b_id. How can开发者_高级运维 I do it?
I am not positive I understood you question correctly, but if I did you could try the following.
Create a new table that has 3 columns, a_id, b_id, and c_id where only c_id cannot be null. Every entry in that table will represent a mapping from c -> {a || b}. In hibernate you will have a ManyToMany set or list of a's and b's in the c class.
精彩评论