jpa-spec
  1. jpa-spec
  2. JPA_SPEC-58

script generation : same table name, different schema are merged

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:

      Windows : XP SP3
      Glassfish : Oracle GlassFish Server 3.1.2.2 (build 5)
      Eclipse : Indigo Build id: 20110615-0604
      JRE : jdk1.6.0_33

      Description

      Write two entities with the same table name but different schema :

      @Entity
      @Table(name="tablename", schema="schema1")
      public class MyEntitySchema1 {
      }

      @Entity
      @Table(name="tablename", schema="schema2")
      public class MyEntitySchema2 {
      }

      Configure persistence.xml like this :
      ...
      <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
      <exclude-unlisted-classes>false</exclude-unlisted-classes>
      <properties>
      <property name="eclipselink.ddl-generation" value="create-tables"/>
      <property name="eclipselink.ddl-generation.output-mode" value="sql-script"/>
      <property name="eclipselink.create-ddl-jdbc-file-name" value="create.sql"/>
      <property name="eclipselink.drop-ddl-jdbc-file-name" value="drop.sql"/>
      ...
      </properties>
      ...

      And then check the generated script create.sql :
      CREATE TABLE schema2.tablename (...)
      ALTER TABLE schema2.tablename ADD CONSTRAINT ...

      Nothing about schema1.tablename in the script file.

      If I change one thing (ex. update a letter of tablename from lowercase to uppercase, I get both tables generated. (Those tables already exist, so this is not a solution for me).

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            laps
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: