title: How to implement Spring JPA Method with BigQuery
body: <p>I am trying to connect my spring boot application with the dataset that I created in bigquery.
  However, I am not sure on how to make use of my spring data JPA methods or the entity with the bigquery results that was fetched as Job.</p>
  <p>Is there any way that I can map my bigquery fetched results directly to some POJO.</p>
  <pre><code>public class BQService {
      public String getValueMethod() throws Exception {
  
          BigQuery bigquery = BigQueryOptions
                  .getDefaultInstance()
                  .getService();
          final String GET_WORD_COUNT =
                  &quot;SELECT  Gender,Name FROM `DevWorks.GenderData` LIMIT 1000;&quot;;
          QueryJobConfiguration queryConfig =
                  QueryJobConfiguration.newBuilder(GET_WORD_COUNT).build();
  
  //Possible ways to make a direct POJO Mapping for the result of bigquery??
  
  
          Job queryJob = bigquery.create(JobInfo.newBuilder(queryConfig).build());
          queryJob = queryJob.waitFor();
          if (queryJob == null) {
              throw new Exception(&quot;job no longer exists&quot;);
          }
          if (queryJob.getStatus().getError() != null) {
              throw new Exception(queryJob.getStatus().getError().toString());
          }
          System.out.println(&quot;Gender\tName&quot;);
          TableResult result = queryJob.getQueryResults();
          List&lt;GenderData&gt; gdList=new ArrayList&lt;&gt;();
          result.iterateAll().forEach(tempObj-&gt;{
            mapToGenderData(tempObj,gdList);});
  
          System.out.println(Arrays.toString(gdList.toArray()));
          return &quot;success&quot;;
  
      }
  
      private void mapToGenderData(FieldValueList tempObj, List&lt;GenderData&gt; gdList) {
          GenderData gd=new GenderData();
          gd.setGender(tempObj.get(AppConstants.GENDER).getStringValue());
          gd.setName(tempObj.get(AppConstants.NAME).getStringValue());
          gdList.add(gd);
      }
  
  
  }
  </code></pre>