diff --git a/api/src/main/java/jakarta/data/repository/Delete.java b/api/src/main/java/jakarta/data/repository/Delete.java index ee5e015ea..214e06940 100644 --- a/api/src/main/java/jakarta/data/repository/Delete.java +++ b/api/src/main/java/jakarta/data/repository/Delete.java @@ -28,8 +28,9 @@ *

Lifecycle annotation for repository methods which perform delete operations.

* *

The {@code Delete} annotation indicates that the annotated repository method deletes the state of one or more - * entities from the database. + * entities from the database. The method must follow one of the following patterns. *

+ *

Parameter for Entity Instances

*

A {@code Delete} method might accept an instance or instances of an entity class. In this case, the method must * have exactly one parameter whose type is either: *

@@ -40,8 +41,6 @@ *

The annotated method must be declared {@code void}. *

*

All Jakarta Data providers are required to accept a {@code Delete} method which conforms to this signature. - * Application of the {@code Delete} annotation to a method with any other signature is not portable between Jakarta - * Data providers, excepting the specific case of a repository method with no parameters, as described below. *

*

For example, consider an interface representing a garage:

*
@@ -57,6 +56,7 @@
  * if the entity with a matching identifier does not have a matching version, the annotated method must raise
  * {@link jakarta.data.exceptions.OptimisticLockingFailureException}.
  * 

+ *

Without Parameters

*

Alternatively, the {@code Delete} annotation may be applied to a repository method with no parameters, indicating * that the annotated method deletes all instances of the primary entity type. In this case, the annotated method must * either be declared {@code void}, or return {@code int} or {@code long}. @@ -64,7 +64,7 @@ *

Annotations such as {@code @Find}, {@code @Query}, {@code @Insert}, {@code @Update}, {@code @Delete}, and * {@code @Save} are mutually-exclusive. A given method of a repository interface may have at most one {@code @Find} * annotation, lifecycle annotation, or query annotation. - *

*/ @Documented @Retention(RetentionPolicy.RUNTIME) diff --git a/api/src/main/java/jakarta/data/repository/Insert.java b/api/src/main/java/jakarta/data/repository/Insert.java index 7fef9eccd..2e01fabfa 100644 --- a/api/src/main/java/jakarta/data/repository/Insert.java +++ b/api/src/main/java/jakarta/data/repository/Insert.java @@ -69,7 +69,7 @@ *

Annotations such as {@code @Find}, {@code @Query}, {@code @Insert}, {@code @Update}, {@code @Delete}, and * {@code @Save} are mutually-exclusive. A given method of a repository interface may have at most one {@code @Find} * annotation, lifecycle annotation, or query annotation. - *

*/ @Documented @Retention(RetentionPolicy.RUNTIME) diff --git a/api/src/main/java/jakarta/data/repository/Save.java b/api/src/main/java/jakarta/data/repository/Save.java index d227665d8..f5216aebc 100644 --- a/api/src/main/java/jakarta/data/repository/Save.java +++ b/api/src/main/java/jakarta/data/repository/Save.java @@ -64,7 +64,7 @@ *

Annotations such as {@code @Find}, {@code @Query}, {@code @Insert}, {@code @Update}, {@code @Delete}, and * {@code @Save} are mutually-exclusive. A given method of a repository interface may have at most one {@code @Find} * annotation, lifecycle annotation, or query annotation. - *

* * @see Insert * @see Update diff --git a/api/src/main/java/jakarta/data/repository/Update.java b/api/src/main/java/jakarta/data/repository/Update.java index cf05d7f1a..ceb86bd22 100644 --- a/api/src/main/java/jakarta/data/repository/Update.java +++ b/api/src/main/java/jakarta/data/repository/Update.java @@ -30,7 +30,7 @@ *

The {@code Update} annotation indicates that the annotated repository method updates the state of one or more * entities already held in the database. *

- *

An {@code Update} method might accept an instance or instances of an entity class. In this case, the method must + *

An {@code Update} method accepts an instance or instances of an entity class. The method must * have exactly one parameter whose type is either: *

*