NH auto-generated columns.
I believe that NHibernate forums (on Hibernate site) might be a better place for such issues, which are related only to pure NHibernate usage.
Anyway, I think your problem is that you are using
which assumes an auto generated column (e.g. an Identity column in SQL Server) in the table. So in this case, you cannot say -
<generator class="native" />
Since this is an auto-generated column, the database will itself populate its appropriate value.
newuser.Id = "sree";
If you don't want to use auto-generated columns, then there are other ways to achieve that, so please refer NH documentation.
Thanks and regards,