title: Empty result from rest api
body: <p>I want to create a service in order to populate dropdown from database. I tried this:</p>
  
  <p>Merchant Class:</p>
  
  <pre><code>export class Merchant {
    constructor(
      public id: string,
      public name: string,
      public state_raw: string,
      public users: string,
    ) {}
  }
  </code></pre>
  
  <p>Merchant Service:</p>
  
  <pre><code> getList(): Observable&lt;Merchant&gt; {
      return this.http.get&lt;Merchant&gt;(environment.api.urls.merchants.base, {});
    }
  </code></pre>
  
  <p>SQL query:</p>
  
  <pre><code>@Override
      public Iterable&lt;Merchants&gt; findAll() {
          String hql = "select e from " + Merchants.class.getName() + " e";
          TypedQuery&lt;Merchants&gt; query = entityManager.createQuery(hql, Merchants.class);
          List&lt;Merchants&gt; merchants = query.getResultList();
          return merchants;
      }
  </code></pre>
  
  <p>Working example:</p>
  
  <pre><code>    @GetMapping("/list")
  public Iterable&lt;Merchants&gt; getMerchantsList() {
      return merchantRepository
              .findAll();
  }
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>@GetMapping("/list")
  public ResponseEntity&lt;?&gt; getMerchantsList() {
      return StreamSupport.stream(merchantRepository.findAll().spliterator(), false)
              .map(mapper::toDTO)
              .map(ResponseEntity::ok)
              .findFirst()
              .orElseGet(() -&gt; notFound().build());
  }
  </code></pre>
  
  <p>I want to use mapper before I send the response. Currently the list in Angular is empty. Probably I should return <code>Iterable&lt;Merchants&gt;</code> not <code>ResponseEntity&lt;MerchantDTO&gt;</code>?</p>
  
  <p>I use Java 10.</p>