You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what I understand about the JPA, getSingleResult is meant to throw an NoSuchElementException if there is no single result. Instead it returns an empty list. Additionally it should throw NonUniqueResultException if more than one element is found. It throws neither.
@Override
public Object getSingleResult()
{
// to fetch a single result form database.
isSingleResult = true;
List results = getResultList();
isSingleResult = false;
return results.isEmpty() ? results : results.get(0);
}
The text was updated successfully, but these errors were encountered:
From what I understand about the JPA, getSingleResult is meant to throw an NoSuchElementException if there is no single result. Instead it returns an empty list. Additionally it should throw NonUniqueResultException if more than one element is found. It throws neither.
The text was updated successfully, but these errors were encountered: