OpenJPA
  1. OpenJPA
  2. OPENJPA-2110

Abstract entity causes standard openjpa collection proxies to be injected even if custom collections are used.

    Details

      Description

      When using an abstract entity, all collections defined in this super class are incorrectly filled in with standard OpenJPA collection implementations. I'd like to have my own collection implementation inside my entities.

      E.g.: private Set<Item> items = new MyHashSet<Item>();
      should be a specialized collection proxy, but when an abstract entity comes in only the standard OpenJPA collection proxy is used.

      I proved this statement by creating two Eclipse sample projects which you can find in the attachments of this ticket. This problem occures in both of the newest version of OpenJPA.
      To execute the JUnit test go to src/openjpa/test/FailingTest.java and hit run. You will see an error displayed in the console. To get this test case green only openjpa.model.AbstractCategory has to be "unabstract". Just remove "abstract" in its class definition.

      I hope my informations help you to fix this issue in a reasonable time.

      1. openjpa.2.1.1.proxybug.zip
        6.19 MB
        Johannes Leimer
      2. openjpa.1.2.2.proxybug.zip
        4.97 MB
        Johannes Leimer

        Activity

        Johannes Leimer created issue -
        Johannes Leimer made changes -
        Field Original Value New Value
        Description When using an abstract entity, all collections defined in this super class are incorrectly filled in with standard OpenJPA collection implementations. But I want to have my own collection implementation inside my entities.

        E.g.: private Set<Item> items = new MyHashSet<Item>();
        should be

        I proved this statement by creating two Eclipse sample projects which you can find in the attachments of this ticket. This problem occures in both of the newest version of OpenJPA.
        To execute the JUnit test go to src/openjpa/test/FailingTest.java and hit run. You will see an error displayed in the console. To get this test case green only openjpa.model.AbstractCategory has to be "unabstract". Just remove "abstract" in its class definition.

        I hope my informations help you to fix this issue in a reasonable time.
        When using an abstract entity, all collections defined in this super class are incorrectly filled in with standard OpenJPA collection implementations. But I want to have my own collection implementation inside my entities.

        E.g.: private Set<Item> items = new MyHashSet<Item>();
        should be a specialized collection proxy, but when an abstract entity comes in only the standard OpenJPA collection proxy is used.

        I proved this statement by creating two Eclipse sample projects which you can find in the attachments of this ticket. This problem occures in both of the newest version of OpenJPA.
        To execute the JUnit test go to src/openjpa/test/FailingTest.java and hit run. You will see an error displayed in the console. To get this test case green only openjpa.model.AbstractCategory has to be "unabstract". Just remove "abstract" in its class definition.

        I hope my informations help you to fix this issue in a reasonable time.
        Johannes Leimer made changes -
        Attachment openjpa.1.2.2.proxybug.zip [ 12510896 ]
        Attachment openjpa.2.1.1.proxybug.zip [ 12510897 ]
        Johannes Leimer made changes -
        Comment [ unfinished scentence completed. ]
        Johannes Leimer made changes -
        Comment [ The sample projects mentioned above. ]
        Johannes Leimer made changes -
        Description When using an abstract entity, all collections defined in this super class are incorrectly filled in with standard OpenJPA collection implementations. But I want to have my own collection implementation inside my entities.

        E.g.: private Set<Item> items = new MyHashSet<Item>();
        should be a specialized collection proxy, but when an abstract entity comes in only the standard OpenJPA collection proxy is used.

        I proved this statement by creating two Eclipse sample projects which you can find in the attachments of this ticket. This problem occures in both of the newest version of OpenJPA.
        To execute the JUnit test go to src/openjpa/test/FailingTest.java and hit run. You will see an error displayed in the console. To get this test case green only openjpa.model.AbstractCategory has to be "unabstract". Just remove "abstract" in its class definition.

        I hope my informations help you to fix this issue in a reasonable time.
        When using an abstract entity, all collections defined in this super class are incorrectly filled in with standard OpenJPA collection implementations. I'd like to have my own collection implementation inside my entities.

        E.g.: private Set<Item> items = new MyHashSet<Item>();
        should be a specialized collection proxy, but when an abstract entity comes in only the standard OpenJPA collection proxy is used.

        I proved this statement by creating two Eclipse sample projects which you can find in the attachments of this ticket. This problem occures in both of the newest version of OpenJPA.
        To execute the JUnit test go to src/openjpa/test/FailingTest.java and hit run. You will see an error displayed in the console. To get this test case green only openjpa.model.AbstractCategory has to be "unabstract". Just remove "abstract" in its class definition.

        I hope my informations help you to fix this issue in a reasonable time.
        Rick Curtis made changes -
        Assignee Rick Curtis [ curtisr7 ]
        Rick Curtis made changes -
        Fix Version/s 2.3.0 [ 12319463 ]
        Component/s kernel [ 12311302 ]
        Component/s Enhance [ 12313630 ]
        Rick Curtis made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Johannes Leimer made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Rick Curtis
            Reporter:
            Johannes Leimer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development