20
20
import org .springframework .dao .OptimisticLockingFailureException ;
21
21
22
22
/**
23
- * Interface for generic CRUD operations on a repository for a specific type. In general operations offered via this
24
- * interface participate in life cycle events, and optimistic locking. Therefore, modules may choose to load an entity
25
- * before deleting or updating it in order to facilitate this, and any modifying method call may trigger an exception
26
- * due to failure of optimistic locking.
27
- *
23
+ * Interface for generic CRUD operations on a repository for a specific type. Methods exposed through this interface
24
+ * allow entities to participate in lifecycle events, and optimistic locking if applicable except for some bulk
25
+ * operation methods. Therefore, modules may choose to load an entity before deleting or updating it in order to
26
+ * facilitate events, and any modifying method call may trigger an exception due to failure of optimistic locking.
27
+ *
28
28
* @author Oliver Gierke
29
29
* @author Eberhard Wolff
30
30
* @author Jens Schauder
@@ -109,13 +109,12 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
109
109
* Deletes the entity with the given id.
110
110
* <p>
111
111
* If the entity is not found in the persistence store it is silently ignored.
112
- * <p>
113
- * Note that, since this method triggers life cycle events, it might need to load an entity before deleting it. This
114
- * also might trigger {@link OptimisticLockingFailureException} if between loading and actually deleting the entity,
115
- * the entity was changed by some other process.
116
- *
112
+ *
117
113
* @param id must not be {@literal null}.
118
114
* @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
115
+ * @throws OptimisticLockingFailureException when the entity uses optimistic locking and has a version attribute with
116
+ * a different value from that found in the persistence store. Also thrown if the entity is assumed to be
117
+ * present but does not exist in the database.
119
118
*/
120
119
void deleteById (ID id );
121
120
@@ -137,6 +136,9 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
137
136
*
138
137
* @param ids must not be {@literal null}. Must not contain {@literal null} elements.
139
138
* @throws IllegalArgumentException in case the given {@literal ids} or one of its elements is {@literal null}.
139
+ * @throws OptimisticLockingFailureException when the entity uses optimistic locking and has a version attribute with
140
+ * a different value from that found in the persistence store. Also thrown if the entity is assumed to be
141
+ * present but does not exist in the database.
140
142
* @since 2.5
141
143
*/
142
144
void deleteAllById (Iterable <? extends ID > ids );
@@ -156,4 +158,5 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
156
158
* Deletes all entities managed by the repository.
157
159
*/
158
160
void deleteAll ();
161
+
159
162
}
0 commit comments