title: MySQL has a table with 2 columns. How to generate list with only single column?
body: <p>MySQL database includes a table with two column. I am trying to generate a list to display data of one column only. I have tried @Query but it is throwing Casting error. Is there other possible alternative? Appreciate some guidance for this newbie here. Thank you! </p>
  
  <p>When I remove the @Query, both columns are extracted from mySQL correctly, so there's no issue with the connection. </p>
  
  <pre><code>@Query("select p.date from PublicHoliday p" )
      List&lt;PublicHoliday&gt; findAll();
  </code></pre>
  
  <pre><code>    List&lt;PublicHoliday&gt; phList = phRepo.findAll();
  </code></pre>
  
  <p>Error message from web:</p>
  
  <pre><code>Failed to convert from type [java.util.ArrayList&lt;?&gt;] to type [@org.springframework.data.jpa.repository.Query java.util.List&lt;sg.edu.nus.lms1.model.PublicHoliday&gt;] for value '[2019-05-19, 2019-05-20, 2019-06-04, 2019-08-09]'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [@org.springframework.data.jpa.repository.Query sg.edu.nus.lms1.model.PublicHoliday]
  </code></pre>
  
  <p>Even if I change it to ArrayList in the codes:</p>
  
  <pre><code>Failed to convert from type [java.util.ArrayList&lt;?&gt;] to type [@org.springframework.data.jpa.repository.Query java.util.ArrayList&lt;sg.edu.nus.lms1.model.PublicHoliday&gt;] for value '[2019-05-19, 2019-05-20, 2019-06-04, 2019-08-09]'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [@org.springframework.data.jpa.repository.Query sg.edu.nus.lms1.model.PublicHoliday]
  </code></pre>