JAVA-20167 Remove methods that are not presented in articles
This commit is contained in:
parent
80d7e13b3c
commit
c76a1e8c45
|
@ -51,13 +51,6 @@ public interface UserRepository extends JpaRepository<User, Integer> {
|
|||
|
||||
List<User> findByAgeIn(Collection<Integer> ages);
|
||||
|
||||
@Query(value = "select * from users where (name = :nameParam OR birth_date <> :birthDateParam)", nativeQuery = true)
|
||||
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> findByNameOrBirthDateAndActive(@Param(value = "nameParam") String nameParam, @Param(value = "birthDateParam") ZonedDateTime birthDateParam,
|
||||
@Param(value = "activeParam") Boolean activeParam);
|
||||
|
||||
List<User> findByNameOrAge(String name, Integer age);
|
||||
|
||||
List<User> findByNameOrAgeAndActive(String name, Integer age, Boolean active);
|
||||
|
|
|
@ -152,28 +152,16 @@ public class UserRepositoryIntegrationTest {
|
|||
assertEquals(3, userRepository.findByAgeIn(ages).size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenByNameOrBirthDate() {
|
||||
|
||||
assertEquals(4, userRepository.findByNameOrBirthDate(USER_NAME_ADAM, BIRTHDATE).size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenByNameOrBirthDateAndActive() {
|
||||
|
||||
assertEquals(2, userRepository.findByNameOrBirthDateAndActive(USER_NAME_ADAM, BIRTHDATE, false).size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenByNameOrAge() {
|
||||
|
||||
assertEquals(2, userRepository.findByNameOrAge(USER_NAME_ADAM, 20).size());
|
||||
assertEquals(3, userRepository.findByNameOrAge(USER_NAME_ADAM, 20).size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenByNameOrAgeAndActive() {
|
||||
|
||||
assertEquals(3, userRepository.findByNameOrAgeAndActive(USER_NAME_ADAM, 20, false).size());
|
||||
assertEquals(2, userRepository.findByNameOrAgeAndActive(USER_NAME_ADAM, 20, false).size());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue