openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r515375 - in /incubator/openjpa/trunk/openjpa-persistence-jdbc/src: main/java/org/apache/openjpa/persistence/jdbc/ test/java/org/apache/openjpa/kernel/ test/java/org/apache/openjpa/persistence/models/company/basic/ test/java/org/apache/open...
Date Tue, 06 Mar 2007 23:57:31 GMT
Author: pcl
Date: Tue Mar  6 15:57:29 2007
New Revision: 515375

URL: http://svn.apache.org/viewvc?view=rev&rev=515375
Log:
OPENJPA-121: Table name defaults to the class name instead of the entity name. The key change
is in PersistenceMappingDefaults; other changes include a new test case and removal of spurious
@Table annotations from previous workaround.

Added:
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/NamedEntity.java
  (contents, props changed)
      - copied, changed from r514871, incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/NamedEntity.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestTableNamesDefaultToEntityNames.java
  (with props)
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java
  (with props)
Removed:
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/NamedEntity.java
Modified:
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/PersistenceMappingDefaults.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestQueryCompilationCache.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Address.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Company.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/LineItem.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Person.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Product.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/ProductOrder.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Address.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Company.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/LineItem.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Person.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Product.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/ProductOrder.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Address.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Company.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/LineItem.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Person.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Product.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/ProductOrder.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Address.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Company.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Customer.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Employee.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/FullTimeEmployee.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/LineItem.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/PartTimeEmployee.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Person.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Product.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/ProductOrder.java
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestAbstractSchemaName.java

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/PersistenceMappingDefaults.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/PersistenceMappingDefaults.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/PersistenceMappingDefaults.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/PersistenceMappingDefaults.java
Tue Mar  6 15:57:29 2007
@@ -114,7 +114,11 @@
 
     @Override
     public String getTableName(ClassMapping cls, Schema schema) {
-        return Strings.getClassName(cls.getDescribedType()).replace('$', '_');
+        if (cls.getTypeAlias() != null)
+            return cls.getTypeAlias();
+        else
+            return Strings.getClassName(
+                cls.getDescribedType()).replace('$', '_');
     }
 
     @Override

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestQueryCompilationCache.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestQueryCompilationCache.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestQueryCompilationCache.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestQueryCompilationCache.java
Tue Mar  6 15:57:29 2007
@@ -26,7 +26,7 @@
 import org.apache.openjpa.persistence.OpenJPAEntityManagerFactory;
 import org.apache.openjpa.persistence.OpenJPAPersistence;
 import org.apache.openjpa.persistence.OpenJPAQuery;
-import org.apache.openjpa.persistence.query.NamedEntity;
+import org.apache.openjpa.persistence.simple.NamedEntity;
 
 import junit.framework.TestCase;
 
@@ -53,7 +53,7 @@
         
         // dig into the entry and check its internal state
         Compilation comp = (Compilation) cache.values().iterator().next();
-        assertEquals(NamedEntity.class, 
+        assertEquals(NamedEntity.class,
             ((ParsedJPQL) comp.storeData).getCandidateType());
         
         emf.close();

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Address.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Address.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Address.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Address.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="BAS_Address")
-@Table(name="BAS_Address") // OPENJPA-121
 public class Address implements IAddress {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Company.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Company.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Company.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Company.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="BAS_Company")
-@Table(name="BAS_Company") // OPENJPA-121
 public class Company implements ICompany {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/LineItem.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/LineItem.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/LineItem.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/LineItem.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="BAS_LineItem")
-@Table(name="BAS_LineItem") // OPENJPA-121
 public class LineItem implements ILineItem {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Person.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Person.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Person.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Person.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="BAS_Person")
-@Table(name="BAS_Person") // OPENJPA-121
 @Inheritance(strategy=InheritanceType.SINGLE_TABLE)
 public abstract class Person implements IPerson {
     private static long idCounter = System.currentTimeMillis();

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Product.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Product.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Product.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/Product.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="BAS_Product")
-@Table(name="BAS_Product") // OPENJPA-121
 public class Product implements IProduct {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/ProductOrder.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/ProductOrder.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/ProductOrder.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/basic/ProductOrder.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="BAS_ProductOrder")
-@Table(name="BAS_ProductOrder") // OPENJPA-121
 public class ProductOrder implements IProductOrder {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Address.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Address.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Address.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Address.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="LAZ_Address")
