I created a basic Repository for my model "BoardingPass".
@Repository
public interface BoardingPassRepository extends MongoRepository<BoardingPass, String> {
}
When trying to use the Repository, IntelliJ underlines the repository red and displays me "Could not autowire. No Beans of "BoardingPassRepository" found.". I fixed this problem by using @EnableMongoRepository, so now the Application runs, yet IntelliJ still displays this error. How do I correctly fix this problem so that not only the program runs, but also IntelliJ accepts it?
@SpringBootApplication
@EnableMongoRepositories(basePackageClasses = BoardingPassRepository.class)
public class Main implements CommandLineRunner {
@Autowired
private BoardingPassRepository repository;
public static void main(String[] args) {
SpringApplication.run(Main.class, args);
}
@Override
public void run(String... args) throws Exception {
}
}