From 7ba3d1d3a9b3de3ef49a8f172656a5983c07d985 Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Tue, 29 Jan 2019 17:00:45 +0100 Subject: [PATCH] =?UTF-8?q?DATAJPA-1321=20-=20Fixed=20javadoc=20of=20JpaRe?= =?UTF-8?q?pository.getOne(=E2=80=A6).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/jpa/repository/JpaRepository.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/springframework/data/jpa/repository/JpaRepository.java b/src/main/java/org/springframework/data/jpa/repository/JpaRepository.java index 9c604acca..517dff3e4 100644 --- a/src/main/java/org/springframework/data/jpa/repository/JpaRepository.java +++ b/src/main/java/org/springframework/data/jpa/repository/JpaRepository.java @@ -90,12 +90,14 @@ public interface JpaRepository extends PagingAndSortingRepository, void deleteAllInBatch(); /** - * Returns a reference to the entity with the given identifier. + * Returns a reference to the entity with the given identifier. Depending on how the JPA persistence provider is + * implemented this is very likely to always return an instance and throw an + * {@link javax.persistence.EntityNotFoundException} on first access. Some of them will reject invalid identifiers + * immediately. * * @param id must not be {@literal null}. * @return a reference to the entity with the given identifier. - * @see EntityManager#getReference(Class, Object) - * @throws javax.persistence.EntityNotFoundException if no entity exists for given {@code id}. + * @see EntityManager#getReference(Class, Object) for details on when an exception is thrown. */ T getOne(ID id);