Merge pull request #14166 from timis1/JAVA-20167_1

JAVA-20167 Migrate spring-data-mongodb to JDK 17
This commit is contained in:
Loredana Crusoveanu 2023-06-17 18:04:25 +03:00 committed by GitHub
commit 6301d6f118
4 changed files with 12 additions and 17 deletions

View File

@ -40,8 +40,6 @@
<module>java-jpa</module> <!-- long running --> <module>java-jpa</module> <!-- long running -->
<module>java-jpa-2</module> <module>java-jpa-2</module>
<module>java-jpa-3</module> <module>java-jpa-3</module>
<!-- enable it when persistence-modules is migrated to JDK9+ -->
<!-- <module>java-mongodb</module>--> <!-- long running -->
<module>java-mongodb-2</module> <!-- long running --> <module>java-mongodb-2</module> <!-- long running -->
<module>java-mongodb-3</module> <!-- long running --> <module>java-mongodb-3</module> <!-- long running -->
<module>java-mongodb-queries</module> <!-- long running --> <module>java-mongodb-queries</module> <!-- long running -->
@ -90,7 +88,7 @@
<module>spring-data-jpa-repo-2</module> <module>spring-data-jpa-repo-2</module>
<module>spring-data-jdbc</module> <module>spring-data-jdbc</module>
<module>spring-data-keyvalue</module> <module>spring-data-keyvalue</module>
<!-- <module>spring-data-mongodb</module> FAILED --> <module>spring-data-mongodb</module>
<module>spring-data-mongodb-2</module> <module>spring-data-mongodb-2</module>
<module>spring-data-mongodb-reactive</module> <module>spring-data-mongodb-reactive</module>
<module>spring-data-redis</module> <module>spring-data-redis</module>

View File

@ -51,12 +51,9 @@ public interface UserRepository extends JpaRepository<User, Integer> {
List<User> findByAgeIn(Collection<Integer> ages); List<User> findByAgeIn(Collection<Integer> ages);
@Query(value = "select * from users where (name = :nameParam OR birth_date <> :birthDateParam)", nativeQuery = true) List<User> findByNameOrAge(String name, Integer age);
List<User> findByNameOrBirthDate(@Param(value = "nameParam") String nameParam, @Param(value = "birthDateParam") ZonedDateTime birthDateParam);
@Query(value = "select * from users where (name = :nameParam OR birth_date <> :birthDateParam) and active = :activeParam", nativeQuery = true) List<User> findByNameOrAgeAndActive(String name, Integer age, Boolean active);
List<User> findByNameOrBirthDateAndActive(@Param(value = "nameParam") String nameParam, @Param(value = "birthDateParam") ZonedDateTime birthDateParam,
@Param(value = "activeParam") Boolean activeParam);
List<User> findByNameOrderByName(String name); List<User> findByNameOrderByName(String name);

View File

@ -153,15 +153,15 @@ public class UserRepositoryIntegrationTest {
} }
@Test @Test
public void whenByNameOrBirthDate() { public void whenByNameOrAge() {
assertEquals(4, userRepository.findByNameOrBirthDate(USER_NAME_ADAM, BIRTHDATE).size()); assertEquals(3, userRepository.findByNameOrAge(USER_NAME_ADAM, 20).size());
} }
@Test @Test
public void whenByNameOrBirthDateAndActive() { public void whenByNameOrAgeAndActive() {
assertEquals(2, userRepository.findByNameOrBirthDateAndActive(USER_NAME_ADAM, BIRTHDATE, false).size()); assertEquals(2, userRepository.findByNameOrAgeAndActive(USER_NAME_ADAM, 20, false).size());
} }
@Test @Test

View File

@ -103,13 +103,13 @@
</build> </build>
<properties> <properties>
<org.springframework.data.version>3.0.3.RELEASE</org.springframework.data.version> <org.springframework.data.version>3.4.7</org.springframework.data.version>
<querydsl.version>4.3.1</querydsl.version> <querydsl.version>5.0.0</querydsl.version>
<mysema.maven.version>1.1.3</mysema.maven.version> <mysema.maven.version>1.1.3</mysema.maven.version>
<mongodb-reactivestreams.version>4.1.0</mongodb-reactivestreams.version> <mongodb-reactivestreams.version>4.1.0</mongodb-reactivestreams.version>
<projectreactor.version>3.2.0.RELEASE</projectreactor.version> <projectreactor.version>3.5.4</projectreactor.version>
<mongodb-driver.version>4.0.5</mongodb-driver.version> <mongodb-driver.version>4.6.1</mongodb-driver.version>
<embed.mongo.version>3.2.6</embed.mongo.version> <embed.mongo.version>4.6.3</embed.mongo.version>
</properties> </properties>
</project> </project>