我正在使用Spring Boot版本1.5.7.RELEASE,并希望使用下面的一些代码来实现一些分页功能,比如
Pageable pageable = PageRequest.of(0, 1, org.springframework.data.domain.Sort.by(Sort.Direction.ASC, "seatNumber"));但是,我的org.springframework.data.domain.Sort版本没有by方法。当我更新包含Sort类(spring-data-commons)的单个JAR时,编译错误就消失了,但我得到了一堆其他错误。
所以我试着这样做
compile 'org.springframework.boot:spring-boot-starter-data-jpa:2.3.4.RELEASE'希望更“全面”地升级所有的Spring数据片段,但这似乎没有任何作用(仍然有旧版本的spring-data-commons)。https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa/2.3.4.RELEASE
我假设“指向”它也会升级所有依赖项,但我仍然使用hibernate 5.0,而不是(根据Maven存储库链接hibernate 5.4)。总之,如果可能的话,我想只升级spring数据部分,使用一个简单的一行,或者至少理解为什么做我提到的事情不起作用。
发布于 2020-10-03 18:03:04
从Spring Boot版本1.5.7.RELEASE升级到2.3.4.RELEASE版本太冒险了。
你应该逐步升级小块。问题很容易诊断。
https://stackoverflow.com/questions/64173194
复制相似问题