From 3a38161953d71cc406a12119307f7d3c7c24ef9c Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Mon, 24 Oct 2011 14:47:08 -0500 Subject: [PATCH] DATACMNS-91 - Clarify JavaDoc of CrudRepository. Explicitly define the expected behavior for null parameters in CRUD methods to throw an IllegalArgumentException. --- .../data/repository/CrudRepository.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/spring-data-commons-core/src/main/java/org/springframework/data/repository/CrudRepository.java b/spring-data-commons-core/src/main/java/org/springframework/data/repository/CrudRepository.java index 146e0c242..675f877c0 100644 --- a/spring-data-commons-core/src/main/java/org/springframework/data/repository/CrudRepository.java +++ b/spring-data-commons-core/src/main/java/org/springframework/data/repository/CrudRepository.java @@ -44,20 +44,20 @@ public interface CrudRepository extends Repository save(Iterable entities); /** - * Retrives an entity by its primary key. + * Retrives an entity by its id. * - * @param id - * @return the entity with the given primary key or {@code null} if none found - * @throws IllegalArgumentException if primaryKey is {@code null} + * @param id must not be {@literal null}. + * @return the entity with the given id or {@literal null} if none found + * @throws IllegalArgumentException if {@code id} is {@literal null} */ T findOne(ID id); /** * Returns whether an entity with the given id exists. * - * @param id + * @param id must not be {@literal null}. * @return true if an entity with the given id exists, alse otherwise - * @throws IllegalArgumentException if primaryKey is {@code null} + * @throws IllegalArgumentException if {@code id} is {@literal null} */ boolean exists(ID id); @@ -78,7 +78,8 @@ public interface CrudRepository extends Repository