Gradle, Spring 启动, spring-boot-starter-data-jpa 升级
Gradle, Spring Boot, spring-boot-starter-data-jpa upgrade
我正在使用 Spring 引导版本 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
class (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 存储库 link hibernate 5.4)。总而言之,如果可能的话,我只想升级 spring 个数据片段,使用一个简单的衬垫,或者至少理解为什么我提到的方法不起作用。
从 Spring 引导版本 1.5.7.RELEASE
升级到版本 2.3.4.RELEASE
太冒险了。
你应该逐步升级小块。问题将很容易诊断。
我正在使用 Spring 引导版本 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
class (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 存储库 link hibernate 5.4)。总而言之,如果可能的话,我只想升级 spring 个数据片段,使用一个简单的衬垫,或者至少理解为什么我提到的方法不起作用。
从 Spring 引导版本 1.5.7.RELEASE
升级到版本 2.3.4.RELEASE
太冒险了。
你应该逐步升级小块。问题将很容易诊断。