In NHibernate 1.2 is it possible to have the ID generated by a database trigger? Basically we need to change one of our tables to stop using a sequence and instead use a trigger to generate the primary key. So obviously I need to update the nhibernate mapping to use a different generator class but I’m not sure what class I should use, or even if this is supported in 1.2. Any help would be greatly appreciated. Thanks!
Share
NHibernate allows you to do this but only starting from 2.1.0:
If you don’t want to upgrade to later versions of NHibernate (because of .NET 1.1?) then you can try Ayende’s custom dialect solution or extend NHibernate as suggested here.