Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CrudRepository#findExpected(ID) [DATAJPA-301] #712

Closed
spring-projects-issues opened this issue Feb 25, 2013 · 2 comments
Closed

Add CrudRepository#findExpected(ID) [DATAJPA-301] #712

spring-projects-issues opened this issue Feb 25, 2013 · 2 comments
Assignees
Labels
in: core Issues in core support status: duplicate A duplicate of another issue type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

spring-projects-issues commented Feb 25, 2013

Fabrice Daugan opened DATAJPA-301 and commented

In order to simplify error handling, it would be nice to add an extension of vanilla find(ID) thats throw an exception instead of null.

/**
 * Retrieves an entity by its id as CrudRepository#find(ID) but throws an exception instead of {@literal null}.
 * 
 * @param id must not be {@literal null}.
 * @return the entity with the given id. Never {@literal null}.
 * @throws IllegalArgumentException if {@code id} is {@literal null}
 * @throws IllegalArgumentException if no entity with the given id is found.
 */
<ID> void findExpected(ID id);

Affects: 1.3 GA

Issue Links:

  • DATAJPA-118 Add option so that CrudRepository.findOne throws an unchecked exception if entity is not found
    ("duplicates")
@spring-projects-issues
Copy link
Author

spring-projects-issues commented Feb 26, 2013

Oliver Drotbohm commented

Although the proposed solution was a different one in the first place, the option of adding a new method to CrudRepository is discussed there as well.

Are you okay with following the linked ticket going forward? It already contains quite a bit of good discussion so I am inclined to close this one here as duplicate

@spring-projects-issues
Copy link
Author

spring-projects-issues commented May 22, 2019

Jens Schauder commented

Batch closing resolved issue without a fix version and a resolution indicating that there is nothing to release (Won't fix, Invalid ...)

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core support status: duplicate A duplicate of another issue labels Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants