Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.0
    • Component/s: None
    • Labels:
      None
    • Patch Info:
      Patch Available

      Activity

      Hide
      Tim McConnell added a comment -

      This patch demonstrates different behavior for the RelationFieldStrategy between 1.2.x and 2.0, which in fact may not be a true problem for users as the strategy implementation class is internal to OpenJPA. However wish to log all issues found for sake of completeness.

      Show
      Tim McConnell added a comment - This patch demonstrates different behavior for the RelationFieldStrategy between 1.2.x and 2.0, which in fact may not be a true problem for users as the strategy implementation class is internal to OpenJPA. However wish to log all issues found for sake of completeness.
      Hide
      Donald Woods added a comment -

      Testcase committed to 1.3.x as r814737 to show old behavior.
      Testcase and doc updates committed to trunk as r814739.

      Show
      Donald Woods added a comment - Testcase committed to 1.3.x as r814737 to show old behavior. Testcase and doc updates committed to trunk as r814739.
      Hide
      Pinaki Poddar added a comment -

      This needs to be further investigated to analyze why the strategy changed.
      Merely documenting that behavior has changed is not only insufficient, it may even be root of certain errors that will surface out downstream. Such errors can be hard to relate with this root cause..

      That is what the document says:
      "The FieldMapping.getStrategy() in OpenJPA 1.x returned an instance of RelationFieldStrategy for embded super classes, but will now return an EmbedFieldStrategy. "

      Here is the test that records this unexplained change in behavior.

      the definition of the field 'sup' in EmbeddableSuperSub

      public class EmbeddableSuperSub extends EmbeddableSuper

      { @ManyToOne private EmbeddableSuper sup; }

      where EmbeddableSuper is a MappedSuperclass.

      Firstly the names of the test classes are misleading because MappedSuperClass has nothing to do with being embeddable.
      Secondly there is no apparent explanation on why suddenly a many-to-one relation to a MappedSuperClass that used to be RelationFieldStrategy will now handled by a EmbedFieldStrategy

      My hypothesis is this issue is related to some other decisions we were making around embeddablity of a type.
      I am reopening to investigate further.

      Show
      Pinaki Poddar added a comment - This needs to be further investigated to analyze why the strategy changed. Merely documenting that behavior has changed is not only insufficient, it may even be root of certain errors that will surface out downstream. Such errors can be hard to relate with this root cause.. That is what the document says: "The FieldMapping.getStrategy() in OpenJPA 1.x returned an instance of RelationFieldStrategy for embded super classes, but will now return an EmbedFieldStrategy. " Here is the test that records this unexplained change in behavior. the definition of the field 'sup' in EmbeddableSuperSub public class EmbeddableSuperSub extends EmbeddableSuper { @ManyToOne private EmbeddableSuper sup; } where EmbeddableSuper is a MappedSuperclass. Firstly the names of the test classes are misleading because MappedSuperClass has nothing to do with being embeddable. Secondly there is no apparent explanation on why suddenly a many-to-one relation to a MappedSuperClass that used to be RelationFieldStrategy will now handled by a EmbedFieldStrategy My hypothesis is this issue is related to some other decisions we were making around embeddablity of a type. I am reopening to investigate further.
      Hide
      Pinaki Poddar added a comment -

      The test case org.apache.openjpa.persistence.compat.TestEmbeddableSuperclass is actually an anti-test.
      It validates or masks the root cause of an otherwise serious error.

      Show
      Pinaki Poddar added a comment - The test case org.apache.openjpa.persistence.compat.TestEmbeddableSuperclass is actually an anti-test. It validates or masks the root cause of an otherwise serious error.

        People

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

          Dates

          • Created:
            Updated:
            Resolved:

            Development