Skip to content

Commit 7ba3d1d

Browse files
committed
DATAJPA-1321 - Fixed javadoc of JpaRepository.getOne(…).
1 parent ca4cf66 commit 7ba3d1d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/org/springframework/data/jpa/repository/JpaRepository.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,14 @@ public interface JpaRepository<T, ID> extends PagingAndSortingRepository<T, ID>,
9090
void deleteAllInBatch();
9191

9292
/**
93-
* Returns a reference to the entity with the given identifier.
93+
* Returns a reference to the entity with the given identifier. Depending on how the JPA persistence provider is
94+
* implemented this is very likely to always return an instance and throw an
95+
* {@link javax.persistence.EntityNotFoundException} on first access. Some of them will reject invalid identifiers
96+
* immediately.
9497
*
9598
* @param id must not be {@literal null}.
9699
* @return a reference to the entity with the given identifier.
97-
* @see EntityManager#getReference(Class, Object)
98-
* @throws javax.persistence.EntityNotFoundException if no entity exists for given {@code id}.
100+
* @see EntityManager#getReference(Class, Object) for details on when an exception is thrown.
99101
*/
100102
T getOne(ID id);
101103

0 commit comments

Comments
 (0)