title: Entitymanager query in 2 different tables with inner join
body: <p>my current code:</p>
  
  <pre><code>TypedQuery&lt;Account&gt; tp = em.createQuery("SELECT a FROM Account a INNER JOIN User u ON u.account_id = a.id WHERE a.email = :email AND a.pwd = :pwd AND a.role = 'admin'", Account.class);
                  tp.setParameter("email", this.username);
                  tp.setParameter("pwd", this.password);
                  Account result = tp.getSingleResult();
  </code></pre>
  
  <p>but ill get an java.lang.IllegalArgumentException.</p>
  
  <p>what i need is to display a column in the user table.</p>
  
  <p>something like <code>String name = Account.getName();</code> but the Account entity doesnt have a getName() only the User entity has.</p>
  
  <p>*update</p>
  
  <p>this is the error </p>
  
  <p>java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager: Exception Description: Syntax error parsing the query [SELECT a FROM Account a INNER JOIN User u ON u.account_id = a.id WHERE a.email = :email AND a.pwd = :pwd AND a.role = 'admin']. Internal Exception: org.eclipse.persistence.internal.libraries.antlr.runtime.EarlyExitException</p>