После перехода с
Spring Boot 1.5.X на версию
2.X посыпались ошибки:
"Inferred type 'S' for type parameter 'S' is not within its bound; should extend 'ua.com.philmo.backend.entity.ProjectEntity".
Мой код: ⏬⬇️⏬
GeneralDao.javapublic interface GeneralDao<T> {
T getById(Long id); // получение объекта по id
}
ProjectDao.javapublic interface ProjectDao extends GeneralDao<ProjectEntity> {
}
ProjectRepository.java@Repository
public interface ProjectRepository extends JpaRepository<ProjectEntity, Long> {
}
ProjectService.java@Service
public class ProjectService implements ProjectDao {
private final ProjectRepository projectRepository;
@Autowired
public ProjectService(ProjectRepository projectRepository) {
this.projectRepository = projectRepository;
}
@Override
public ProjectEntity getById(Long id) {
return projectRepository.findOne(id); // <-- ПРОБЛЕМНОЕ МЕСТО !!!!
}
}
♿️Как лечить ?