Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0, 2.3.0
    • Fix Version/s: 2.2.2, 2.3.0
    • Component/s: performance, query
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      I noticed right now the queryKey is used as the map key for metadataRepository._queries, but when it goes to look up, it always uses query name. The query metadata lookup would be faster if we switch to query name as the key.

      I double checked the JPA Spec and OPENJPA menu, it seems only support the named query creation using query name, which means the query name should be unique in one EntityManager. It doesn't matter in which entity the query is defined. So using name as the map look up key should be good enough.

      when there are two queries with the same name defined in the different entities, it will only keep the query metadata for the first loaded named query and ignore the rest plus log a warning message like this:
      WARN [main] openjpa.MetaData - Ignoring duplicate query "X" in "class org.apache.openjpa.A". A query with the same name been already declared in "class org.apache.openjpa.B".

      1. OPENJPA-2295.patch
        6 kB
        Helen Xu
      2. OPENJPA-2295a.patch
        0.6 kB
        Helen Xu

        Activity

        Hide
        Helen Xu added a comment -

        reopen the issue to restore the old method so that it is backward compatible.

        Show
        Helen Xu added a comment - reopen the issue to restore the old method so that it is backward compatible.
        Hide
        Helen Xu added a comment -

        the old method was added to 2.2.x and trunk

        Show
        Helen Xu added a comment - the old method was added to 2.2.x and trunk

          People

          • Assignee:
            Helen Xu
            Reporter:
            Helen Xu
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development