2020import org .springframework .dao .OptimisticLockingFailureException ;
2121
2222/**
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+ *
2828 * @author Oliver Gierke
2929 * @author Eberhard Wolff
3030 * @author Jens Schauder
@@ -109,13 +109,12 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
109109 * Deletes the entity with the given id.
110110 * <p>
111111 * 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+ *
117113 * @param id must not be {@literal null}.
118114 * @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.
119118 */
120119 void deleteById (ID id );
121120
@@ -137,6 +136,9 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
137136 *
138137 * @param ids must not be {@literal null}. Must not contain {@literal null} elements.
139138 * @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.
140142 * @since 2.5
141143 */
142144 void deleteAllById (Iterable <? extends ID > ids );
@@ -156,4 +158,5 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
156158 * Deletes all entities managed by the repository.
157159 */
158160 void deleteAll ();
161+
159162}
0 commit comments