cristof commented on code in PR #142:
URL: https://github.com/apache/openjpa/pull/142#discussion_r3182926063
##########
openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java:
##########
@@ -694,7 +694,20 @@ public String toString() {
@Override
public X getSingleResultOrNull() {
- throw new UnsupportedOperationException("Not yet implemented (JPA
3.2)");
+ _em.assertNotCloseInvoked();
+ setHint(QueryHints.HINT_RESULT_COUNT, 1);
+ boolean queryFetchPlanUsed = pushQueryFetchPlan();
Review Comment:
You should add a max result of 2 here, so getResultList() avoids retrieving
more than two items form db.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]