After lots of tests I have come to the obvious conclusions that:
- mapping bag to many-to-many is totally inefficient
- using idbag leads to a kind of unpredictable behaviour (I will post the issue on JIRA shortly)
- set seem to be the best choice for many-to-many
But the problem is that our db design methodology requires the usage of an id for all tables (including many-to-many simple tables). Because the set does not allow creating id-s for the many-to-many table, what I would like to know is how can I extend it's functionallity somehow...
The first ideea is to save some meta values in the mapping and to modify the insert statement to insert also a value for the id column. I don't mind nhibernate using the fk-pair for update/delete, all I want is to insert the id.
Now the question is where is the best choice to do this, or what interface is in charge with creating the SQL fragment for insert for collections...
I will surely dig in on my own, but any ideeas would be appreciated...
Dragos
|