开发者

NHibernate disable id generator for bulk operation

开发者 https://www.devze.com 2023-02-13 17:10 出处:网络
I have to bulk import data into my database using nhibernate and my mapped model. I set up a guid.c开发者_如何学JAVAomb generator for ids.

I have to bulk import data into my database using nhibernate and my mapped model. I set up a guid.c开发者_如何学JAVAomb generator for ids. Is there's a way to import data with yet assigned ids disabling temporary guid.comb id generator?


You can temporarily change the id generator to assigned. Then, after import is finished switch it back to COMB Guids. Just be sure you explicitly call session.Save() instead of SaveOrUpdate(). Does that solve your problem?

0

精彩评论

暂无评论...
验证码 换一张
取 消