The exact query results in a syntax error, when I replace "this_.Id = @p0;@p0 = 1" with "this_.Id = 1" the result is correct.
But even when I use "SELECT 5" as formula, the PostCount is still 0. On Oct 6, 1:16 pm, Paul Batum <paul.ba...@gmail.com> wrote: > Off the top of my head, I can't see anything wrong with your mapping. I've > used formula columns with automapping for similar purposes without problems. > Have you executed that generated query against the db and confirmed that it > returned the correct results? > > On Fri, Oct 2, 2009 at 9:06 AM, Schlaefisch <schlaefi...@googlemail.com>wrote: > > > > > Update: The Console Output. > > > Manual SQL: > > NHibernate: (SELECT COUNT(*) FROM forumPosts p where p.TopicID = 1) > > Mapping SQL: > > NHibernate: SELECT top 2 this_.Id as Id0_0_, this_.Title as Title0_0_, > > this_.Created as Created0_0_, this_.DisplayPriority as DisplayP4_0_0_, > > this_.ForumID as ForumID0_0_, (SELECT COUNT(*) FROM forumPosts p where > > p.TopicID = this_.Id) as formula0_0_ FROM forumTopics this_ WHERE > > this_.Id = @p0;@p0 = 1 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---