Programmatically switch the ID generator in NH mapping file <p>So I'm currently attempting to do a promotion of objects from one database to another in my app. Basically I want to allow the user to click a button and promote changes from staging to production, as it were.</p> <p>To do this, I really want to keep the IDs the same in order to help with debugging. So for example if the object has an ID of 6 in the staging db, I want it to have that same ID on production. To do this, we turned off identity on our production db and just made those primary key columns with non-null integers.</p> <p>In my staging mapping file, my IDs are mapped using the "identity" generator, but for production I want them to be "assigned". Is it possible to programmatically change this, perhaps using an interceptor or something similar?</p> <p>Thanks in advance!</p>