← Winnitude! Search  ·  Reader Mode (1522 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 12 LINKS

Change getSingleResult by Hk-tang · Pull Request #460 · javaee-samples/javaee7-samples

Repository navigation

Change getSingleResult - #460


Open
Hk-tang wants to merge 1 commit into javaee-samples:master from Hk-tang:fix-potential-exception
Open

Change getSingleResult #460 Hk-tang wants to merge 1 commit into javaee-samples:master from Hk-tang:fix-potential-exception

Conversation

Hk-tang commented Mar 23, 2020 · edited Loading



Copy link Copy Markdown

query.getSingleResult() causes an exception could be thrown if there is not exactly one row returned.

Although this commit does not implement logic on how to decide which result in the result list should be taken, this removes the potential exception/need for a try/catch. Implementation on how to decide which result to take should be made per context.

getSingleResult causes exceptions if anything other than one result r... d14a55b
...eturned
Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment

Labels

None yet

1 participant