title: How to find data in database in Spring Boot by my variable?
body: <p>I have this code:</p>
  
  <pre><code>@GetMapping("/notes/{id}")
  public ResponseEntity&lt;Note&gt; getNoteById(@PathVariable(value = "id") Long id) {
      Note note = noteRepository.findOne(id);
      if(note == null) {
          return ResponseEntity.notFound().build();
      }
      return ResponseEntity.ok().body(note);
  }
  </code></pre>
  
  <p>So this method just finds information by the sent id.
  The method <code>noteRepository.findOne()</code> accepts only <code>Long</code> or <code>class extends org.springframework.data.domain.Example</code></p>
  
  <p>I want to retrive data by my own variable <code>"secretkey"</code> (String). How can I do this?</p>