title: Playframework - querying and displaying results from multi-table join
body: <p>I'm a newcomer to java and the play framework (I'm using play 1.2.2 with a local MySQL5 database). I'm trying to query a couple of tables in a database and display the table join results on a web page.</p>
  
  <p>This is what I have in the various bits:</p>
  
  <p><em>Controller</em> :-</p>
  
  <pre><code>public static void index() {
          List&lt;Mutation&gt; mutation_list= Mutation.getDisorderGene();
          render(mutation_list);       
      }
  </code></pre>
  
  <p><em>Model</em> :-</p>
  
  <pre><code>public class Mutation extends Model {
  
    public static List&lt;Mutation&gt; getDisorderGene() {
      EntityManager entityManager = play.db.jpa.JPA.em();
      List&lt;Mutation&gt; muts = entityManager.createNativeQuery("select disorder_name, gene_name from Disorder,Mutation where Disorder.id = Mutation.disorder_id order by disorder_name, gene_name").getResultList();
      return muts;
    }
  </code></pre>
  
  <p><em>View</em> :-</p>
  
  <pre><code>#{list items:mutation_list, as:'mutation'}
                      &lt;tr&gt;
                          &lt;td&gt;${mutation.disorder_name}&lt;/td&gt;
                          &lt;td&gt;${mutation.gene_name}&lt;/td&gt;
                      &lt;/tr&gt;
   #{/list}            
  </code></pre>
  
  <p>And this is the error message I get!</p>
  
  <blockquote>
    <p>Template execution error</p>
    
    <p>Execution error occured in template /app/views/Stu/index.html.
    Exception raised was MissingPropertyException : Exception evaluating
    property 'disorder_name' for java.util.Arrays$ArrayList, Reason:
    groovy.lang.MissingPropertyException: No such property: disorder_name
    for class: java.lang.String.</p>
  </blockquote>
  
  <p>I'm unsure where the problem lies. Is it with the JPA table join query or is something wrong in the view.</p>
  
  <p>Are there any changes in the view I can make to display the columns?</p>
  
  <p>Many thanks.</p>