From b9518f962b6557bd5256d5d75705b7c73cc85fed Mon Sep 17 00:00:00 2001 From: jensp Date: Wed, 7 Feb 2018 14:07:08 +0000 Subject: [PATCH] CCM NG: JavaDoc for findById method from last commit. git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5255 8810af33-2d31-482b-a856-94f89814c4df Former-commit-id: 737f176b2364cc0291007900c5abbedbd585ef65 --- .../org/libreccm/core/AbstractEntityRepository.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ccm-core/src/main/java/org/libreccm/core/AbstractEntityRepository.java b/ccm-core/src/main/java/org/libreccm/core/AbstractEntityRepository.java index 2264390f9..8b5291d45 100644 --- a/ccm-core/src/main/java/org/libreccm/core/AbstractEntityRepository.java +++ b/ccm-core/src/main/java/org/libreccm/core/AbstractEntityRepository.java @@ -177,6 +177,19 @@ public abstract class AbstractEntityRepository implements Serializable { hints)); } + /** + * Finds an entity by its ID and does fetch joins for the provided + * attributes. Be careful with this method. Do not a too many attributes to + * the fetch joins, only does which you really need. Otherwise there can be + * a serious performance impact. + * + * @param entityId The ID of the entity to retrieve. + * @param fetchJoins The names of the attributes to join using fetch joins. + * + * @return An {@link Optional} containing the entity identified by the + * provided {@code entityId} or an empty {@link Optional} if there + * is no such entity. + */ @Transactional(Transactional.TxType.REQUIRED) public Optional findById(final K entityId, final String... fetchJoins) {