title: HQL for a select with a left join fetch
body: <p><strong>[Note]</strong> See my update further down for the real question. I've left the original one in case it's useful to anyone...</p>
  
  <p>Just trying to get this working. It looks like the Kats/Kittens example from the docs as far as I can tell, but I get a NullReferenceException when I try to use it.</p>
  
  <pre><code>CustomerOrder order = CurrentSession.CreateQuery(
      @"select new CustomerOrder(Name)
        from CustomerOrder o
        left join fetch o.OrderItems as items
        where o.Id = :Id")
      .SetParameter("Id", id)
      .UniqueResult&lt;CustomerOrder&gt;();
  </code></pre>
  
  <p>If I omit the join fetch (to just bring back 'CustomerOrder' withoutthe OrderItems) it works. My CustomerOrder has a constructor that takes a String for 'Name' and there are OrderItems records in the database for the order I am retrieving.</p>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>[Update]</strong>
  I've just been reading that what I am trying to do doesn't really make sense since I am instantiating a new object with some values and what I am doing is effectively trying to fetch the OrderItems as though they belonged to the newly instantiated object, which they don't. </p>
  
  <p>What I need is an Order with just the Name field populated, along with it's collection or OrderItem children, ideally with only their 'Description' field populated. I want to do this so I am not retrieving all columns back as HQL would normally do (for performance reasons).</p>
  
  <p>What's the best way to do this?</p>
  
  <p>Thanks</p>