title: Spring Boot Way to Replace Views in SQL
body: <p><strong>Context</strong></p>
  
  <p>I've inherited a small Spring-based project --it tracks servers, software installations, etc for or teams internal use. It uses Angular front end and Spring/java/mysql back end for a restful back end.</p>
  
  <p>I've converted it to Spring boot over the last few months.  I'm new to Spring and Spring boot. So I'm learning as I go along. </p>
  
  <p>I started replacing the 'hand coded' sql with JPA ("spring-data-rest"). JPA has been easy for some tables, but not for others. For these "others":  <em>The hand-coded SQL uses "views" when retrieving data .</em></p>
  
  <p><strong>Approach</strong></p>
  
  <p>Specifically, it uses this approach:</p>
  
  <ul>
  <li><p>When it creates or updates a table (e.g. "sites" table, as in "web site"), it  passes in the "ID's:" Server_id, product_id, customer_id etc.</p></li>
  <li><p>The software retrieves from a "sites view" that joins on the server , product, and customer tables, so that the java can retrieve server name, product name, customer name, etc. without a separate database call.</p></li>
  </ul>
  
  <p><strong>Questions</strong></p>
  
  <ul>
  <li><p>What is the cleanest, most-Spring-boot-ish way to convert these "read-only views" to JPA?</p></li>
  <li><p>What generally is the cleanest way to handle 'star joins' in  Spring/JPA? (where one central table joins with several other tables to give the user the data he/she needs)</p></li>
  </ul>
  
  <p>thanks</p>