Я пытаюсь использовать стандартную спецификацию Jpa с весенней загрузкой, но эта проблема появилась.
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-05-23 18:18:27.340 ERROR 1048 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaSpecificationRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class java.lang.Object.
в моем коде я пытаюсь использовать концепцию модуля, поэтому у меня есть 5 модулей (сущностей,dao, service, web и frontend with angular), так что это мой код:
Мой общий интерфейс спецификации Jpa.
public interface JpaSpecificationRepository<T, ID extends Serializable>
extends JpaRepository<T, ID>, JpaSpecificationExecutor<T> {
}
Пример репозитория.
public interface HelloRepository extends JpaSpecificationRepository<Hello, Long> {
}
Служба
@Service
public class HelloServiceImpl extends AbstractCRUDService<Hello, Long, HelloDto> {
@Autowired
protected HelloServiceImpl(HelloRepository repository, DozerBeanMapper mapper) {
super(repository, mapper, Hello.class, HelloDto.class);
}
}
и контроллер
@RestController
@CrossOrigin("*")
@RequestMapping("/hello")
public class HelloController extends AbstractCRUDBackOfficeController<Long, HelloDto> {
@Autowired
HelloController(HelloServiceImpl service) {
super(service);
}
}