OpenJPA
  1. OpenJPA
  2. OPENJPA-1889

Relax query binding parameter type-checking for enum types

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.0
    • Component/s: query
    • Labels:
      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.

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Pinaki Poddar
              Reporter:
              Pinaki Poddar
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development