title: Spring Data JPA Unable to locate Attribute with the given name
body: <p>I was trying to use <code>Spring Data JPA</code> on <code>Spring Boot</code> and I  kept getting error, I can't figure out what the problem is:</p>
  
  <blockquote>
    <p>Unable to locate Attribute  with the the given name [firstName] on
    this ManagedType [com.example.h2demo.domain.Subscriber]</p>
  </blockquote>
  
  <p>FirstName is declared in my entity class. I have used a service class with DAO before with different project and worked perfectly.</p>
  
  <p>My Entity class (getters and setters are also in the class) :</p>
  
  <pre><code>        @Entity
          public class Subscriber {
  
          @Id @GeneratedValue
          private long id;
          private String FirstName,LastName,Email;
  
          public Subscriber(long id, String firstName, String lastName, String email) {
              this.id = id;
              this.FirstName = firstName;
              this.LastName = lastName;
              this.Email = email;
            }
          }
  ...
  </code></pre>
  
  <p>My Repository Class</p>
  
  <pre><code>@Component
  public interface SubscriberRepository extends JpaRepository&lt;Subscriber,Long&gt; {
      Subscriber findByFirstName(String FirstName);
      Subscriber deleteAllByFirstName(String FirstName);
  }
  </code></pre>
  
  <p>My Service Class</p>
  
  <pre><code>@Service
  public class SubscriberService {
  
      @Autowired
      private SubscriberRepository subscriberRepository;
  
      public Subscriber findByFirstName(String name){
          return  subscriberRepository.findByFirstName(name);
  
      }
  
      public Subscriber deleteAllByFirstName(String name){
          return  subscriberRepository.deleteAllByFirstName(name);
  
      }
  
      public void addSubscriber(Subscriber student) {
          subscriberRepository.save(student);
      }
  }
  </code></pre>
  
  <p>And My Controller class:</p>
  
  <pre><code>@RestController
  @RequestMapping("/subscribers")
  public class SubscriberController {
  
      @Autowired
      private SubscriberService subscriberService;
  
      @GetMapping(value = "/{name}")
      public Subscriber findByFirstName(@PathVariable("name") String fname){
          return  subscriberService.findByFirstName(fname);
      }
  
      @PostMapping( value = "/add")
      public String insertStudent(@RequestBody final Subscriber subscriber){
          subscriberService.addSubscriber(subscriber);
          return "Done";
      }
  
  }
  </code></pre>