title: Spring Data JPA Repository findAll() Null Pointer
body: <p>I have a Spring-Boot API with the endpoint below. It is throwing a Null Pointer Exception on a Spring Data JPA <code>findAll</code> query; when I comment out this line, I get no errors. It seems that I am getting a null result from the repository query, but I know the data is there from querying the DB directly. I cannot understand why I'm getting a null for <code>topicsLookup</code> variable... Can anyone point me in the right direction?</p>
  
  <p><strong>Resource:</strong></p>
  
  <pre><code>@RequestMapping(value = "/lectures/{lectureId}",
          method = RequestMethod.GET,
          produces = MediaType.APPLICATION_JSON_VALUE)
  public Map&lt;String, SpeakerTopicLectures&gt; getLecture(@PathVariable Long lectureId){
  
          Long requestReceived = new Date().getTime();
          Map&lt;String, SpeakerTopicLectures&gt; result = new HashMap&lt;&gt;();
  
          log.debug("** GET Request to getLecture");
          log.debug("Querying results");
  
          List&lt;SpeakerTopicLectures&gt; dataRows = speakerTopicLecturesRepository.findBySpeakerTopicLecturesPk_LectureId(lectureId);
  
          // This line throws the error
          List&lt;SpeakerTopic&gt; topicsLookup = speakerTopicsRepository.findAll();
  
          // Do stuff here...
  
          log.debug("Got {} rows", dataRows.size());
          log.debug("Request took {}ms **", (new Date().getTime() - requestReceived));
  
          // wrap lecture in map object
          result.put("content", dataRows.get(0));
  
          return result;
  }
  </code></pre>
  
  <p><strong>Java Bean:</strong></p>
  
  <pre><code>@Entity
  @Table(name = "speaker_topics")
  @JsonInclude(JsonInclude.Include.NON_NULL)
  @Data
  public class SpeakerTopic implements Serializable {
  
      @Id
      @Column(name = "topic_id")
      private Long topicId;
  
      @Column(name = "topic_nm")
      private String topicName;
  
      @Column(name = "topic_desc")
      private String topicDesc;
  
      @Column(name = "topic_acm_relt_rsce")
      private String relatedResources;
  
  }
  </code></pre>
  
  <p><strong>Repository:</strong></p>
  
  <pre><code>import org.acm.dl.api.domain.SpeakerTopic;
  import org.springframework.data.jpa.repository.JpaRepository;
  
  public interface SpeakerTopicsRepository extends JpaRepository&lt;SpeakerTopic,Long&gt; {
  
  }
  </code></pre>