Skip to content

Commit 2efcb1d

Browse files
committed
add tests for UPDATE queries in reactive and regular repos
1 parent 3b3bd5e commit 2efcb1d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tooling/metamodel-generator/src/jakartaData/java/org/hibernate/processor/test/data/basic/BookAuthorRepository.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,13 @@ public interface BookAuthorRepository {
213213

214214
@Query("")
215215
List<Author> withNoOrder2(PageRequest pageRequest);
216+
217+
@Query("update Author set name = :name where ssn = :id")
218+
void updateAuthorAddress1(String id, String name);
219+
220+
@Query("update Author set name = :name where ssn = :id")
221+
int updateAuthorAddress2(String id, String name);
222+
223+
@Query("update Author set name = :name where ssn = :id")
224+
boolean updateAuthorAddress3(String id, String name);
216225
}

tooling/metamodel-generator/src/jakartaData/java/org/hibernate/processor/test/data/reactive/Library.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,13 @@ record BookWithAuthor(Book book, Author author) {}
107107

108108
@Find
109109
Uni<List<Author>> authorsByCityAndPostcode(String address_city, String address_postcode);
110+
111+
@Query("update Author set address = :address where ssn = :id")
112+
Uni<Void> updateAuthorAddress1(String id, Address address);
113+
114+
@Query("update Author set address = :address where ssn = :id")
115+
Uni<Integer> updateAuthorAddress2(String id, Address address);
116+
117+
@Query("update Author set address = :address where ssn = :id")
118+
Uni<Boolean> updateAuthorAddress3(String id, Address address);
110119
}

0 commit comments

Comments
 (0)