Add method javax.persistence.Query.getSingleResult(Object defaultValue)

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P4
    • None
    • Affects Version/s: 7
    • Component/s: other-libs
    • x86
    • windows_7

      A DESCRIPTION OF THE REQUEST :
      getSingleResult() throws a NoResultException when no rows are found.

      Please add a
      1. javax.persistence.Query.getSingleResult(Object defaultValue)
      2. javax.persistence.TypedQuery.getSingleResult(X defaultValue)

      JUSTIFICATION :
      The NoResultException when no rows found is a behavior accepted by many but also irritating to many others who would expect a null return value.

      I think adding these method will be a win-win situation and will also add additional functionality of returning a not null default value in case of no rows found.

            Assignee:
            Joe Darcy
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: