OpenJPA
  1. OpenJPA
  2. OPENJPA-1205

Cannot retrieve Map<PersistenceCapable, PersistenceCapable> fields when DataCache is on

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 2.0.0-M3
    • Component/s: datacache
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      Consider the following mapping, which uses a Map of a PC class to another PC class:

      @OneToMany(targetEntity = CatalogProductPriceImpl.class, cascade =

      { CascadeType.ALL }

      )
      @MapKey(name = "catalog")
      public Map<Catalog, CatalogPrice> getCatalogPrices()

      { return catalogPrices; }

      With the DataCache on, when a product is retrieved for the first time, this map will be correct. However, the next time it is retrieved (i.e. from the cache), what is returned is a Map<LongId, CatalogPrice> not the expected Map<Catalog, CatalogPrice>.

      The attached patch resolves this issue.

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              Simon Droscher
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development