Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1889

Relax query binding parameter type-checking for enum types

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.1.0
    • query
    • None

    Description

      Current user-supplied query parameter values are checked strongly against the type they bind to.
      For example, a query
      Query q = "select p from Person p where p.gender=:g";
      q.setParameter("g", "MALE");
      will fail if Person.gender is of enum Gender

      {MALE,FEMALE}

      The correct usage is q.setParameter("g", Gender.MALE);

      We are relaxing this from the standpoint of a language-neutral client that does not have access to Gender enum type.

      Attachments

        Issue Links

          Activity

            People

              ppoddar@apache.org Pinaki Poddar
              ppoddar@apache.org Pinaki Poddar
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: