Skip to content

Commit

Permalink
chore: aling update method at the CrudRepository
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <[email protected]>
  • Loading branch information
otaviojava committed Mar 17, 2024
1 parent 1f2c863 commit 9fb86bd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/src/main/java/jakarta/data/repository/CrudRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,15 @@ public interface CrudRepository<T, K> extends BasicRepository<T, K> {
* the update.</p>
*
* @param entity the entity to update. Must not be {@code null}.
* @param <S> Type of the entity to insert.
* @return an updated entity instance including all automatically generated values,
* updated versions, and incremented values which changed as a result of the update.
* @throws OptimisticLockingFailureException the entity is not found in the database
* or has a version that differs from the version in the database.
* @throws NullPointerException if the entity is null.
*/
@Update
T update(T entity);
<S extends T> S update(S entity);

/**
* <p>Modifies entities that already exist in the database.</p>
Expand All @@ -175,6 +176,6 @@ public interface CrudRepository<T, K> extends BasicRepository<T, K> {
* @throws NullPointerException if either the supplied {@code Iterable} is null or any element is null.
*/
@Update
Iterable<T> updateAll(Iterable<T> entities);
<S extends T> updateAll(Iterable<T> entities);

}

0 comments on commit 9fb86bd

Please sign in to comment.