title: How to map a database query into an Object [in Java]?
body: <p>I have a query that joins 5 tables.
  Then I fill my hand-made object with the column values that I need.</p>
  
  <p>What are solutions here that are wide-common to solve that problem using specific tools ? are there such tools?</p>
  
  <p>I'm only beginning to learn Hibernate, so my question would be: is Hibernate the right decision for this problem?</p>
  
  <p>Hibernate maps a table to a class. So, there's no difference if I would have 5 classes instead of 5 tables. It would still be difficult to join the query result into a class</p>
  
  <p><b>
  Could hibernate be used to map THE QUERY into the structure (class) I would define beforehand as we do with table mapping? Or even better, can it map the query result into the meaningful fields [auto-create the class with fields] as it does with reverse-engineering?
  </b></p>
  
  <p><i>
  I've been thinking about views but.. create a new view everytime we need a complex query.. too verbose.
  </i></p>
  
  <p>As S.Lott asked, here is a simple version of a question:</p>
  
  <p>General problem:</p>
  
  <pre>
  select A.field_a, B.field_b, C.field_c 
   from table_a A inner join table_b B inner join table_c C 
   where ...
  </pre>
  
  <p>every table contains 100 fields
  query returns 3 fields, but every field belongs to the unique table</p>
  
  <p>How do I solve that problem in an OO style?
  Design a new object with properties corresponding to the returning values of the query.</p>
  
  <p>I want to know if it is the right [and the only one possible] decision and are there any common solutions.</p>
  
  <p>See also my comments.</p>