Skip to content

Commit

Permalink
add tests for UPDATE queries in reactive and regular repos
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed Dec 20, 2024
1 parent 3b3bd5e commit 2efcb1d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,13 @@ public interface BookAuthorRepository {

@Query("")
List<Author> withNoOrder2(PageRequest pageRequest);

@Query("update Author set name = :name where ssn = :id")
void updateAuthorAddress1(String id, String name);

@Query("update Author set name = :name where ssn = :id")
int updateAuthorAddress2(String id, String name);

@Query("update Author set name = :name where ssn = :id")
boolean updateAuthorAddress3(String id, String name);
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,13 @@ record BookWithAuthor(Book book, Author author) {}

@Find
Uni<List<Author>> authorsByCityAndPostcode(String address_city, String address_postcode);

@Query("update Author set address = :address where ssn = :id")
Uni<Void> updateAuthorAddress1(String id, Address address);

@Query("update Author set address = :address where ssn = :id")
Uni<Integer> updateAuthorAddress2(String id, Address address);

@Query("update Author set address = :address where ssn = :id")
Uni<Boolean> updateAuthorAddress3(String id, Address address);
}

0 comments on commit 2efcb1d

Please sign in to comment.