title: JPA query for getting list of objects which are in one To Many relationship
body: <p>I have following tables in one to many relationship</p>
  
  <pre><code>Class A {
  
      private Integer id;
  
      private String name;
  
      @OneToMany(mappedBy="a", fetch=FetchType.LAZY)
      private List&lt;B&gt; bs;
  
      public A(Integer id, String name, List&lt;B&gt; bs){
      this.id = id;
      this.name = name;
      this.bs = bs;
      }
  }
  
  Class B {
  
      @ManyToOne
      private A a;
  
      private String name;
  }
  </code></pre>
  
  <p>I wanto to write query to get data of class A along with their bs
  e.g 
  <code>Select NEW A(a.id, a.name, a.bs) FROM A a WHERE a.id = 10;</code></p>
  
  <p>my constructor is of parameter (Integer id, String name, List bs). But it throws error unnable to locate appropriate constructor.</p>
  
  <p>Can you tell me what mistake I am doing. And is this really possible in JPA</p>