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

Schema name is ignored by MappingTool when the @Table() annotation contains only a schema parameter, but no name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0.0
    • None
    • tooling
    • None
    • Mac OSX

      java version "1.6.0_17"
      Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-10M3025)
      Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)

    Description

      When running the mapping tool (though IJ's Maven integration and the OpenJPA Maven plugin, goal openjpa:sql), the tool seems to get confused by two things:

      1. If there is a single persistence unit in persistence.xml, it will ignore the schema name if there is only a schema parameter in the annotation:
      @Table(schema = "foo")
      @Entity
      public class Bar {
      }

      Will generate the SQL that is not correctly scoped for schema foo. If there is both a schema name and a table name:
      @Table(schema = "foo", name = "baz")
      @Entity
      public class Bar {
      }

      The generated sql will be correct (i.e. foo.baz)

      2. If persistence.xml contains two PUs (let's say foo and bar in that order), all generated tables appear to be scoped to bar and none to foo despite annotations to the contrary.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bigmountainben Benjamin Renaud
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: