-
Notifications
You must be signed in to change notification settings - Fork 194
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
findBy in JpaRepository throws EmptyResultException instead of returning null #1323
Labels
closed: notabug
The issue is not a bug
Comments
You have to annotate the return type with Nullable |
OK, sorry, thanks! I migrated my code from Spring and could not figure out, why it was not working anymore. --Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 05.02.22, 20:32 schrieb Graeme Rocher ***@***.***>:
You have to annotate the return type with Nullable
—Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: ***@***.***>
|
@graemerocher Using |
Closing it as non-issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
I expect a CRUD method like findByEmail in an JpaRepository to return null, when no entry is found in the mysql database.
User findByEmail(String email);
Actual Behaviour
User user = userRepository.findByEmail("xxx@example.com");
results in an io.micronaut.data.exceptions.EmptyResultException
Checking for null
if(user==null)
is not reached.Steps To Reproduce
Executing a CRUD method in an JpaRepository with no expected results from the db table should reproduce it.
Environment Information
Example Application
https://github.com/weaser/jpa-test
Version
3.2.0
The text was updated successfully, but these errors were encountered: