FNhibernate, GeneratedBy.HiLo, hibernate_unique_key etc.

Posted by csetzkorn on Stack Overflow See other posts from Stack Overflow or by csetzkorn
Published on 2010-05-13T10:50:44Z Indexed on 2010/05/13 10:54 UTC
Read the original article Hit count: 809

Filed under:

Hi,

I have started using the s#arp architecture which uses FNhibernate and GeneratedBy.HiLo to generate primary keys (there is also table hibernate_unique_key). Apparently, this is recommended practise and I would like to stick with this. Now to my problem. I have used NHibernate and hbm mapping quite a bit and usually used identity columns for my primary keys. This allowed me to seed the database using SQL. Can I do this with the aforementioned setup (hibernate_unique_key table etc.). I need to do this as SQL insert is much more efficient than using NHibernate + C# to seed the db with a million entities. Any feedback would be very much appreciated. Thanks.

Christian

© Stack Overflow or respective owner

Related posts about fluent-nhibernate