title: translating outer join SQL query into EJB entity beans
body: <p>I'm new to EJB and trying to get my head around translating SQL concepts to EJB entity beans. </p>
  
  <p>Suppose I have two tables:  PEOPLE (id, name), CONTACT(pid, phone_number).  If I want to  get a list of all people whether or not they have phone #s, in my EJB session bean I simply issue a SQL query via JDBC such as:</p>
  
  <pre><code>SELECT PEOPLE.name, CONTACT.phone_number 
  FROM PEOPLE 
  LEFT JOIN CONTACT ON PEOPLE.id = CONTACT.pid
  </code></pre>
  
  <p>Instead of using SQL/JDBC, I now want to use EJB entity beans.  So I create corresponding EJB3 entity bean classes for my tables.</p>
  
  <p>So I now have access to both entity classes from my session bean and I no longer wish to access my database tables directly via SQL/JDBC from my session bean.  I only want to use my entity beans and capabilities of JPA.  What's the proper EJB design so that in my session bean, I get the same results as my SQL query?  </p>
  
  <p>I'm unclear about how to use the EJB entity bean classes to produce the same results as my SQL outer join query.  Help.</p>