Я определил интерфейсы и реализации репозитория
ARRepository
Код: Выделить всё
@Repository
public interface ARepository extends CrudRepository, ARepositoryCustom, JpaSpecificationExecutor {
}
Код: Выделить всё
@Repository
public interface ARepositoryCustom {
Page findA(findAForm form, Pageable pageable);
}
Код: Выделить всё
@Repository
public class ARepositoryImpl implements ARepositoryCustom {
@Autowired
private ARepository aRepository;
@Override
public Page findA(findAForm form, Pageable pageable) {
return aRepository.findAll(
where(ASpecs.codeLike(form.getCode()))
.and(ASpecs.labelLike(form.getLabel()))
.and(ASpecs.isActive()),
pageable);
}
}
Код: Выделить всё
@Service
public class AServiceImpl implements AService {
private ARepository aRepository;
public AServiceImpl(ARepository aRepository) {
super();
this.aRepository = aRepository;
}
...
}
****** *********************
ПРИЛОЖЕНИЕ НЕ ЗАПУСТИЛО
***************** **********
Описание:
Зависимости некоторых компонентов в контексте приложения образуют цикл:
| aRepositoryImpl
└────┘
Я выполнил все шаги, описанные в http://docs.spring.io/spring-data /jpa/docs/current/reference/html/#repositories.single-repository-behaviour
Пожалуйста, помогите!
Лоран
Подробнее здесь: https://stackoverflow.com/questions/416 ... rm-a-cycle
Мобильная версия