I save some data to a sql tabel using nhibernate. Now if i click on save a second time it saves the data to a new line so i have 2 lines instead of updating the existing.
Do i need to creata primary key on the Id that Nhibernate creates as well as all other columns ?
I save some data to a sql tabel using nhibernate. Now if i click on save a second time it saves the data to a new line so i have 2 lines instead of updating the existing.
Do i need to creata primary key on the Id that Nhibernate creates as well as all other columns ?
Member
281 Points
1002 Posts
How does Nhibernate know when to insert or update a row ?
Oct 11, 2019 06:41 AM|robby32|LINK
Hi ,
I save some data to a sql tabel using nhibernate. Now if i click on save a second time it saves the data to a new line so i have 2 lines instead of updating the existing.
Do i need to creata primary key on the Id that Nhibernate creates as well as all other columns ?
thanks
Contributor
4953 Points
4208 Posts
Re: How does Nhibernate know when to insert or update a row ?
Oct 11, 2019 09:13 AM|DA924|LINK
Maybe, a tutorial would be helpful.
https://www.tutorialspoint.com/nhibernate/nhibernate_basic_crud_operations.htm