title: result returns more than one elements; nested exception is javax.persistence.NonUniqueResultException: result returns more than one elements
body: <p>I am doing library application. So, in that i need to search a book by its title .</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>@GetMapping(path="/viewBook")
  public String viewBook(Book book,HttpServletRequest request)
  {
      request.setAttribute("mode", "MODE_VIEW");
              request.setAttribute("tb", bookService.findByTitle(book.getTitle()));
            return "homepage";
  
  
          }
  </code></pre>
  
  <p><strong>JSP page</strong></p>
  
  <pre><code>&lt;c:when test="${mode=='MODE_VIEW' }"&gt;
      &lt;div class="container text-center"&gt;
          &lt;h3&gt;Add A Book&lt;/h3&gt;
          &lt;hr&gt;
          &lt;form class="form-horizontal" method="GET" action="/viewBook"&gt;
              &lt;div class="form-group"&gt;
                  &lt;label class="control-label col-md-3"&gt;Enter Title&lt;/label&gt;
                  &lt;div class="col-md-7"&gt;
                      &lt;input type="text" class="form-control" name="title"
                                  value="${book .title}" /&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="form-group "&gt;
                  &lt;input type="submit" class="btn btn-primary" value="View" /&gt;
              &lt;/div&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/c:when&gt;
  </code></pre>
  
  <p><strong>Service class</strong></p>
  
  <pre><code>public String findByTitle(String title) {
  
      return BookRepo.findByTitle(title);
  }
  </code></pre>
  
  <p><strong>BookRepo</strong></p>
  
  <pre><code>public interface BookRepository extends CrudRepository&lt;Book,Integer&gt; {
  
      public String findByTitle(String title);
  
  }
  </code></pre>
  
  <p><strong>Book</strong></p>
  
  <pre><code>@Entity
  @Table(name="Boooks")
  public class Book {
  
  
      public int id;
      private String author;
      private String title;
  
  
  
      public Book()
      {
  
      }
      public Book(String author, String title, int id) {
          super();
          this.id=id;
          this.author = author;
          this.title = title;
      }
      @Id
      //here comes getters and setters i have omitted them here.
  
      @Override
      public String toString() {
          return "Book [id=" + id + ", author=" + author + ", title=" + title + "]";
      }
  
  
  }
  </code></pre>
  
  <p>I am getting this error</p>
  
  <blockquote>
    <p>javax.persistence.NonUniqueResultException: result returns more than one elements</p>
  </blockquote>