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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.1
    • 2.0.0-M3
    • datacache
    • None
    • 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.

      Attachments

        1. EntityToEntityMapFix.patch
          0.8 kB
          Simon Droscher

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sdroscher Simon Droscher
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: