views:

77

answers:

1

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.

A: 

Turns out if I put .Generated.Never() on the timestamp property generation moves to NHibernate from MySQL and so the issue disappears. However, I prefer it to be on MySQL side if possible.

HeavyWave