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
pull/2/head
jensp 2018-02-07 14:07:08 +00:00
parent a764b348db
commit 47622a0986
1 changed files with 13 additions and 0 deletions

View File

@ -177,6 +177,19 @@ public abstract class AbstractEntityRepository<K, E> implements Serializable {
hints)); 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) @Transactional(Transactional.TxType.REQUIRED)
public Optional<E> findById(final K entityId, public Optional<E> findById(final K entityId,
final String... fetchJoins) { final String... fetchJoins) {