title: ID property for generated data - NHibernate
body: <p>I have some stored procedures which I am using to create reports (each SP groups the data into days / weeks / months / years). By means of an example, I have created a simple entity "Report" which matches the fields from the SP but an error is thrown saying that an ID (or Composite ID) is required.</p>
  
  <p>How can I define an ID for what is a generated dataset and does not map to an actual table?</p>
  
  <p>The mapping file I have is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"&gt;
      &lt;class name="Report, Business" mutable="false" check="none"&gt;
          &lt;property name="Year" type="int" /&gt;
          &lt;property name="Week" type="int" /&gt;
          &lt;property name="Date" type="DateTime" /&gt;
          &lt;property name="Count" type="int" /&gt;
      &lt;/class&gt;
      &lt;sql-query name="spReport"&gt;
          &lt;return class="Report, Business" lock-mode="read"&gt;
              &lt;return-property column="Year" name="Year" /&gt;
              &lt;return-property column="Week" name="Week" /&gt;
              &lt;return-property column="Date" name="Date" /&gt;
              &lt;return-property column="Count" name="Count" /&gt;
          &lt;/return&gt;
          exec spReport :StartDate, :EndDate
      &lt;/sql-query&gt;    
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Any help is greatly appreciated.</p>
  
  <p>Thanks.</p>