mirror of https://github.com/apache/openjpa.git
OPENJPA-1047: Prohibit Table annotation or XML descriptor element for MappedSuperclass.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@835292 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
965c997c24
commit
8c952771dc
|
@ -62,6 +62,7 @@ import org.apache.openjpa.meta.ValueMetaData;
|
|||
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 @@ public class XMLPersistenceMappingParser
|
|||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,3 +60,6 @@ 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.
|
||||
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.
|
Loading…
Reference in New Issue