title: Spring Boot JPA Query Error - "No property '' found for type '' " Exception
body: <p>I am currently studying an online Spring Boot course working with Spring Data JPA.</p>
  <p>My project includes 2 entities: BDProject and BDUser which have a many to one relationship. When attempting to find projects from user id the following exception is displayed.</p>
  <p><strong>EXCEPTION</strong></p>
  <pre><code>org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'BDProjectController': Unsatisfied dependency expressed through field 'bdProjectService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'BDProjectService': Unsatisfied dependency expressed through field 'bdProjectRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'BDProjectRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.project.bdproject.BDProjectRepository.findByUserID(java.lang.String)! No property userID found for type BDProject!
  </code></pre>
  <p>I have spent hours trying to figure out what's causing this exception, but nothing seems to be fixing it.</p>
  <p><strong>MY CODE:</strong></p>
  <p><strong>Entities</strong></p>
  <pre><code>@Entity
  public class BDUser {
  
  
  @Id
  private String userID;
  private String bdUsername;
  private String bdUserEmail;
  private String bdUserPassword;
  
  public BDUser(){
  }
  
  public BDUser(String userID, String bdUsername, String bdUserEmail, String bdUserPassword) {
      super();
      this.userID = userID;
      this.bdUsername = bdUsername;
      this.bdUserEmail = bdUserEmail;
      this.bdUserPassword = bdUserPassword;
  }
  // getters and setters...
  
  @Entity
  public class BDProject {
  
  @Id
  private String proID;
  private String proName;
  private String proCodeOwner;
  private String proIDs;
  @ManyToOne
  private BDUser bdUser;
  
  public BDProject() {
  }
  
  public BDProject(String proID, String proName, String proCodeOwner, String proIDs, String userID) {
      super();
      this.proID = proID;
      this.proName = proName;
      this.proCodeOwner = proCodeOwner;
      this.proIDs = proIDs;
      this.bdUser = new BDUser(userID, &quot;&quot;, &quot;&quot;, &quot;&quot;);
  }
  // getters and setters...
  </code></pre>
  <p><strong>Controller</strong></p>
  <pre><code>@RestController
  public class BDProjectController {
  
  @Autowired
  private BDProjectService bdProjectService;
  
  @RequestMapping(&quot;/bdusers/{userID}/bdprojects&quot;)
  public List&lt;BDProject&gt; getAllProjects(@PathVariable String proID){
      return bdProjectService.getAllProjects(proID);
  }
  
  @RequestMapping(&quot;/bdusers/{userID}/bdprojects/{proID}&quot;)
  public BDProject getProject(@PathVariable String proID){
      return bdProjectService.getProject(proID);
  }
  
  @RequestMapping(method= RequestMethod.POST, value=&quot;/bdusers/{userID}/bdprojects&quot;)
  public void addProject(@RequestBody BDProject bdProject, @PathVariable String userID){
      bdProject.setBdUser(new BDUser(userID, &quot;&quot;, &quot;&quot;, &quot;&quot;));
      bdProjectService.addProject(bdProject);
  }
  
  @RequestMapping(method= RequestMethod.PUT, value=&quot;/bdusers/{userID}/bdprojects/{proID}&quot;)
  public void updateProject(@RequestBody BDProject bdProject, @PathVariable String userID, @PathVariable String proID){
      bdProject.setBdUser(new BDUser(userID, &quot;&quot;, &quot;&quot;, &quot;&quot;));
      bdProjectService.updateProject(bdProject);
  }
  
  @RequestMapping(method= RequestMethod.DELETE, value=&quot;/bdusers/{userID}/bdprojects/{proID}&quot;)
  public void deleteProject(@PathVariable String proID){
      bdProjectService.deleteProject(proID);
  }
  </code></pre>
  <p>}</p>
  <p><strong>Service</strong></p>
  <pre><code>@Service
  public class BDProjectService {
  
  @Autowired
  private BDProjectRepository bdProjectRepository;
  
  public List&lt;BDProject&gt; getAllProjects(String userID){
      List&lt;BDProject&gt; bdProjects = new ArrayList&lt;&gt;();
      bdProjectRepository.findByUserID(userID).forEach(bdProjects::add);
      return bdProjects;
  }
  
  public BDProject getProject(String proID){
  
      return bdProjectRepository.findById(proID).orElse(null);
  }
  
  public void addProject(BDProject BDProject){
  
      bdProjectRepository.save(BDProject);
  }
  
  public void updateProject(BDProject BDProject){
  
      bdProjectRepository.save(BDProject);
  }
  
  public void deleteProject(String proID){
  
      bdProjectRepository.deleteById(proID);
  }
  
  }
  </code></pre>
  <p><strong>Repository</strong></p>
  <pre><code>public interface BDProjectRepository extends CrudRepository&lt;BDProject, String&gt;{
  
      public List&lt;BDProject&gt; findByUserID(String userID);
  
  }
  </code></pre>
  <p>Any and all help is much appreciated. Thanks!</p>