Uploaded image for project: 'JDO'
  1. JDO
  2. JDO-679

Clarify downcasts in queries

    XMLWordPrintableJSON

Details

    Description

      The specification needs clarification when it comes to downcasting within the query filter. Currently, the JDO 3.0 specification states (14.6.2):
      "Navigation through a null-valued field, which would throw NullPointerException, is treated as if the subexpression returned false. Similarly, a failed cast operation, which would throw ClassCastException, is treated as if the subexpression returned false. Other subexpressions or other values for variables might still qualify the candidate instance for inclusion in the result set."

      The clarification is that if a cast will never be successful (casting Employee as Integer, for example), then an exception should be thrown (JDOUserException with an inner ClassCastException?), otherwise, the cast behaves as the specification dictates.

      Attachments

        Activity

          People

            clr Craig L Russell
            matthewadams Matthew T. Adams
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: