title: How to make a "deep" transformation in Grails withCriteria contains projection?
body: <p>I am using Grails 2.2.4 to build a web application, and now I am having a complex problem with Grails withCriteria operation. I have 3 classes as below:  </p>
  
  <pre><code>class Person {
      int id
      String name
      Set&lt;Car&gt; cars = []  // One-to-many relationship
      Company currentCompany // One-to-one relationship
  }
  
  class Car {
      int id
      String manufacturer
      String brand
      double price
      Person owner
  }
  
  class Company {
      int id
      String name
      Set&lt;Person&gt; employees = []
  }
  </code></pre>
  
  <p>And now I want to query data from Person as root class along with associated data like this:  </p>
  
  <pre><code>List result = Person.withCriteria {
      projections {
          property('id')
          property('name')
          createAlias('cars', 'c', CriteriaSpecification.LEFT_JOIN)
          property('c.brand')
          createAlias('currentCompany', 'com', CriteriaSpecification.LEFT_JOIN)
          property('com.name')
      }
          lt('id', 10L)
          resultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
  }
  </code></pre>
  
  <p>And the problem is, I don't know how to transform deeply the result data to a List of persons to make sure every single element contains its data as the class structure. I tried many methods like  </p>
  
  <pre><code>    resultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
      resultTransformer(CriteriaSpecification.ALIAS_TO_ENTITY_MAP)
      resultTransformer(CriteriaSpecification.aliasToBean(Person.class))  
  </code></pre>
  
  <p>but nothing worked as I expected.<br>
  Does Grails 2.2.4 support this? If yes so what is the correct syntax?<br>
  Thank you so much.</p>