[JPA_SPEC-58] script generation : same table name, different schema are merged Created: 15/May/13  Updated: 15/May/13

Status: Open
Project: jpa-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: laps Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
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


Tags: create, ddl, eclipselink, generate, script, table

 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).


Generated at Sun Mar 01 01:30:12 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.