techdev-solutions / jaxenter-showcase

42 stars 32 forks source link

Missing Annotation on PersonRepository #1

Closed kentoj closed 9 years ago

kentoj commented 9 years ago

Is there supposed to be an @Repository or @RestRepository annotation on your repository class?

kentoj commented 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.

FrontierPsychiatrist commented 9 years ago

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.