I am learning Spring Webflux. In some code samples they add a org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories annotation to the main class [example]
@SpringBootApplication
@EnableR2dbcRepositories
public class SpringReactiveApplication {
public static void main(String[] args) {
SpringApplication.run(SpringReactiveApplication.class, args);
}
}
and in others they don't [example]. I have tried it both ways with no difference in the result. So I am trying to understand when do we need this annotation and when we don't?
There is another annotation that I have seen some examples use and other's don't. That is org.springframework.stereotype.Repository. In some examples [e.g.] I see:
@Repository
public interface CustomerRepository extends
ReactiveCrudRepository<Customer, Long> {
others don't use it. so asking same question for this annotation as well.