title: using POJOs in hql
body: <p>Is it possible to use more than one POJO or a combination of POJO and another piece of data from one hql statement?
  For example:</p>
  
  <p>If I have the class Foo:</p>
  
  <pre><code>public class Foo {
     private String name;
     private String type;
  
     public Foo (String name, String type) {
        this.name = name;
        this.type = type;
     }
  }
  </code></pre>
  
  <p>And and entity Bar:</p>
  
  <pre><code>@Entity
  public class Bar {
    private Long id;
    private String name;
    private String type;
    ...
  }
  </code></pre>
  
  <p>The following hql will not compile:</p>
  
  <pre><code>select bar.id, new Foo(bar.name, bar.type) from Bar bar
  </code></pre>
  
  <p>And for that matter, this hql doesn't compile either.</p>
  
  <pre><code>select new list(bar.id, new Foo(bar.name, bar.type)) from Bar bar
  </code></pre>
  
  <p>Is this supposed to work?</p>
  
  <p>Thanks</p>
  
  <p>Netta</p>