I am trying to do versioning with NHibernate and everything works fine, however right after the insert NHibernate tries to pull the generated timestamp by executing the following query:
SELECT profileloc_.Updated as Updated14_ FROM profile_locale profileloc_
WHERE profileloc_.id=?p0 and profileloc_.culture=?p1;?p0 = 16, ?p1 = 1033
Which is totally wrong, as it will pull out all versions starting with the first one.
How do I make it add ORDER BY Updated DESC
to this query? I am using Fluent NHibernate for mappings.