title: Why my query return empry list and gives no error? Java Spring Jpa Repository
body: <p>Here is my entity class:</p>
  <pre><code>package com.test.model;
  
  import java.sql.Timestamp;
  
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  import javax.persistence.Table;
  
  import com.fasterxml.jackson.annotation.JsonFormat;
  
  @Entity
  @Table(name = &quot;Ergebnisse&quot;)
  public class Ergebnisse{
      
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int id;
      
      @Column(name = &quot;messwert&quot;)
      private double Messwert;
      
      @Column(name = &quot;einheit&quot;)
      private String Einheit;
      
      @Column(name = &quot;material&quot;)
      private String Material;
      
      @Column(name = &quot;laboreingangsdatum&quot;)
      @JsonFormat(pattern=&quot;yyyy-MM-dd&quot;)
      private Timestamp Laboreingangsdatum;
      
      @Column(name = &quot;status&quot;)
      private String Status;
      
      @Column(name = &quot;parameter&quot;)
      private String Parameter;
  
      public int getId() {
          return id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  
      public double getMesswert() {
          return Messwert;
      }
  
      public void setMesswert(double messwert) {
          Messwert = messwert;
      }
  
      public String getEinheit() {
          return Einheit;
      }
  
      public void setEinheit(String einheit) {
          Einheit = einheit;
      }
  
      public String getMaterial() {
          return Material;
      }
  
      public void setMaterial(String material) {
          Material = material;
      }
  
      public Timestamp getLaboreingangsdatum() {
          return Laboreingangsdatum;
      }
  
      public void setLaboreingangsdatum(Timestamp laboreingangsdatum) {
          Laboreingangsdatum = laboreingangsdatum;
      }
  
      public String getStatus() {
          return Status;
      }
  
      public void setStatus(String status) {
          Status = status;
      }
  
      public String getParameter() {
          return Parameter;
      }
  
      public void setParameter(String parameter) {
          Parameter = parameter;
      }
      
      
      
  }
  </code></pre>
  <p>Here is my Repository:</p>
  <pre><code>package com.test.repository;
  
  
  import java.util.List;
  
  
  import org.springframework.data.jpa.repository.JpaRepository;
  import org.springframework.data.jpa.repository.Query;
  import org.springframework.data.repository.query.Param;
  import org.springframework.stereotype.Repository;
  
  import com.test.model.Ergebnisse;
  
  @Repository
  public interface ErgebnisseRepository extends JpaRepository&lt;Ergebnisse,Integer&gt; {
  
      @Query(&quot;FROM Ergebnisse where Material=:Material&quot;)
      List&lt;Ergebnisse&gt; findMaterial(@Param(&quot;Material&quot;) String Material);
  
  }
  </code></pre>
  <p>And my controller:</p>
  <pre><code>package com.test.controllers;
  
  import java.util.List;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.data.domain.PageRequest;
  import org.springframework.data.domain.Pageable;
  import org.springframework.web.bind.annotation.CrossOrigin;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RestController;
  
  import com.test.load.ErgebnisseRequest;
  import com.test.model.Ergebnisse;
  import com.test.repository.ErgebnisseRepository;
  
  @RestController
  @CrossOrigin(origins = &quot;*&quot;)
  @RequestMapping(&quot;/api&quot;)
  public class ErgebnisseController {
      
      @Autowired
      ErgebnisseRepository repository;
      
  
      @RequestMapping(value=&quot;/ergebnisse&quot;, method=RequestMethod.GET)
      public List&lt;Ergebnisse&gt; getData(ErgebnisseRequest request){
          
          
          List&lt;Ergebnisse&gt; ergebnisseList = repository.findAll();
          
          return ergebnisseList;
          
          
      }
      
      @RequestMapping(value=&quot;/search&quot;, method=RequestMethod.GET)
      public List&lt;Ergebnisse&gt; Search(ErgebnisseRequest request){
          
          
          List&lt;Ergebnisse&gt; ergebnisseList = repository.findMaterial(request.getMaterial());
          
          return ergebnisseList;
          
          
      }
  </code></pre>
  <p>Here is my Database:
  <a href="https://i.stack.imgur.com/ylySw.png" rel="nofollow noreferrer">My Database</a></p>
  <p>Edit:
  Here is my ErgebnisseRequest class:</p>
  <pre><code>package com.test.load;
  
  import java.sql.Timestamp;
  
  import javax.persistence.Column;
  
  import com.fasterxml.jackson.annotation.JsonFormat;
  
  public class ErgebnisseRequest {
      
      @Column(name=&quot;material&quot;)
      private String material;
      
      
      
  
      public String getMaterial() {
          return material;
      }
  
      public void setMaterial(String material) {
          this.material = material;
      }
  
  
  }
  </code></pre>
  <p>So the repository.findAll() gives me all the data from the database. But when i am trying to search by Material it gives me a emptylist and no error. I try all of it like changing the uppercase letters to lowercase etc.. and help would be appreciated.</p>
  <p>Here is the photo of it in Postman:
  <a href="https://i.stack.imgur.com/UGweC.png" rel="nofollow noreferrer">find by Material test</a></p>