я использую spring-data-jpa. Без весенней загрузки.
package ru.spb.repository;
public interface CrudUserRepository extends JpaRepository<User, Integer> {
}
хранилище.
package ru.spb.repository;
@Repository
public class UserRepository {
@Autowired
private CrudUserRepository crudRepository;
}
xml -config-файлы:
spring-app. xml
<context:component-scan base-package="ru.spb.service"/>
<context:component-scan base-package="ru.spb.repository"/
spring-db. xml:
<context:component-scan base-package="ru.spb.repository" />
<jpa:repositories base-package="ru.spb.repository"/>
в пом
<spring-data-jpa.version>2.2.0.RELEASE</spring-data-jpa.version>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>${spring-data-jpa.version}</version>
</dependency>
Но я ловлю:
NoSuchBeanDefinitionException: No qualifying bean of type 'ru.spb.repository.user.CrudUserRepository' available: expected at least 1 bean which qualifies as autowire candidate