Inferred type 'S' for type parameter 'S' is not within its bound;
错误:
在使用springboot 方法报错:
Inferred type 'S' for type parameter 'S' is not within its bound; should extend 'com.atguigu.springboot06.entiy.User
解决方法:
1、springboot 版本问题,将 2.0.1 版本换成 1.5.4 版本。
2、将userRepository.findOne(id); ——》改为 userRepository.findById(id).orElse(null);
——》或userRepository.findById(id).get();
如图所示:
错误的:

正确的:

 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号