title: Best way to join 2 tables using hibernate
body: <p>I have 2 hibernate entities/tables and need to combine information from both for use in a view. The tables are</p>
  
  <pre><code>Table Client:
    clientId,
    firstName,
    lastName,
    phone,
    cellPhone
  
  Table Appointment:
    apptTime,
    clientId (and some other fields I don't need now)
  </code></pre>
  
  <p>There is a one-to-many relationship between client and Appointment, based on clientID. In regular SQL I'd just say something like:</p>
  
  <pre><code>Select 
      client.clientId, 
      appt.apptTime,
      client.firstName,
      client.lastName 
  from 
      Client  client, 
      Appointment app 
  where 
      client.clientId = appt.clientId
  </code></pre>
  
  <p>and use the recordset that was returned.</p>
  
  <p>I'm not sure how to do this in Hibernate. Should I create a ClientAppt entity and then do something like the above select (modified somewhat for HQL)? </p>
  
  <p>Note, I thought of using SecondaryTable approach, but I think that requires a 1 to 1 relationship? I suppose I could map a one to many, but is there an alternative? This is a one time change and mapping a one to many relationship might be a bit expensive for something this small?
  What is the best approach?
  Thanks</p>