From 245bb82d34f2ca92f96aa77c0784008745d13852 Mon Sep 17 00:00:00 2001 From: Jeremy Bauer Date: Tue, 19 Jan 2010 21:00:25 +0000 Subject: [PATCH] OPENJPA-1115 Fixed many naming collisions in delimited id tests. Corrected bug in schema group that broke fully qualified sequence names. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@900955 13f79535-47bb-0310-9956-ffa450edef68 --- .../openjpa/jdbc/schema/SchemaGroup.java | 2 +- .../delimited/identifiers/Car2.java | 1 - .../delimited/identifiers/EntityA.java | 2 +- .../delimited/identifiers/EntityC.java | 4 +- .../delimited/identifiers/EntityF.java | 28 +++++------ .../delimited/identifiers/EntityH.java | 2 +- .../TestDelimIdResultSetAnnotations.java | 3 +- .../TestDelimitedJoinAnnotation.java | 1 - ...TestManualDelimIdResultSetAnnotations.java | 4 +- .../TestManualDelimInheritance.java | 2 - .../identifiers/noschema/EntityC.java | 26 +++++----- .../identifiers/noschema/EntityD.java | 2 +- .../identifiers/noschema/EntityD2.java | 4 +- .../identifiers/noschema/EntityD3.java | 4 +- .../identifiers/noschema/EntityD4.java | 4 +- .../identifiers/noschema/EntityE.java | 4 +- .../identifiers/noschema/EntityF.java | 48 +++++++++---------- .../identifiers/noschema/EntityG.java | 2 +- .../noschema/TestNoSchemaManualDelimId.java | 14 ++---- .../TestNoSchemaManualDelimIdSeqGen.java | 12 +---- ...oSchemaManualDelimitedJoinAnnotations.java | 10 +--- .../delimited/identifiers/xml/EntityH.java | 14 +++--- .../delimited/identifiers/xml/EntityI.java | 8 ++-- .../delimited/identifiers/xml/EntityI2.java | 6 +-- .../xml/TestXmlDelimitedJoinAnnotation.java | 4 +- .../delimited-identifiers-joins-orm.xml | 48 +++++++++---------- .../delimited-identifiers-seq-gen-xml-orm.xml | 2 +- 27 files changed, 119 insertions(+), 142 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGroup.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGroup.java index 195e2ea26..e0f5b634f 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGroup.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGroup.java @@ -306,7 +306,7 @@ public class SchemaGroup * given sequence that may have come from another schema group. */ public Sequence findSequence(Sequence seq) { - return findSequence(QualifiedDBIdentifier.getPath(seq.getIdentifier())); + return findSequence(seq.getQualifiedPath()); } /** diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/Car2.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/Car2.java index c6bf8dbd1..0cb87cce3 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/Car2.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/Car2.java @@ -18,7 +18,6 @@ */ package org.apache.openjpa.persistence.delimited.identifiers; -import javax.persistence.Column; import javax.persistence.ColumnResult; import javax.persistence.DiscriminatorColumn; import javax.persistence.Entity; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityA.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityA.java index 8560c2c7a..abcccd1f4 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityA.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityA.java @@ -71,7 +71,7 @@ public class EntityA { private Map collectionMap = new HashMap(); @ElementCollection - @MapKeyColumn(name="map key", columnDefinition="varchar(20)", table="map key table") + @MapKeyColumn(name="map key", columnDefinition="varchar(20)", table="m ktbl") private Map delimCollectionMap = new HashMap(); diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityC.java index 9fb6bca33..a18fc23e4 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityC.java @@ -58,12 +58,12 @@ public class EntityC { private EntityD2 entityD2; @ManyToMany - @JoinTable(name="\"map join table\"", schema="\"delim id\"") + @JoinTable(name="\"m jtbl\"", schema="\"delim id\"") @MapKeyJoinColumn(name="map_ed3", referencedColumnName="\"entityD3 id\"") Map map = new HashMap(); @ManyToMany - @JoinTable(name="\"map2 join table\"", schema="\"delim id\"") + @JoinTable(name="\"m2 jtbl\"", schema="\"delim id\"") @MapKeyJoinColumn(name="\"map ed4\"", referencedColumnName="\"entityD4 id\"") Map map2 = new HashMap(); diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityF.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityF.java index a2ad9b0b6..19715ceb7 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityF.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityF.java @@ -63,7 +63,7 @@ public class EntityF { @ElementCollection // CollectionTable with default name generation @CollectionTable - private Set collectionSet = new HashSet(); + private Set cSet = new HashSet(); @ElementCollection @CollectionTable(name="\"collectionDelimSet\"", schema="\"delim id\"") @@ -71,15 +71,15 @@ public class EntityF { @ElementCollection // MapKeyColumn with default name generation - @MapKeyColumn - private Map collectionMap = new HashMap(); + @MapKeyColumn + private Map cMap = new HashMap(); @ElementCollection // Note: Delimited column definition is not supported on some DBs, so // it is not delimited here // TODO: create a separate entity and conditionally run the test on a supported DB - @MapKeyColumn(name="\"mapKey\"", columnDefinition="varchar(20)", table="\"delim collection map\"") - private Map delimCollectionMap = + @MapKeyColumn(name="\"mapKey\"", columnDefinition="varchar(20)", table="\"d colmap\"") + private Map dcMap = new HashMap(); public EntityF(String name) { @@ -143,18 +143,18 @@ public class EntityF { * @return the collectionSet */ public Set getCollectionSet() { - return collectionSet; + return cSet; } /** * @param collectionSet the collectionSet to set */ public void setCollectionSet(Set collectionSet) { - this.collectionSet = collectionSet; + this.cSet = collectionSet; } public void addCollectionSet(String item) { - collectionSet.add(item); + cSet.add(item); } /** @@ -179,35 +179,35 @@ public class EntityF { * @return the collectionMap */ public Map getCollectionMap() { - return collectionMap; + return cMap; } /** * @param collectionMap the collectionMap to set */ public void setCollectionMap(Map collectionMap) { - this.collectionMap = collectionMap; + this.cMap = collectionMap; } public void addCollectionMap(String key, String value) { - collectionMap.put(key, value); + cMap.put(key, value); } /** * @return the delimCollectionMap */ public Map getDelimCollectionMap() { - return delimCollectionMap; + return dcMap; } /** * @param delimCollectionMap the delimCollectionMap to set */ public void setDelimCollectionMap(Map delimCollectionMap) { - this.delimCollectionMap = delimCollectionMap; + this.dcMap = delimCollectionMap; } public void addDelimCollectionMap(String key, String value) { - delimCollectionMap.put(key, value); + dcMap.put(key, value); } } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityH.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityH.java index 12248f126..9ba07edf0 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityH.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/EntityH.java @@ -65,7 +65,7 @@ public class EntityH { @ManyToMany @JoinTable(name="map4 join table", schema="delim id2") @MapKeyJoinColumn(name="map ei4", - referencedColumnName="entityI4 id", table="map key join column") + referencedColumnName="entityI4 id", table="mk j col") Map map2 = new HashMap(); public EntityH() {} diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestDelimIdResultSetAnnotations.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestDelimIdResultSetAnnotations.java index f9df31f93..4247f15db 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestDelimIdResultSetAnnotations.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestDelimIdResultSetAnnotations.java @@ -52,7 +52,8 @@ public class TestDelimIdResultSetAnnotations org.apache.openjpa.persistence.delimited.identifiers.Chevrolet.class, org.apache.openjpa.persistence.delimited.identifiers.Car2.class, org.apache.openjpa.persistence.delimited.identifiers.Pontiac2.class, - org.apache.openjpa.persistence.delimited.identifiers.Chevrolet2.class); + org.apache.openjpa.persistence.delimited.identifiers.Chevrolet2.class, + DROP_TABLES); assertNotNull(emf); em = emf.createEntityManager(); diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestDelimitedJoinAnnotation.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestDelimitedJoinAnnotation.java index d77430c01..ab5b9f425 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestDelimitedJoinAnnotation.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestDelimitedJoinAnnotation.java @@ -22,7 +22,6 @@ import java.util.List; import javax.persistence.Query; -import org.apache.openjpa.jdbc.conf.JDBCConfiguration; import org.apache.openjpa.persistence.OpenJPAEntityManager; import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI; import org.apache.openjpa.persistence.test.SQLListenerTestCase; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestManualDelimIdResultSetAnnotations.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestManualDelimIdResultSetAnnotations.java index dc02ed9ea..aeb14d6a5 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestManualDelimIdResultSetAnnotations.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestManualDelimIdResultSetAnnotations.java @@ -53,8 +53,8 @@ public class TestManualDelimIdResultSetAnnotations org.apache.openjpa.persistence.delimited.identifiers.Cat.class, org.apache.openjpa.persistence.delimited.identifiers.Animal2.class, org.apache.openjpa.persistence.delimited.identifiers.Dog2.class, - org.apache.openjpa.persistence.delimited.identifiers.Cat2.class - ); + org.apache.openjpa.persistence.delimited.identifiers.Cat2.class, + DROP_TABLES); assertNotNull(emf); em = emf.createEntityManager(); diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestManualDelimInheritance.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestManualDelimInheritance.java index 91466ba43..4265209ed 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestManualDelimInheritance.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/TestManualDelimInheritance.java @@ -4,9 +4,7 @@ import java.util.List; import javax.persistence.Query; -import org.apache.openjpa.jdbc.conf.JDBCConfiguration; import org.apache.openjpa.jdbc.sql.DB2Dictionary; -import org.apache.openjpa.jdbc.sql.DBDictionary; import org.apache.openjpa.jdbc.sql.DerbyDictionary; import org.apache.openjpa.persistence.OpenJPAEntityManager; /* diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityC.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityC.java index ffb68015a..9439ad2b0 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityC.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityC.java @@ -36,36 +36,36 @@ import javax.persistence.SecondaryTable; import javax.persistence.Table; @Entity -@Table(name="\"entity c\"") -@SecondaryTable(name="\"sec join table\"", - pkJoinColumns=@PrimaryKeyJoinColumn(name="\"entity c\"", - referencedColumnName="\"c id\"")) +@Table(name="\"nsentity c\"") +@SecondaryTable(name="\"nssec join table\"", + pkJoinColumns=@PrimaryKeyJoinColumn(name="\"nsentity c\"", + referencedColumnName="\"nsc id\"")) public class EntityC { @Id - @Column(name="\"c id\"") + @Column(name="\"nsc id\"") private int id; private String name; - @Column(table="\"sec join table\"") + @Column(table="\"nssec join table\"") private String secName; @ManyToMany - @JoinTable(name="\"c d\"") + @JoinTable(name="\"nsc d\"") private Collection entityDs = new HashSet(); @OneToOne - @JoinColumn(name="\"entd2 id\"", referencedColumnName="\"entityD2 id\"") + @JoinColumn(name="\"nsentd2 id\"", referencedColumnName="\"nsentityD2 id\"") private EntityD2 entityD2; @ManyToMany - @JoinTable(name="\"map join table\"") - @MapKeyJoinColumn(name="map_ed3", referencedColumnName="\"entityD3 id\"") + @JoinTable(name="\"nsm ndjtab\"") + @MapKeyJoinColumn(name="nsmap_ed3", referencedColumnName="\"nsentityD3 id\"") Map map = new HashMap(); @ManyToMany - @JoinTable(name="\"map2 join table\"") - @MapKeyJoinColumn(name="\"map ed4\"", - referencedColumnName="\"entityD4 id\"") + @JoinTable(name="\"nsm2 ndjtbl\"") + @MapKeyJoinColumn(name="\"nsmap ed4\"", + referencedColumnName="\"nsentityD4 id\"") Map map2 = new HashMap(); public EntityC() {} diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD.java index cba91fe17..6d663ef68 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD.java @@ -27,7 +27,7 @@ import javax.persistence.ManyToMany; import javax.persistence.Table; @Entity -@Table(name="\"entity d\"") +@Table(name="\"nsentity d\"") public class EntityD { @Id private int id; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD2.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD2.java index 4e1485f55..ca57cbfd7 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD2.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD2.java @@ -26,10 +26,10 @@ import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.Table; @Entity -@Table(name="\"entity d2\"") +@Table(name="\"nsentity d2\"") public class EntityD2 { @Id - @Column(name="\"entityD2 id\"") + @Column(name="\"nsentityD2 id\"") private int id; private String name; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD3.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD3.java index 62e58c8af..8b60c785b 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD3.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD3.java @@ -24,10 +24,10 @@ import javax.persistence.Id; import javax.persistence.Table; @Entity -@Table(name="\"entity d3\"") +@Table(name="\"nsentity d3\"") public class EntityD3 { @Id - @Column(name="\"entityD3 id\"") + @Column(name="\"nsentityD3 id\"") int id; String name; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD4.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD4.java index f9d8564a0..50aad7c8a 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD4.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityD4.java @@ -24,10 +24,10 @@ import javax.persistence.Id; import javax.persistence.Table; @Entity -@Table(name="\"entity d4\"") +@Table(name="\"nsentity d4\"") public class EntityD4 { @Id - @Column(name="\"entityD4 id\"") + @Column(name="\"nsentityD4 id\"") int id; String name; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityE.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityE.java index 440be9f8d..898abf3d7 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityE.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityE.java @@ -27,7 +27,7 @@ import javax.persistence.SequenceGenerator; import javax.persistence.Table; @Entity -@Table(name="\"primary entityE\"") +@Table(name="\"nsprimary entityE\"") public class EntityE { @Id @SequenceGenerator(name="entityE_seq_gen_name", @@ -35,7 +35,7 @@ public class EntityE { @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="entityE_seq_gen_name") private int id; - @Column(name="e_name") + @Column(name="nse_name") private String name; public EntityE(String name) { diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityF.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityF.java index 5022f39c6..d3e81ad7c 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityF.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityF.java @@ -37,47 +37,47 @@ import javax.persistence.TableGenerator; import javax.persistence.UniqueConstraint; @Entity -@Table(name="\"primary entityF\"", +@Table(name="\"nsprimary entityF\"", uniqueConstraints= - @UniqueConstraint(columnNames={"\"f name\"", "f_nonDelimName"})) -@SecondaryTable(name="\"secondary entityF\"", + @UniqueConstraint(columnNames={"\"nsf name\"", "nsf_nonDelimName"})) +@SecondaryTable(name="\"nssecondary entityF\"", uniqueConstraints= - @UniqueConstraint(name="\"sec_unq\"", - columnNames={"\"secondary name\""})) + @UniqueConstraint(name="\"nssec_unq\"", + columnNames={"\"nssecondary name\""})) public class EntityF { - @TableGenerator(name = "f_id_gen", table = "\"f_id_gen\"", - pkColumnName = "\"gen_pk\"", valueColumnName = "\"gen_value\"") + @TableGenerator(name = "f_id_gen", table = "\"nsf_id_gen\"", + pkColumnName = "\"nsgen_pk\"", valueColumnName = "\"nsgen_value\"") @GeneratedValue(strategy = GenerationType.TABLE, generator = "f_id_gen") @Id private int id; // Note: Delimited columnDefinition is not supported on some DBs // TODO: copy into a separate entity and conditionally run a different test - @Column(name="\"f name\"", columnDefinition="varchar(15)") + @Column(name="\"nsf name\"", columnDefinition="varchar(15)") private String name; - @Column(name="f_nonDelimName") + @Column(name="nsf_nonDelimName") private String nonDelimName; - @Column(name="\"secondary name\"", table="\"secondary entityF\"") + @Column(name="\"nssecondary name\"", table="\"nssecondary entityF\"") private String secName; @ElementCollection // CollectionTable with default name generation @CollectionTable - private Set collectionSet = new HashSet(); + private Set nscs = new HashSet(); @ElementCollection - @CollectionTable(name="\"collectionDelimSet\"") - private Set collectionDelimSet = new HashSet(); + @CollectionTable(name="\"nscDelSet\"") + private Set nscds = new HashSet(); @ElementCollection // MapKeyColumn with default name generation @MapKeyColumn - private Map collectionMap = new HashMap(); + private Map nscollMap = new HashMap(); @ElementCollection // Note: Delimited column definition is not supported on some DBs, so // it is not delimited here // TODO: create a separate entity and conditionally run the test on a supported DB - @MapKeyColumn(name="\"mapKey\"", columnDefinition="varchar(20)", table="\"delim collection map\"") + @MapKeyColumn(name="\"nsmap Key\"", columnDefinition="varchar(20)", table="\"nsd c map\"") private Map delimCollectionMap = new HashMap(); @@ -142,54 +142,54 @@ public class EntityF { * @return the collectionSet */ public Set getCollectionSet() { - return collectionSet; + return nscs; } /** * @param collectionSet the collectionSet to set */ public void setCollectionSet(Set collectionSet) { - this.collectionSet = collectionSet; + this.nscs = collectionSet; } public void addCollectionSet(String item) { - collectionSet.add(item); + nscs.add(item); } /** * @return the collectionNamedSet */ public Set getCollectionDelimSet() { - return collectionDelimSet; + return nscds; } /** * @param collectionNamedSet the collectionNamedSet to set */ public void setCollectionDelimSet(Set collectionDelimSet) { - this.collectionDelimSet = collectionDelimSet; + this.nscds = collectionDelimSet; } public void addCollectionDelimSet(String item) { - this.collectionDelimSet.add(item); + this.nscds.add(item); } /** * @return the collectionMap */ public Map getCollectionMap() { - return collectionMap; + return nscollMap; } /** * @param collectionMap the collectionMap to set */ public void setCollectionMap(Map collectionMap) { - this.collectionMap = collectionMap; + this.nscollMap = collectionMap; } public void addCollectionMap(String key, String value) { - collectionMap.put(key, value); + nscollMap.put(key, value); } /** diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityG.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityG.java index 5c2bf8fdd..75ee7c15b 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityG.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/EntityG.java @@ -23,7 +23,7 @@ import javax.persistence.Id; import javax.persistence.Table; @Entity -@Table(name="\"entity d4\"") +@Table(name="\"nsentity d4\"") public class EntityG { @Id int id; diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/TestNoSchemaManualDelimId.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/TestNoSchemaManualDelimId.java index d688ad2a8..b5dc5fcbb 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/TestNoSchemaManualDelimId.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/TestNoSchemaManualDelimId.java @@ -32,23 +32,17 @@ import org.apache.openjpa.persistence.OpenJPAEntityManager; import org.apache.openjpa.persistence.test.AllowFailure; import org.apache.openjpa.persistence.test.SQLListenerTestCase; -@AllowFailure(message="Temporarily allowing this test to fail until cleanup " + - "order issues are resolved.") public class TestNoSchemaManualDelimId extends SQLListenerTestCase { OpenJPAEntityManager em; EntityF entityF; @Override public void setUp() throws Exception { - - // TODO: Delimiter support is currently limited to database that use - // double quote as a delimiter. - // Also Disabling DB2 until a SQLCODE -204 issue during the cleanup phase - // is resolved. - setUnsupportedDatabases(MySQLDictionary.class, DB2Dictionary.class); + + setUnsupportedDatabases(MySQLDictionary.class); if (isTestsDisabled()) return; - + super.setUp( org.apache.openjpa.persistence.delimited.identifiers.noschema.EntityF.class, DROP_TABLES); @@ -124,7 +118,7 @@ public class TestNoSchemaManualDelimId extends SQLListenerTestCase { private void queryCollection() { String query = "SELECT DISTINCT f " + - "FROM EntityF f, IN(f.collectionDelimSet) s " + + "FROM EntityF f, IN(f.nscds) s " + "WHERE s = 'aaa'"; Query q = em.createQuery(query); List results = (List)q.getResultList(); diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/TestNoSchemaManualDelimIdSeqGen.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/TestNoSchemaManualDelimIdSeqGen.java index 99ddae8f9..a6bfefb25 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/TestNoSchemaManualDelimIdSeqGen.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/TestNoSchemaManualDelimIdSeqGen.java @@ -26,8 +26,6 @@ import org.apache.openjpa.persistence.OpenJPAEntityManager; import org.apache.openjpa.persistence.test.AllowFailure; import org.apache.openjpa.persistence.test.SQLListenerTestCase; -@AllowFailure(message="Temporarily allowing this test to fail until cleanup " + - "order issues are resolved.") public class TestNoSchemaManualDelimIdSeqGen extends SQLListenerTestCase { OpenJPAEntityManager em; JDBCConfiguration conf; @@ -39,11 +37,7 @@ public class TestNoSchemaManualDelimIdSeqGen extends SQLListenerTestCase { @Override public void setUp() throws Exception { - // TODO: Delimiter support is currently limited to database that use - // double quote as a delimiter. - // Also Disabling DB2 until a SQLCODE -204 issue during the cleanup phase - // is resolved. - setUnsupportedDatabases(MySQLDictionary.class, DB2Dictionary.class); + setUnsupportedDatabases(MySQLDictionary.class); if (isTestsDisabled()) return; @@ -104,9 +98,7 @@ public class TestNoSchemaManualDelimIdSeqGen extends SQLListenerTestCase { em.getTransaction().begin(); em.persist(entityE); em.getTransaction().commit(); - - System.out.println(super.toString(sql)); - + int genId = entityE.getId(); em.clear(); em.getTransaction().begin(); diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/TestNoSchemaManualDelimitedJoinAnnotations.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/TestNoSchemaManualDelimitedJoinAnnotations.java index 8b75239b8..8a4a63f7a 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/TestNoSchemaManualDelimitedJoinAnnotations.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/noschema/TestNoSchemaManualDelimitedJoinAnnotations.java @@ -30,8 +30,6 @@ import org.apache.openjpa.persistence.OpenJPAEntityManager; import org.apache.openjpa.persistence.test.AllowFailure; import org.apache.openjpa.persistence.test.SQLListenerTestCase; -@AllowFailure(message="Temporarily allowing this test to fail until cleanup " + - "order issues are resolved.") public class TestNoSchemaManualDelimitedJoinAnnotations extends SQLListenerTestCase { OpenJPAEntityManager em; int id = 0; @@ -46,14 +44,10 @@ public class TestNoSchemaManualDelimitedJoinAnnotations extends SQLListenerTestC @Override public void setUp() throws Exception { - // TODO: Delimiter support is currently limited to database that use - // double quote as a delimiter. - // Also Disabling DB2 until a SQLCODE -204 issue during the cleanup phase - // is resolved. - setUnsupportedDatabases(MySQLDictionary.class, DB2Dictionary.class); + setUnsupportedDatabases(MySQLDictionary.class); if (isTestsDisabled()) return; - + super.setUp( org.apache.openjpa.persistence.delimited.identifiers.noschema.EntityC.class, org.apache.openjpa.persistence.delimited.identifiers.noschema.EntityD.class, diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/EntityH.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/EntityH.java index 4ae06b08a..b7e9f3576 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/EntityH.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/EntityH.java @@ -29,9 +29,9 @@ public class EntityH { private String secName; - private Collection entityIs = new HashSet(); + private Collection eIs = new HashSet(); - private EntityI2 entityI2; + private EntityI2 eI2; Map map = new HashMap(); @@ -86,31 +86,31 @@ public class EntityH { } public Collection getEntityIs() { - return entityIs; + return eIs; } /** * @param entityIs the entityIs to set */ public void setEntityIs(Collection entityIs) { - this.entityIs = entityIs; + this.eIs = entityIs; } public void addEntityI(EntityI entityI) { - entityIs.add(entityI); + eIs.add(entityI); } /** * @return the entityI2 */ public EntityI2 getEntityI2() { - return entityI2; + return eI2; } /** * @param entityI2 the entityI2 to set */ public void setEntityI2(EntityI2 entityI2) { - this.entityI2 = entityI2; + this.eI2 = entityI2; } /** diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/EntityI.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/EntityI.java index 5ae2155bf..733963fe0 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/EntityI.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/EntityI.java @@ -24,7 +24,7 @@ import java.util.HashSet; public class EntityI { private int id; private String name; - private Collection entityHs = new HashSet(); + private Collection eHs = new HashSet(); public EntityI() {} @@ -64,17 +64,17 @@ public class EntityI { * @return the entityHs */ public Collection getEntityHs() { - return entityHs; + return eHs; } /** * @param entityHs the entityHs to set */ public void setEntityHs(Collection entityHs) { - this.entityHs = entityHs; + this.eHs = entityHs; } public void addEntityH(EntityH entityH) { - entityHs.add(entityH); + eHs.add(entityH); } } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/EntityI2.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/EntityI2.java index 232ddff9e..03776e23c 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/EntityI2.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/EntityI2.java @@ -22,7 +22,7 @@ public class EntityI2 { private int id; private String name; - private EntityI3 entityI3; + private EntityI3 eI3; public EntityI2() {} @@ -62,13 +62,13 @@ public class EntityI2 { * @return the entityI3 */ public EntityI3 getEntityI3() { - return entityI3; + return eI3; } /** * @param entityI3 the entityI3 to set */ public void setEntityI3(EntityI3 entityI3) { - this.entityI3 = entityI3; + this.eI3 = entityI3; } } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/TestXmlDelimitedJoinAnnotation.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/TestXmlDelimitedJoinAnnotation.java index e8fa28eb6..8f83a2061 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/TestXmlDelimitedJoinAnnotation.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/delimited/identifiers/xml/TestXmlDelimitedJoinAnnotation.java @@ -120,7 +120,7 @@ public class TestXmlDelimitedJoinAnnotation extends SQLListenerTestCase { private void queryJoinTable() { String query = "SELECT h " + - "FROM EntityH h JOIN h.entityIs i " + + "FROM EntityH h JOIN h.eIs i " + "WHERE i.name = 'ei'"; Query q = em.createQuery(query); List results = (List)q.getResultList(); @@ -130,7 +130,7 @@ public class TestXmlDelimitedJoinAnnotation extends SQLListenerTestCase { private void queryJoinColumn() { String query = "SELECT h " + - "FROM EntityH h JOIN h.entityI2 i2 " + + "FROM EntityH h JOIN h.eI2 i2 " + "WHERE i2.name = 'ei2'"; Query q = em.createQuery(query); List results = (List)q.getResultList(); diff --git a/openjpa-persistence-jdbc/src/test/resources/META-INF/delimited-identifiers-joins-orm.xml b/openjpa-persistence-jdbc/src/test/resources/META-INF/delimited-identifiers-joins-orm.xml index c48aa68fe..294694eea 100644 --- a/openjpa-persistence-jdbc/src/test/resources/META-INF/delimited-identifiers-joins-orm.xml +++ b/openjpa-persistence-jdbc/src/test/resources/META-INF/delimited-identifiers-joins-orm.xml @@ -18,82 +18,82 @@ under the License. --> + version="2.0"> - +
- + - + - - + + - + - - + + - - + + -
+
- + -
+
- + - + -
+
- + -
+
- + diff --git a/openjpa-persistence-jdbc/src/test/resources/META-INF/delimited-identifiers-seq-gen-xml-orm.xml b/openjpa-persistence-jdbc/src/test/resources/META-INF/delimited-identifiers-seq-gen-xml-orm.xml index 12289cdf9..c4a89cbf3 100644 --- a/openjpa-persistence-jdbc/src/test/resources/META-INF/delimited-identifiers-seq-gen-xml-orm.xml +++ b/openjpa-persistence-jdbc/src/test/resources/META-INF/delimited-identifiers-seq-gen-xml-orm.xml @@ -28,7 +28,7 @@ version="2.0"> + schema=""delim xml seq""/>