I use nhibernate 3 with fluent mapping and MySQL5Dialect. I do grouping and trying to get average value:
var group = new TotalStatistic();
SelectList(s => s
.SelectGroup(t => t.RegistryName).WithAlias(() => group.Name)
.SelectAvg(t => t.Value).WithAlias(() => group.Average))
.TransformUsing(Transformers.AliasToBean<TotalStatistic>());
But it generates sql query that contains cast to decimal and I get only zeroes in results instead of something like "0.0035" I suppose to get.
SELECT ... avg(cast(this_.Value as DECIMAL)) as y1_ ...