bobpardoe wrote:
What I want to know is
a) does the dynamic-update = true mapping mean that nhibernate will re-read the row again to see what has changed ?
If you use select-before-update, yes. And select-before-update is almost always less efficient than just updating the row blindly. Otherwise dynamic-update means "update only those fields that you know were changed", and it only works if you're updating the object in the same session it was loaded in.
bobpardoe wrote:
b) could I pass into a class or method my before and after images so the differences can be detected and the appropriate SQL code generated
No, there isn't any such API in NHibernate.
bobpardoe wrote:
c) would I be better off doing this myself and creating the SQL on the fly, thereby just using nhibernate for data retrevial and manually code all updates ?
I think you can do it in NHibernate using SaveOrUpdateCopy - you would reassociate the old object with the session (using Lock), then use SaveOrUpdateCopy(theNewObject) on the session, and commit the transaction later.
bobpardoe wrote:
d) how do I specify an additonal where clause on the update. I will have the Id column as the primary key (that the class already knows about), but where do I put the timestamp value so that is it added to the where clause i.e. UPDATE blah WHERE Id= 1 AND Concurrency = timestamp value
NHibernate does this automatically if you map a property using <version> or <timestamp>.