title: JPA parent child relationship
body: <p>I have a scenario where I need to load all the child values in one case and some specific child values in other . I am using a single bean for both the cases and writing the queries using named query. </p>
  
  <pre><code>@namedqueries{
  @namedQuery(name="query1") = "select parent from Parent parent",
  @namedQuery(name="query2") = "select parent from Parent parent",
  }
  Class Parent {
  
  @manytomany
  @join mentioned my join condition here // 
   List&lt;Child&gt; child ; 
  
  }
  
  Class Child 
  { 
   String A;
   String B;
   String C;
  
   @manytomany(mappedby = "child")
   List&lt;parent&gt; parent ; 
   }
  </code></pre>
  
  <p>Now in my query 2 I need to load only String A not String B and String C .
  I tried using </p>
  
  <pre><code>"select parent.child .A from Parent parent" as Query 2 
  </code></pre>
  
  <p>but getting the below error</p>
  
  <pre><code> "Attempting to navigate to relation field via multi-valued association and
   jpql doesnt  allow traversal through multi valued relationship. Try join instead"
  </code></pre>
  
  <p>So any suggestions on how to proceed on this ..</p>
  
  <pre><code>1) Should I have to create a new bean for each Query
  2) Or Can we control the child object parameters in specific named queries
  </code></pre>