title: How do I run an HqlBasedQuery that returns an unmapped list of objects using nHibernate?
body: <p>I want to run a query against two tables (which happen to be mapped in ActiveRecord).  The query returns a result list that cannot be mapped to an ActiveRecord object (as it is custom aggregate information).</p>
  
  <p>For instance</p>
  
  <p>Dim query_str as string = "Select distinct d.ID, (select count(1) as exp from Sales_Leads where date_created &lt;= :todays_date) as NbrLeads from Dealer d"</p>
  
  <p>Dim q As Queries.HqlBasedQuery = New Queries.HqlBasedQuery(GetType(ICollection), query_str)
  q.SetParameter("todays_date", DateTime.Today)
  Dim i As ICollection = ActiveRecordMediator.ExecuteQuery(q)</p>
  
  <p>What I'm looking for is simple execution of SQL, without an ActiveRecord object returned.</p>
  
  <p>So, ideally, I'd be able to look at i("NbrResults") for each item in the collection.</p>
  
  <p>The error I am getting is:</p>
  
  <blockquote>
    <p>You have accessed an ActiveRecord
    class that wasn't properly
    initialized. The only explanation is
    that the call to
    ActiveRecordStarter.Initialize()
    didn't include
    System.Collections.ICollection class</p>
  </blockquote>