I am developing a Spring boot application that uses some Spring repository interfaces:
package test; @SpringBootApplication public class Application implements CommandLineRunner { @Autowired private BookRepository repository; . . . }
I see that the BookRepository interface (which follows here) can only be entered if it is in the same package as the Application class:
package test; public interface BookRepository extends MongoRepository<Book, String> { public Book findByTitle(String title); public List<Book> findByType(String type); public List<Book> findByAuthor(String author); }
Is there any Spring boot annotation that I can apply in my classes to find BookRepository in another package?
source share