If I use session-per-transaction and call:
session.SaveOrUpdate(entity) corrected: session.SaveOrUpdateCopy
Nhibernate will set the ID property of your entity just after SaveOrUpdate call.