Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL insert with hilo + inheritance

Tags:

nhibernate

I would like to insert some data using plain sql into some tables that use hilo id generation in conjunction with nhibernate. Is this possible? I have found some similar questions but no definite answer yet. Thanks!

Chris

like image 755
cs0815 Avatar asked Nov 04 '22 23:11

cs0815


1 Answers

Sure you can do it. Just update the hi value in appropriate table and generate Id for inserts. Nhibernate won't validate ID's in DB.

unique key table is used only for inserts, and once object is in DB it doesn't matter anymore where its id came from

like image 111
Sly Avatar answered Nov 15 '22 11:11

Sly