I'm using Active Record with ActiveRecord Facility, and am trying to use a custom NHibernate query. Do I need to define a mapping for a class even though it extends ActiveRecordBase and has ActiveRecord attribute?
[ActiveRecord("VotesOnQuestions")]
public class VoteOnQuestion : ActiveRecordBase<VoteOnQuestion>
{
[CompositeKey]
public VoteKey Key { get; set; }
[Property]
public VoteType Vote { get; set; }
}
I'm trying to create the following query:
session.CreateQuery("SELECT vote, COUNT(*) FROM votesonquestions" +
" WHERE questionid = :questionId GROUP BY vote");
But I'm getting this exception:
"votesonquestions is not mapped"