title: Why spring data jpa unnecessary @Repository?
body: <p>I've looked through various documents and questions about it, but I haven't been able to find a clear answer.</p>
  <p>I don't know how an <strong>interface</strong> that extends JpaRepository can be registered as a bean, and why it doesn't need the @Repository annotation.</p>
  <p>In Spring, an interface cannot register a bean with that type without an implementation.</p>
  <p>So I tried experimenting like JpaRepository myself, but it didn't work.</p>
  <pre class="lang-java prettyprint-override"><code>// JpaRepository
  @NoRepositoryBean
  public interface WackRepository {
  
  }
  
  // SimpleJpaRepository
  @Repository
  public class WackRepositoryImpl implements WackRepository {
      
  }
  
  public interface HelloRepository extends WackRepository {
  
  }
  
  @RestController
  @RequiredArgsConstructor
  public class HelloController {
  
      private final HelloRepository helloRepository;
  
  }
  
  </code></pre>
  <p>Parameter 0 of constructor in com.example.demo.HelloController required a bean of type 'com.example.demo.HelloRepository' that could not be found</p>
  <p>HelloController, of course, has no implementation, so it is not registered as a bean and throws an exception.</p>