Hi!
From what I understand of your post you want to link class A and B in a many-to-many-relationship via a class C that could be considered an entity?
Then the C-class can have an id property (it stand as optional in the Hib Docs), preferably of a Serializable and nullable type, for example java.lang.Long. I recommend you use it, it has some advantages. (see p. 20-21 in the docs)
Then you map this via XDoclet with something like this
Code:
/**
*
* @hibernate.id generator-class="native" unsaved-value="null"
*/
I've also had this urge for an ID from XDoclet numerous times, so I'm a bit confused about the 'optional'-part of the ID.... but.... all you have to do is comply ;-)
Sincerely,
/F