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

A default Schema defined in a PU default (<persistence-unit-defaults>) in an orm.xml file is not being honored.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1.1, 2.2.3, 2.3.0, 2.4.0
    • Fix Version/s: 2.2.3, 2.4.0
    • Component/s: jpa
    • Labels:
      None

      Description

      Take the following entry in an orm.xml file:

      <persistence-unit-metadata>
      <persistence-unit-defaults>
      <schema>schemaInPUDefaults</schema>
      </persistence-unit-defaults>
      </persistence-unit-metadata>

      Lets say this is the ONLY schema defined in the entire app, then this schema should be used by default (the spec clearly defines how the defaults in <persistence-unit-defaults> should be used by a provider). However, this schema is not used by OpenJPA. I have a test to recreate this issue and I'm working to provide a fix.

      Thanks,

      Heath Thomann

        Activity

        Hide
        dazeydev Will Dazey added a comment -
        Show
        dazeydev Will Dazey added a comment - Opened https://issues.apache.org/jira/browse/OPENJPA-2704 to fix this issue
        Hide
        dazeydev Will Dazey added a comment -

        I believe this fix changed the behavior of the 'openjpa.jdbc.Schema' property. When both the orm.xml default schema and the 'openjpa.jdbc.Schema' property are set, OpenJPA now prefers the orm.xml default over the property. In the past (2.1.x) the persistence property was preferred over the orm.xml configuration, but that seems to have changed with this fix. I believe that it makes more sense to have the persistence property overrule the orm.xml mapping file, not the other way around. I also notice that Heath's tests he included in this fix do not test the 'openjpa.jdbc.Schema' property, so I am guessing this was an unforeseen side effect of the fix.

        Show
        dazeydev Will Dazey added a comment - I believe this fix changed the behavior of the 'openjpa.jdbc.Schema' property. When both the orm.xml default schema and the 'openjpa.jdbc.Schema' property are set, OpenJPA now prefers the orm.xml default over the property. In the past (2.1.x) the persistence property was preferred over the orm.xml configuration, but that seems to have changed with this fix. I believe that it makes more sense to have the persistence property overrule the orm.xml mapping file, not the other way around. I also notice that Heath's tests he included in this fix do not test the 'openjpa.jdbc.Schema' property, so I am guessing this was an unforeseen side effect of the fix.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1626916 from Heath Thomann in branch 'openjpa/trunk'
        [ https://svn.apache.org/r1626916 ]

        OPENJPA-2494: A default Schema defined in a PU default (<persistence-unit-defaults>) in an orm.xml file is not being honored.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1626916 from Heath Thomann in branch 'openjpa/trunk' [ https://svn.apache.org/r1626916 ] OPENJPA-2494 : A default Schema defined in a PU default (<persistence-unit-defaults>) in an orm.xml file is not being honored.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1626903 from Heath Thomann in branch 'openjpa/branches/2.2.x'
        [ https://svn.apache.org/r1626903 ]

        OPENJPA-2494: A default Schema defined in a PU default (<persistence-unit-defaults>) in an orm.xml file is not being honored.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1626903 from Heath Thomann in branch 'openjpa/branches/2.2.x' [ https://svn.apache.org/r1626903 ] OPENJPA-2494 : A default Schema defined in a PU default (<persistence-unit-defaults>) in an orm.xml file is not being honored.

          People

          • Assignee:
            jpaheath Heath Thomann
            Reporter:
            jpaheath Heath Thomann
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development