Hi,

I want to map the number of posts to a topic. I'm using AutoMap with
the following override for Topics:

mapping.Map(t => t.PostCount).Formula("(SELECT COUNT(*) FROM
forumPosts p WHERE p.TopicID = Id)");

No matter what I enter a Formula, the PostCount is always. To check
the SQL Syntax (although nhibernate throws no exception concerning
malformed SQL) I tested it manually using

Session.CreateSQLQuery("(SELECT COUNT(*) FROM forumPosts p WHERE
p.TopicID = " + id + ")").List()[0];

That does work correctly.

Can anybody tell me what is wrong with my mapping?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to