Most modern database servers, such as MS SQL Server or Oracle, offer the possibility to use database-generated IDs for Primary Keys. In SQL Server, we can auto generate IDs by defining the column to be an identity column. In Oracle, we would use sequences to generate new IDs.
When using NHibernate or any other ORM framework, you will want to avoid this feature of the database as it has many drawbacks.
One of the criteria for a good Primary Key is that it is assigned by an NHibernate Persistent Object ID (POID) generator. Automatic assignment lets NHibernate manage the assignment of Primary Keys. NHibernate has the "smarts" baked right in to create those IDs for us and put them back into our object.
Whenever a record ...