Closed kentoj closed 9 years ago
It worked for me without it. I was having issues finding my repository though it turned out to be my PersistenceConfiguration.java needed to be in a higher package than my PersonRepository.java in order for the component scanning to work properly.
Everything works without a @Repository annotation.
Hi!
Yes, the auto configuration for Spring Data JPA repositories should pick them up automatically. @ComponentScan
takes the package of its class as the base scanning package as a default, so you're right, the configuration must be in a higher or equal package of the repositories.
Is there supposed to be an
@Repository
or@RestRepository
annotation on your repository class?