title: Join collection in QueryOver with projections
body: <p>I want to retrieve the list of short <code>User</code> versions with their <code>Characters</code> collection (short version too). I use QueryOver with projections.</p>
  
  <pre><code>public class User
  {
          public virtual int Id { get; set; }
          public virtual string Nickname { get; set; }
          public virtual ISet&lt;Character&gt; Characters { get; set; }
          // and 30 other properties
  }
  
  public class Character
  {
          public virtual int Id { get; set; }
          public virtual int XP { get; set; }
          public virtual int UserId { get; set; }
          public virtual int ClassId { get; set; }
          // and 30 other properties
  }
  
  public class UserDto // short version
  {
          public virtual string Nickname { get; set; }
          public virtual ISet&lt;CharacterDto&gt; Characters { get; set; }
  }
  
  
  public class CharacterDto // short version
  {
          public virtual int XP { get; set; }
          public virtual int ClassId { get; set; }
  }
  
      User userAlias = null;
      UserDto userDto = null;
      Character characterAlias = null;
      CharacterDto characterDto = null;
  
      var result = session.QueryOver&lt;User&gt;(() =&gt; userAlias)
              .Where(Restrictions.Like(
                  Projections.SqlFunction("lower", NHibernateUtil.String, Projections.Property&lt;User&gt;(x =&gt; x.Nickname)),
                  nickname.ToLowerInvariant(), MatchMode.Start))
              .JoinAlias(x =&gt; x.Characters, () =&gt; characterAlias, JoinType.LeftOuterJoin)
               .Select(
                   Projections.Property(() =&gt; userAlias.Nickname).WithAlias(() =&gt; userDto.Nickname),
                   Projections.Property(() =&gt; userAlias.Characters).WithAlias(() =&gt; userDto.Characters),
                   Projections.Property(() =&gt; characterAlias.XP).WithAlias(() =&gt; characterDto.XP),
                   Projections.Property(() =&gt; characterAlias.ClassId).WithAlias(() =&gt; characterDto.ClassId)
                  )
              .TransformUsing(Transformers.AliasToBean&lt;UserDto&gt;())
               .Take(50)
               .List&lt;UserDto&gt;();
  </code></pre>
  
  <p>When I run this code it throws an exception: <code>Could not find a setter for property ClassId in class UserDto</code>. If I remove the transformer then the result contains entries for one character per each user (User1-Character1, User1-Character2, ...). Each entry has correct nickname and character class id but wrong xp (user id instead) and characters collection (== null).</p>
  
  <p>How can I get the correct data without using hql or doing seperate queries for characters?</p>
  
  <p><strong>update</strong></p>
  
  <p>I removed the transformer and commented out <code>Projections.Property(() =&gt; userAlias.Characters)...</code>, now it returns the correct results but is there a way to transform them into projected dtos like AliasToBeanTransformer does and collapse the repeated user data for each character entries?</p>