-@Table(name="LAZ_Address") // OPENJPA-121
 public class Address implements IAddress {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Company.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Company.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Company.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Company.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="LAZ_Company")
-@Table(name="LAZ_Company") // OPENJPA-121
 public class Company implements ICompany {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/LineItem.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/LineItem.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/LineItem.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/LineItem.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="LAZ_LineItem")
-@Table(name="LAZ_LineItem") // OPENJPA-121
 public class LineItem implements ILineItem {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Person.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Person.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Person.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Person.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="LAZ_Person")
-@Table(name="LAZ_Person") // OPENJPA-121
 @Inheritance(strategy=InheritanceType.SINGLE_TABLE)
 public abstract class Person implements IPerson {
     private static long idCounter = System.currentTimeMillis();

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Product.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Product.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Product.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/Product.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="LAZ_Product")
-@Table(name="LAZ_Product") // OPENJPA-121
 public class Product implements IProduct {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/ProductOrder.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/ProductOrder.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/ProductOrder.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/fetchlazy/ProductOrder.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="LAZ_ProductOrder")
-@Table(name="LAZ_ProductOrder") // OPENJPA-121
 public class ProductOrder implements IProductOrder {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Address.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Address.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Address.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Address.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="IDC_Address")
-@Table(name="IDC_Address") // OPENJPA-121
 public class Address implements IAddress {
     private static int ids = 1;
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Company.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Company.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Company.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Company.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="IDC_Company")
-@Table(name="IDC_Company") // OPENJPA-121
 public class Company implements ICompany {
     private static int ids = 1;
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/LineItem.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/LineItem.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/LineItem.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/LineItem.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="IDC_LineItem")
-@Table(name="IDC_LineItem") // OPENJPA-121
 public class LineItem implements ILineItem {
     private static int ids = 1;
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Person.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Person.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Person.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Person.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="IDC_Person")
-@Table(name="IDC_Person") // OPENJPA-121
 @Inheritance(strategy=InheritanceType.SINGLE_TABLE)
 public abstract class Person implements IPerson {
     private static int ids = 1;

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Product.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Product.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Product.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/Product.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="IDC_Product")
-@Table(name="IDC_Product") // OPENJPA-121
 public class Product implements IProduct {
     private static int ids = 1;
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/ProductOrder.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/ProductOrder.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/ProductOrder.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/idclass/ProductOrder.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="IDC_ProductOrder")
-@Table(name="IDC_ProductOrder") // OPENJPA-121
 public class ProductOrder implements IProductOrder {
     private static int ids = 1;
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Address.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Address.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Address.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Address.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="JI_Address")
-@Table(name="JI_Address") // OPENJPA-121
 public class Address implements IAddress {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Company.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Company.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Company.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Company.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="JI_Company")
-@Table(name="JI_Company") // OPENJPA-121
 public class Company implements ICompany {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Customer.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Customer.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Customer.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Customer.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="JI_Customer")
-@Table(name="JI_Customer") // OPENJPA-121
 @Inheritance(strategy=InheritanceType.JOINED)
 public class Customer extends Person implements ICustomer {
     @OneToMany(mappedBy="customer")

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Employee.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Employee.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Employee.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Employee.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="JI_Employee")
-@Table(name="JI_Employee") // OPENJPA-121
 @Inheritance(strategy=InheritanceType.JOINED)
 public abstract class Employee extends Person implements IEmployee {
     @OneToOne

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/FullTimeEmployee.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/FullTimeEmployee.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/FullTimeEmployee.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/FullTimeEmployee.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="JI_FullTimeEmployee")
-@Table(name="JI_FullTimeEmployee") // OPENJPA-121
 @Inheritance(strategy=InheritanceType.JOINED)
 public class FullTimeEmployee extends Employee
     implements IFullTimeEmployee {

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/LineItem.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/LineItem.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/LineItem.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/LineItem.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="JI_LineItem")
-@Table(name="JI_LineItem") // OPENJPA-121
 public class LineItem implements ILineItem {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/PartTimeEmployee.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/PartTimeEmployee.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/PartTimeEmployee.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/PartTimeEmployee.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="JI_PartTimeEmployee")
