openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r835292 - in /openjpa/trunk/openjpa-persistence-jdbc/src/main: java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java resources/org/apache/openjpa/persistence/jdbc/localizer.properties
Date Thu, 12 Nov 2009 08:10:08 GMT
Author: ppoddar
Date: Thu Nov 12 08:10:05 2009
New Revision: 835292

URL: http://svn.apache.org/viewvc?rev=835292&view=rev
Log:
OPENJPA-1047: Prohibit Table annotation or XML descriptor element for MappedSuperclass.

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java
    openjpa/trunk/openjpa-persistence-jdbc/src/main/resources/org/apache/openjpa/persistence/jdbc/localizer.properties

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java?rev=835292&r1=835291&r2=835292&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java
Thu Nov 12 08:10:05 2009
@@ -62,6 +62,7 @@
 import org.apache.openjpa.persistence.XMLPersistenceMetaDataParser;
 import org.apache.openjpa.util.InternalException;
 import org.apache.openjpa.util.MetaDataException;
+import org.apache.openjpa.util.UserException;
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -781,11 +782,13 @@
      */
     private boolean startTable(Attributes attrs)
         throws SAXException {
+        ClassMapping mapping = (ClassMapping) currentElement();
+        if (mapping.isAbstract())
+            throw new UserException(_loc.get("table-not-allowed", mapping));
         String table = toTableName(attrs.getValue("schema"),
             attrs.getValue("name"));
         if (table != null)
-            ((ClassMapping) currentElement()).getMappingInfo().setTableName
-                (table);
+            mapping.getMappingInfo().setTableName(table);
         return true;
     }
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/resources/org/apache/openjpa/persistence/jdbc/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/resources/org/apache/openjpa/persistence/jdbc/localizer.properties?rev=835292&r1=835291&r2=835292&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/main/resources/org/apache/openjpa/persistence/jdbc/localizer.properties
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/resources/org/apache/openjpa/persistence/jdbc/localizer.properties
Thu Nov 12 08:10:05 2009
@@ -59,4 +59,7 @@
 implicit-non-default-fk: While parsing "{0}" from "{1}", found a @ForeignKey \
 	with implicit attribute set to true but one or more other attributes of \
 	ForeignKey is set to their non-default value. You can not specify any \
-	non-default value for an implicit ForeignKey.  	    
\ No newline at end of file
+	non-default value for an implicit ForeignKey. 
+table-not-allowed: You have specified Table annotation or XML descriptor element \
+	for MappedSuperclass "{0}". A class designated as a mapped superclass can not \
+	have a separate table defined for it. 	    
\ No newline at end of file



Mime
View raw message