-@Table(name="JI_PartTimeEmployee") // OPENJPA-121
 @Inheritance(strategy=InheritanceType.JOINED)
 public class PartTimeEmployee extends Employee
     implements IPartTimeEmployee {

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Person.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Person.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Person.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Person.java
Tue Mar  6 15:57:29 2007
@@ -19,7 +19,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="JI_Person")
-@Table(name="JI_Person") // OPENJPA-121
 @Inheritance(strategy=InheritanceType.JOINED)
 public abstract class Person implements IPerson {
     private static long idCounter = System.currentTimeMillis();

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Product.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Product.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Product.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/Product.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="JI_Product")
-@Table(name="JI_Product") // OPENJPA-121
 public class Product implements IProduct {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/ProductOrder.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/ProductOrder.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/ProductOrder.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/models/company/joined/ProductOrder.java
Tue Mar  6 15:57:29 2007
@@ -20,7 +20,6 @@
 import org.apache.openjpa.persistence.models.company.*;
 
 @Entity(name="JI_ProductOrder")
-@Table(name="JI_ProductOrder") // OPENJPA-121
 public class ProductOrder implements IProductOrder {
     private static long idCounter = System.currentTimeMillis();
 

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestAbstractSchemaName.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestAbstractSchemaName.java?view=diff&rev=515375&r1=515374&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestAbstractSchemaName.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestAbstractSchemaName.java
Tue Mar  6 15:57:29 2007
@@ -24,6 +24,7 @@
 
 import junit.framework.TestCase;
 import junit.textui.TestRunner;
+import org.apache.openjpa.persistence.simple.NamedEntity;
 
 /**
  * Test that we can query by an entity's abstract schema name.

Copied: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/NamedEntity.java
(from r514871, incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/NamedEntity.java)
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/NamedEntity.java?view=diff&rev=515375&p1=incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/NamedEntity.java&r1=514871&p2=incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/NamedEntity.java&r2=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/NamedEntity.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/NamedEntity.java
Tue Mar  6 15:57:29 2007
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.openjpa.persistence.query;
+package org.apache.openjpa.persistence.simple;
 
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;

Propchange: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/NamedEntity.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestTableNamesDefaultToEntityNames.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestTableNamesDefaultToEntityNames.java?view=auto&rev=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestTableNamesDefaultToEntityNames.java
(added)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestTableNamesDefaultToEntityNames.java
Tue Mar  6 15:57:29 2007
@@ -0,0 +1,20 @@
+package org.apache.openjpa.persistence.simple;
+
+import org.apache.openjpa.persistence.OpenJPAPersistence;
+import org.apache.openjpa.persistence.test.PersistenceTestCase;
+import org.apache.openjpa.jdbc.meta.ClassMapping;
+
+public class TestTableNamesDefaultToEntityNames
+    extends PersistenceTestCase {
+
+    @Override
+    protected Class[] getEntityTypes() {
+        return new Class[] { NamedEntity.class };
+    }
+
+    public void testEntityNames() {
+        ClassMapping cm = (ClassMapping) OpenJPAPersistence.getMetaData(
+            getEntityManagerFactory(), NamedEntity.class);
+        assertEquals("named", cm.getTable().getName());
+    }
+}

Propchange: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestTableNamesDefaultToEntityNames.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java?view=auto&rev=515375
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java
(added)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java
Tue Mar  6 15:57:29 2007
@@ -0,0 +1,39 @@
+package org.apache.openjpa.persistence.test;
+
+import java.util.Map;
+import java.util.HashMap;
+import javax.persistence.Persistence;
+
+import junit.framework.TestCase;
+import org.apache.openjpa.persistence.OpenJPAEntityManagerFactory;
+
+public abstract class PersistenceTestCase
+    extends TestCase {
+
+    protected OpenJPAEntityManagerFactory emf;
+
+    protected Class[] getEntityTypes() {
+        return new Class[0];
+    }
+
+    public void setUp() {
+        Map props = new HashMap(System.getProperties());
+        Class[] types = getEntityTypes();
+        if (types != null && types.length > 0) {
+            StringBuffer buf = new StringBuffer();
+            for (int i = 0; i < types.length; i++) {
+                buf.append(types[i].getName());
+                if (i != types.length - 1)
+                    buf.append(",");
+            }
+            props.put("openjpa.MetaDataFactory",
+                "jpa(Types=" + buf.toString() + ")");
+        }
+        emf = (OpenJPAEntityManagerFactory)
+            Persistence.createEntityManagerFactory("test", props);
+    }
+
+    public OpenJPAEntityManagerFactory getEntityManagerFactory() {
+        return emf;
+    }
+}

Propchange: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message