openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dian...@apache.org
Subject svn commit: r1207320 [1/3] - in /openjpa/trunk: openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/fet...
Date Mon, 28 Nov 2011 15:45:00 GMT
Author: dianner
Date: Mon Nov 28 15:44:58 2011
New Revision: 1207320

URL: http://svn.apache.org/viewvc?rev=1207320&view=rev
Log:
OPENJPA-2081 XML support for about 26 annotations

Added:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/fetchgroups/TestFetchGroupStacksXML.java   (with props)
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMultiColumnVersionXML.java   (with props)
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestUpdateSingleValuedAssociationXML.java   (with props)
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/xml/
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/xml/TestNonstandardMappingXML.java   (with props)
    openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/fetch-groups-orm.xml   (with props)
    openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/foreign-key-orm.xml   (with props)
    openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/nonstandard-orm.xml   (with props)
    openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/version-columns-orm.xml   (with props)
    openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/xml/
    openjpa/trunk/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/extendable-orm.xsd   (with props)
    openjpa/trunk/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/openjpa-orm.xsd   (with props)
Modified:
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java
    openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
    openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/MappingTag.java
    openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest4.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest5.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java?rev=1207320&r1=1207319&r2=1207320&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java Mon Nov 28 15:44:58 2011
@@ -99,8 +99,22 @@ public class CFMetaDataParser extends XM
         int depth = currentDepth();
         if (depth == 0)
             return true;
+        
+        if (StringUtils.contains(name, ':')) {
+            int index = name.indexOf(':');
+            name = name.substring(index + 1);
+        }
 
         try {
+            if (_openjpaNamespace > 0) {
+                if (name.equals("entity"))
+                    return startExtendedClass(name,attrs);
+                if (name.equals("attributes")) {
+                    return true;
+                }
+                return startClassElement(name, attrs);
+                    
+            }
             if (depth == getPackageElementDepth()
                 && isPackageElementName(name))
                 return startPackage(name, attrs);
@@ -125,9 +139,24 @@ public class CFMetaDataParser extends XM
         int depth = currentDepth();
         if (depth == 0)
             return;
+        
+        if (StringUtils.contains(name, ':')) {
+            int index = name.indexOf(':');
+            name = name.substring(index + 1);
+        }
 
         try {
-            if (depth == getPackageElementDepth()
+            if (_openjpaNamespace > 0) {
+                if (name.equals("entity"))
+                    endExtendedClass(name);
+                else if (name.equals("attributes")) {
+                    // do nothing
+                }
+                else {
+                    endClassElement(name);
+                }
+            }
+            else if (depth == getPackageElementDepth()
                 && isPackageElementName(name))
                 endPackage(name);
             else if (depth == getClassElementDepth()
@@ -198,6 +227,14 @@ public class CFMetaDataParser extends XM
                 _class = _package + "." + _class;
         }
     }
+    
+    protected boolean startExtendedClass(String elem, Attributes attrs)
+        throws SAXException {
+        return false;
+    }
+    
+    protected void endExtendedClass(String elem) throws SAXException {
+    }
 
     /**
      * Override this method marking the start of an element outside of any

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java?rev=1207320&r1=1207319&r2=1207320&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java Mon Nov 28 15:44:58 2011
@@ -44,7 +44,6 @@ import org.xml.sax.ext.LexicalHandler;
 import org.xml.sax.helpers.DefaultHandler;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
-import org.apache.openjpa.lib.util.JavaVersions;
 import org.apache.openjpa.lib.util.Localizer.Message;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.xml.Commentable;
@@ -65,6 +64,10 @@ public abstract class XMLMetaDataParser 
     private static final Localizer _loc = Localizer.forPackage
         (XMLMetaDataParser.class);
     private static boolean _schemaBug;
+    
+    private static final String OPENJPA_NAMESPACE = "http://www.apache.org/openjpa/ns/orm";
+    protected int _extendedNamespace = 0;
+    protected int _openjpaNamespace = 0;
 
     static {
         try {
@@ -488,15 +491,28 @@ public abstract class XMLMetaDataParser 
     public void startElement(String uri, String name, String qName,
         Attributes attrs) throws SAXException {
         _depth++;
-        if (_depth <= _ignore)
+        if (_depth <= _ignore){
+            if (uri.equals(OPENJPA_NAMESPACE)) {
+                _extendedNamespace++;
+                _openjpaNamespace++;
+            }
             if (!startElement(qName, attrs))
                 ignoreContent(true);
+        }
     }
 
     public void endElement(String uri, String name, String qName)
         throws SAXException {
-        if (_depth < _ignore)
+        if (_depth < _ignore) {
             endElement(qName);
+            _extendedNamespace = (_extendedNamespace > 0) ? _extendedNamespace - 1 : 0;
+            _openjpaNamespace = (_openjpaNamespace > 0) ? _openjpaNamespace - 1 : 0;
+        }
+        else if (_depth ==_ignore) {
+            _extendedNamespace = (_extendedNamespace > 0) ? _extendedNamespace - 1 : 0;
+            _openjpaNamespace = (_openjpaNamespace > 0) ? _openjpaNamespace - 1 : 0;
+        }
+        
         _text = null;
         if (_comments != null)
             _comments.clear();

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java?rev=1207320&r1=1207319&r2=1207320&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java Mon Nov 28 15:44:58 2011
@@ -724,6 +724,7 @@ public class AnnotationPersistenceMappin
         col.setFlag(Column.FLAG_UNUPDATABLE, !id.updatable());
         cm.getMappingInfo().setColumns(Arrays.asList(new Column[]{ col }));
     }
+    
 
     /**
      * Parse the given foreign key.
@@ -853,24 +854,47 @@ public class AnnotationPersistenceMappin
      * Create a new schema column with information from the given annotation.
      */
     private static Column newColumn(VersionColumn anno, boolean delimit) {
+        return newColumn(anno.name(),
+            anno.nullable(),
+            anno.insertable(),
+            anno.updatable(),
+            anno.columnDefinition(),
+            anno.length(),
+            anno.precision(),
+            anno.scale(),
+            anno.table(),
+            delimit);
+    }
+    
+    static Column newColumn(String name,
+            boolean nullable,
+            boolean insertable,
+            boolean updatable,
+            String columnDefinition,
+            int length,
+            int precision,
+            int scale,
+            String table,
+            boolean delimit) {
         Column col = new Column();
-        col.setTableIdentifier(DBIdentifier.newTable(anno.table(), delimit));
-        if (!StringUtils.isEmpty(anno.name()))
-            col.setIdentifier(DBIdentifier.newColumn(anno.name(), delimit));
-        if (anno.precision() != 0)
-            col.setSize(anno.precision());
-        else if (anno.length() != 255)
-            col.setSize(anno.length());
-        col.setNotNull(!anno.nullable());
-        col.setDecimalDigits(anno.scale());
-        if (!StringUtils.isEmpty(anno.columnDefinition())) {
-            col.setTypeIdentifier(DBIdentifier.newColumnDefinition(anno.columnDefinition()));
+        col.setTableIdentifier(DBIdentifier.newTable(table, delimit));
+        if (!StringUtils.isEmpty(name))
+            col.setIdentifier(DBIdentifier.newColumn(name, delimit));
+        if (precision != 0)
+            col.setSize(precision);
+        else if (length != 255)
+            col.setSize(length);
+        col.setNotNull(!nullable);
+        col.setDecimalDigits(scale);
+        if (!StringUtils.isEmpty(columnDefinition)) {
+            col.setTypeIdentifier(DBIdentifier.newColumnDefinition(columnDefinition));
             col.setType(Schemas.getJDBCType(col.getTypeIdentifier().getName()));
             col.setJavaType(JavaTypes.getTypeCode(Schemas.getJavaType
-            	(col.getType(), col.getSize(), col.getDecimalDigits())));
+                (col.getType(), col.getSize(), col.getDecimalDigits())));
         }
-        col.setFlag(Column.FLAG_UNINSERTABLE, !anno.insertable());
-        col.setFlag(Column.FLAG_UNUPDATABLE, !anno.updatable());
+        col.setFlag(Column.FLAG_UNINSERTABLE, !insertable);
+        col.setFlag(Column.FLAG_UNUPDATABLE, !updatable);
+        
         return col;
     }
 
@@ -997,7 +1021,7 @@ public class AnnotationPersistenceMappin
         Column col = new Column();
         int typeCode = fmd.isElementCollection() ? fmd.getElement().getDeclaredTypeCode() :
             fmd.getDeclaredTypeCode();
-        Class type = fmd.isElementCollection() ? fmd.getElement().getDeclaredType() :
+        Class<?> type = fmd.isElementCollection() ? fmd.getElement().getDeclaredType() :
             fmd.getDeclaredType();
    
         if (typeCode == JavaTypes.STRING
@@ -1464,7 +1488,7 @@ public class AnnotationPersistenceMappin
      * Parse @Temporal.
      */
     private void parseTemporal(FieldMapping fm, Temporal anno) {
-        List cols = fm.getValueInfo().getColumns();
+        List<Column> cols = fm.getValueInfo().getColumns();
         if (!cols.isEmpty() && cols.size() != 1)
             throw new MetaDataException(_loc.get("num-cols-mismatch", fm,
                 String.valueOf(cols.size()), "1"));
@@ -1497,7 +1521,7 @@ public class AnnotationPersistenceMappin
      * Parse @Temporal.
      */
     private void parseMapKeyTemporal(FieldMapping fm, MapKeyTemporal anno) {
-        List cols = fm.getKeyMapping().getValueInfo().getColumns();
+        List<Column> cols = fm.getKeyMapping().getValueInfo().getColumns();
         if (!cols.isEmpty() && cols.size() != 1)
             throw new MetaDataException(_loc.get("num-cols-mismatch", fm,
                 String.valueOf(cols.size()), "1"));
@@ -1529,7 +1553,7 @@ public class AnnotationPersistenceMappin
             return;
 
         // might already have some column information from mapping annotation
-        List cols = fm.getValueInfo().getColumns();
+        List<Column> cols = fm.getValueInfo().getColumns();
         if (!cols.isEmpty() && cols.size() != pcols.length)
             throw new MetaDataException(_loc.get("num-cols-mismatch", fm,
                 String.valueOf(cols.size()), String.valueOf(pcols.length)));

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/MappingTag.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/MappingTag.java?rev=1207320&r1=1207319&r2=1207320&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/MappingTag.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/MappingTag.java Mon Nov 28 15:44:58 2011
@@ -80,6 +80,8 @@ enum MappingTag {
     ELEM_STRAT,
     EMBEDDED_MAPPING,
     FK,
+    FK_COL_NAMES,
+    FK_COL_NAME,
     INDEX,
     KEY_COL,
     KEY_COLS,

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=1207320&r1=1207319&r2=1207320&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 Mon Nov 28 15:44:58 2011
@@ -37,6 +37,7 @@ import org.apache.commons.lang.StringUti
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import org.apache.openjpa.jdbc.identifier.DBIdentifier;
 import org.apache.openjpa.jdbc.identifier.QualifiedDBIdentifier;
+import org.apache.openjpa.jdbc.kernel.EagerFetchModes;
 import org.apache.openjpa.jdbc.meta.ClassMapping;
 import org.apache.openjpa.jdbc.meta.ClassMappingInfo;
 import org.apache.openjpa.jdbc.meta.DiscriminatorMappingInfo;
@@ -58,7 +59,6 @@ import org.apache.openjpa.jdbc.sql.DBDic
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.meta.SourceTracker;
 import org.apache.openjpa.lib.util.Localizer;
-import org.apache.openjpa.meta.AccessCode;
 import org.apache.openjpa.meta.ClassMetaData;
 import org.apache.openjpa.meta.FieldMetaData;
 import org.apache.openjpa.meta.JavaTypes;
@@ -88,15 +88,21 @@ public class XMLPersistenceMappingParser
         _elems.put("attribute-override", ATTR_OVERRIDE);
         _elems.put("collection-table", COLLECTION_TABLE);
         _elems.put("column", COL);
+        _elems.put("columns", COLS);
         _elems.put("column-name", COLUMN_NAME);
         _elems.put("column-result", COLUMN_RESULT);
+        _elems.put("data-store-id-column", DATASTORE_ID_COL);
         _elems.put("delimited-identifiers", DELIMITED_IDS);
         _elems.put("discriminator-column", DISCRIM_COL);
         _elems.put("discriminator-value", DISCRIM_VAL);
         _elems.put("entity-result", ENTITY_RESULT);
         _elems.put("enumerated", ENUMERATED);
         _elems.put("field-result", FIELD_RESULT);
+        _elems.put("foreign-key", FK);
+        _elems.put("fk_column-names", FK_COL_NAMES);
+        _elems.put("fk_column_name", FK_COL_NAME);
         _elems.put("inheritance", INHERITANCE);
+        _elems.put("index", INDEX);
         _elems.put("join-column", JOIN_COL);
         _elems.put("inverse-join-column", COL);
         _elems.put("join-table", JOIN_TABLE);
@@ -113,6 +119,8 @@ public class XMLPersistenceMappingParser
         _elems.put("table-generator", TABLE_GEN);
         _elems.put("temporal", TEMPORAL);
         _elems.put("unique-constraint", UNIQUE);
+        _elems.put("version-columns", VERSION_COLS);
+        _elems.put("version-column", VERSION_COL);
     }
 
     private static final Localizer _loc = Localizer.forPackage
@@ -132,11 +140,18 @@ public class XMLPersistenceMappingParser
     private Column _discCol;
     private int _resultIdx = 0;
     private final DBDictionary _dict;
+    
+    // ForeignKey info
+    private Attributes _foreignKeyAttributes = null;
+    private List<String> _columnNamesList = null;
+    private String[] _columnNames = {};
+    
+    private List<Column> _versionColumnsList = null;
 
     private final Map<Class<?>, ArrayList<DeferredEmbeddableOverrides>> 
         _deferredMappings = new HashMap<Class<?>, 
              ArrayList<DeferredEmbeddableOverrides>>();
-
+    
     /**
      * Constructor; supply configuration.
      */
@@ -245,6 +260,9 @@ public class XMLPersistenceMappingParser
             case COL:
                 ret = startColumn(attrs);
                 break;
+            case COLS:
+                ret = true;
+                break;
             case JOIN_COL:
                 ret = startJoinColumn(attrs);
                 break;
@@ -290,6 +308,28 @@ public class XMLPersistenceMappingParser
             case MAP_KEY_JOIN_COL:
                 ret = startMapKeyJoinColumn(attrs);
                 break;
+            case DATASTORE_ID_COL:
+                ret = startDatastoreIdCol(attrs);
+                break;
+            case INDEX:
+                System.out.println("++++++++++++ INDEX");
+                ret = startIndex(attrs);
+                break;
+            case FK:
+                ret = startForeignKey(attrs);
+                break;
+            case FK_COL_NAMES:
+                ret = startFKColumnNames(attrs);
+                break;
+            case FK_COL_NAME:
+                ret = true;
+                break;
+            case VERSION_COLS:
+                ret = startVersionColumns(attrs);
+                break;
+            case VERSION_COL:
+                ret = startVersionColumn(attrs);
+                break;
             default:
                 ret = false;
         }
@@ -360,6 +400,18 @@ public class XMLPersistenceMappingParser
             case NAME:
                 endName();
                 break;
+            case FK:
+                endForeignKey();
+                break;
+            case FK_COL_NAMES:
+                endFKColumnNames();
+                break;
+            case FK_COL_NAME:
+                endFKColumnName();
+                break;
+            case VERSION_COLS:
+                endVersionColumns();
+                break;
         }
     }
 
@@ -1474,4 +1526,280 @@ public class XMLPersistenceMappingParser
     private boolean delimit() {
         return _dict.getDelimitIdentifiers();
     }
+    
+    /**
+     * Translate the fetch mode enum value to the internal OpenJPA constant.
+     */
+    private static int toEagerFetchModeConstant(String mode) {
+        if(mode.equals("NONE"))
+            return EagerFetchModes.EAGER_NONE;
+        else if (mode.equals("JOIN"))
+            return EagerFetchModes.EAGER_JOIN;
+        else if (mode.equals("PARALLEL"))
+            return EagerFetchModes.EAGER_PARALLEL;
+        else
+            throw new InternalException();
+    }
+    
+    private boolean startDatastoreIdCol(Attributes attrs)
+        throws SAXException {
+        
+        ClassMapping cm = (ClassMapping) peekElement();
+        
+        Column col = new Column();
+        String name = attrs.getValue("name");
+        if (!StringUtils.isEmpty(name));
+            col.setIdentifier(DBIdentifier.newColumn(name, delimit()));
+        String columnDefinition= attrs.getValue("column-definition");
+        if (!StringUtils.isEmpty(columnDefinition))
+            col.setTypeIdentifier(DBIdentifier.newColumnDefinition(columnDefinition));
+        int precision = Integer.parseInt(attrs.getValue("precision"));
+        if (precision != 0)
+            col.setSize(precision);
+        col.setFlag(Column.FLAG_UNINSERTABLE, !Boolean.parseBoolean(attrs.getValue("insertable")));
+        col.setFlag(Column.FLAG_UNUPDATABLE, !Boolean.parseBoolean(attrs.getValue("updatable")));
+        cm.getMappingInfo().setColumns(Arrays.asList(new Column[]{ col }));
+        
+        return true;
+    }
+    
+    private boolean startIndex(Attributes attrs)
+        throws SAXException {
+        
+        FieldMapping fm = (FieldMapping) peekElement();
+        
+        parseIndex(fm.getValueInfo(),
+            attrs.getValue("name"),
+            Boolean.parseBoolean(attrs.getValue("enabled")),
+            Boolean.parseBoolean(attrs.getValue("unique")));
+        
+        return true;
+    }
+    
+    private void parseIndex(MappingInfo info, String name,
+        boolean enabled, boolean unique) {
+        if (!enabled) {
+            info.setCanIndex(false);
+            return;
+        }
+
+        org.apache.openjpa.jdbc.schema.Index idx =
+            new org.apache.openjpa.jdbc.schema.Index();
+        if (!StringUtils.isEmpty(name))
+            idx.setIdentifier(DBIdentifier.newConstraint(name, delimit()));
+        idx.setUnique(unique);
+        info.setIndex(idx);
+    }
+    
+    private boolean startForeignKey(Attributes attrs) 
+        throws SAXException {
+        
+        _foreignKeyAttributes = attrs;
+        
+        return true;
+    }
+    
+    private void endForeignKey() {
+        if (_foreignKeyAttributes == null) {
+            throw new InternalException();
+        }
+        
+        boolean implicit = Boolean.parseBoolean(_foreignKeyAttributes.getValue("implicit"));
+        
+        FieldMapping fm = (FieldMapping) peekElement();
+        MappingInfo info = fm.getValueInfo();
+        
+        String name = _foreignKeyAttributes.getValue("name");
+        boolean enabled = Boolean.parseBoolean(_foreignKeyAttributes.getValue("enabled"));
+        boolean deferred = Boolean.parseBoolean(_foreignKeyAttributes.getValue("deferred"));
+        boolean specified = Boolean.parseBoolean(_foreignKeyAttributes.getValue("specified"));
+        String deleteActionString = _foreignKeyAttributes.getValue("delete-action");
+        String updateActionString = _foreignKeyAttributes.getValue("update-action");
+        int deleteAction = toForeignKeyInt(deleteActionString);
+        int updateAction = toForeignKeyInt(updateActionString);
+        
+        if (!implicit) {
+            parseForeignKey(info, name,
+                enabled,
+                deferred, deleteAction,
+                updateAction);
+        }
+        else {
+            info.setImplicitRelation(true);
+            assertDefault(name, enabled, deferred, specified, updateAction, deleteAction);
+        }
+        
+        _columnNamesList = null;
+    }
+    
+    private void parseForeignKey(MappingInfo info, String name, boolean enabled,
+        boolean deferred, int deleteAction, int updateAction) {
+        
+        if (!enabled) {
+            info.setCanForeignKey(false);
+            return;
+        }
+
+        org.apache.openjpa.jdbc.schema.ForeignKey fk =
+            new org.apache.openjpa.jdbc.schema.ForeignKey();
+        if (!StringUtils.isEmpty(name))
+            fk.setIdentifier(DBIdentifier.newForeignKey(name, delimit()));
+        fk.setDeferred(deferred);
+        fk.setDeleteAction(deleteAction);
+        fk.setUpdateAction(updateAction);
+        info.setForeignKey(fk);
+        
+    }
+    
+    
+    private int toForeignKeyInt(String action) {
+        if (action.equals("RESTRICT")) {
+            return org.apache.openjpa.jdbc.schema.ForeignKey.
+                    ACTION_RESTRICT;
+        }
+        else if (action.equals("CASCADE")) {
+            return org.apache.openjpa.jdbc.schema.ForeignKey.ACTION_CASCADE;
+        }
+        else if (action.equals("NULL")) {
+            return org.apache.openjpa.jdbc.schema.ForeignKey.ACTION_NULL;
+        }
+        else if (action.equals("DEFAULT")) {
+            return org.apache.openjpa.jdbc.schema.ForeignKey.ACTION_DEFAULT;
+        }
+        else {
+            throw new InternalException();
+        }
+        
+    }
+    
+    private void assertDefault(String name, boolean enabled, boolean deferred, boolean specified,
+        int updateAction, int deleteAction) {
+        boolean isDefault = StringUtils.isEmpty(name) 
+            && enabled 
+            && !deferred 
+                && deleteAction == org.apache.openjpa.jdbc.schema.ForeignKey.ACTION_RESTRICT
+                && updateAction == org.apache.openjpa.jdbc.schema.ForeignKey.ACTION_RESTRICT
+            && _columnNames.length == 0
+            && specified;
+        if (!isDefault)
+            throw new UserException(_loc.get("implicit-non-default-fk", _cls,
+                getSourceFile()).getMessage());
+    }
+    
+    private boolean startFKColumnNames(Attributes attrs) 
+        throws SAXException {
+        _columnNamesList = new ArrayList<String>();
+        return true;
+    }
+    
+    private void endFKColumnNames() {
+        if (_columnNamesList.size() > 0) {
+            _columnNames = _columnNamesList.toArray(_columnNames);
+            _columnNamesList.removeAll(_columnNamesList);
+        }
+    }
+    
+    private void endFKColumnName() {
+        _columnNamesList.add(currentText());
+    }
+    
+    private boolean startVersionColumns(Attributes attrs)
+        throws SAXException {
+        
+        _versionColumnsList = new ArrayList<Column>();
+        
+        return true;
+    }
+    
+    private void endVersionColumns() {
+        if (_versionColumnsList == null) {
+            throw new InternalException();
+        }
+        
+        if (_versionColumnsList.size() > 0) {
+            ClassMapping cm = (ClassMapping)peekElement();
+            cm.getVersion().getMappingInfo().setColumns(_versionColumnsList);
+            _versionColumnsList= null;
+        }
+    }
+    
+    private boolean startVersionColumn(Attributes attrs)
+            throws SAXException {
+            
+        Column col = AnnotationPersistenceMappingParser.newColumn(attrs.getValue("name"),
+            Boolean.parseBoolean(attrs.getValue("nullable")),
+            Boolean.parseBoolean(attrs.getValue("insertable")),
+            Boolean.parseBoolean(attrs.getValue("updatable")),
+            attrs.getValue("columnDefinition"),
+            Integer.parseInt(attrs.getValue("length")),
+            Integer.parseInt(attrs.getValue("precision")),
+            Integer.parseInt(attrs.getValue("scale")), 
+            attrs.getValue("table"), 
+            delimit());
+        
+        _versionColumnsList.add(col);
+        
+        return true;
+        }
+
+    @Override
+    protected void parseEagerFetchModeAttr(FieldMetaData fmd, Attributes attrs)
+        throws SAXException {
+        
+        FieldMapping fm = (FieldMapping) fmd;
+        String eagerFetchMode = attrs.getValue("eager-fetch-mode");
+        if (!StringUtils.isEmpty(eagerFetchMode)) {
+            if (eagerFetchMode.equalsIgnoreCase("NONE")) {
+                fm.setEagerFetchMode(EagerFetchModes.EAGER_NONE);
+            } else if (eagerFetchMode.equalsIgnoreCase("JOIN")) {
+                fm.setEagerFetchMode(EagerFetchModes.EAGER_JOIN);
+            } else if (eagerFetchMode.equalsIgnoreCase("PARALLEL")) {
+                fm.setEagerFetchMode(EagerFetchModes.EAGER_PARALLEL);
+            }
+        }
+    }
+
+    @Override
+    protected void parseElementClassCriteriaAttr(FieldMetaData fmd, Attributes attrs)
+        throws SAXException {
+        
+        String elementClassCriteriaString = attrs.getValue("element-class-criteria");
+        if (!StringUtils.isEmpty(elementClassCriteriaString)) {
+            FieldMapping fm = (FieldMapping) fmd;
+            boolean elementClassCriteria = Boolean.parseBoolean(elementClassCriteriaString);
+            fm.getElementMapping().getValueInfo().setUseClassCriteria(elementClassCriteria);
+        }
+    }
+
+    @Override
+    protected void parseStrategy(FieldMetaData fmd, Attributes attrs) {
+        String strategy = attrs.getValue("strategy");
+        if (!StringUtils.isEmpty(strategy)) {
+            ((FieldMapping) fmd).getMappingInfo().setStrategy(strategy);
+        }
+    }
+
+    @Override
+    protected boolean startExtendedClass(String elem, Attributes attrs) 
+            throws SAXException {
+        ClassMapping mapping = (ClassMapping) currentElement();
+        
+        String strategy = attrs.getValue("strategy");
+        if (!StringUtils.isEmpty(strategy))
+            mapping.getMappingInfo().setStrategy(strategy);
+        
+        String versionStrat = attrs.getValue("version-strategy");
+        if (!StringUtils.isEmpty(versionStrat))
+            mapping.getVersion().getMappingInfo().setStrategy(versionStrat);
+        
+        String discrimStrat = attrs.getValue("discriminator-strategy");
+        if (!StringUtils.isEmpty(discrimStrat))
+            mapping.getDiscriminator().getMappingInfo().setStrategy(discrimStrat);
+        
+        String subclassFetchMode = attrs.getValue("subclass-fetch-mode");
+        if (!StringUtils.isEmpty(subclassFetchMode))
+            mapping.setSubclassFetchMode(toEagerFetchModeConstant(subclassFetchMode));
+        
+        return true;
+    }
 }

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/fetchgroups/TestFetchGroupStacksXML.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/fetchgroups/TestFetchGroupStacksXML.java?rev=1207320&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/fetchgroups/TestFetchGroupStacksXML.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/fetchgroups/TestFetchGroupStacksXML.java Mon Nov 28 15:44:58 2011
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.fetchgroups;
+
+public class TestFetchGroupStacksXML extends TestFetchGroupStacks {
+    public void setUp() {
+        super.setUp();
+    }
+    
+    protected String getPersistenceUnitName() {
+        return "fetch-groups-xml";
+    }
+}

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

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMultiColumnVersionXML.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMultiColumnVersionXML.java?rev=1207320&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMultiColumnVersionXML.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/annotations/TestMultiColumnVersionXML.java Mon Nov 28 15:44:58 2011
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.jdbc.annotations;
+
+public class TestMultiColumnVersionXML extends TestMultiColumnVersion {
+    public void setUp() {
+        super.setUp();
+    }
+    
+    protected String getPersistenceUnitName() {
+        return "version-columns-xml";
+    }
+}

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

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestUpdateSingleValuedAssociationXML.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestUpdateSingleValuedAssociationXML.java?rev=1207320&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestUpdateSingleValuedAssociationXML.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestUpdateSingleValuedAssociationXML.java Mon Nov 28 15:44:58 2011
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.jdbc.query;
+
+public class TestUpdateSingleValuedAssociationXML extends
+    TestUpdateSingleValuedAssociation {
+    
+    public void setUp() throws Exception {
+        super.setUp();
+    }
+    
+    protected String getPersistenceUnitName() {
+        return "foreign-key-xml";
+    }
+}

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

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/xml/TestNonstandardMappingXML.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/xml/TestNonstandardMappingXML.java?rev=1207320&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/xml/TestNonstandardMappingXML.java (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/xml/TestNonstandardMappingXML.java Mon Nov 28 15:44:58 2011
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.persistence.jdbc.xml;
+
+import org.apache.openjpa.persistence.jdbc.annotations.TestNonstandardMappingAnnotations;
+
+public class TestNonstandardMappingXML extends
+    TestNonstandardMappingAnnotations {
+
+    public void setUp() {
+        super.setUp();
+    }
+    
+    @Override
+    protected String getPersistenceUnitName() {
+        return "nonstandard-mapping-xml";
+    }
+}

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

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest4.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest4.java?rev=1207320&r1=1207319&r2=1207320&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest4.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest4.java Mon Nov 28 15:44:58 2011
@@ -23,8 +23,10 @@ import java.util.Collection;
 import javax.persistence.CascadeType;
 import javax.persistence.Entity;
 import javax.persistence.OneToMany;
+import javax.persistence.Table;
 
 @Entity
+@Table(name="RuntimeTest4k")
 public class RuntimeTest4 {
 
     private String name;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest5.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest5.java?rev=1207320&r1=1207319&r2=1207320&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest5.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/RuntimeTest5.java Mon Nov 28 15:44:58 2011
@@ -19,8 +19,10 @@
 package org.apache.openjpa.persistence.kernel.common.apps;
 
 import javax.persistence.Entity;
+import javax.persistence.Table;
 
 @Entity
+@Table(name="RuntimeTest5k")
 public class RuntimeTest5 {
 
     private String name;

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/fetch-groups-orm.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/fetch-groups-orm.xml?rev=1207320&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/fetch-groups-orm.xml (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/fetch-groups-orm.xml Mon Nov 28 15:44:58 2011
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.   
+-->
+<entity-mappings xmlns="http://www.apache.org/openjpa/ns/orm/extendable" 
+	xmlns:openjpa="http://www.apache.org/openjpa/ns/orm" 
+	xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	version="2.0">
+
+	<openjpa:openjpa-version version="1.0"/>
+	
+	<entity class="org.apache.openjpa.persistence.fetchgroups.FGEmployee">
+		<inheritance strategy="SINGLE_TABLE"/>
+		<discriminator-value>0</discriminator-value>
+		<discriminator-column name="EMP_TYPE" discriminator-type="INTEGER"/>
+		<openjpa:entity>
+			<openjpa:fetch-groups>
+				<openjpa:fetch-group name="AddressFetchGroup">
+					<openjpa:fetch-attribute name="address"/>
+				</openjpa:fetch-group>
+				<openjpa:fetch-group name="RatingFetchGroup">
+					<openjpa:fetch-attribute name="rating"/>
+				</openjpa:fetch-group>
+				<openjpa:fetch-group name="ManagerFetchGroup1A">
+					<openjpa:fetch-attribute name="manager"/>
+				</openjpa:fetch-group>
+				<openjpa:fetch-group name="ManagerFetchGroup1B">
+					<openjpa:fetch-attribute name="manager"/>
+				</openjpa:fetch-group>
+				<openjpa:fetch-group name="ManagerFetchGroup2">
+					<openjpa:fetch-attribute name="manager"/>
+				</openjpa:fetch-group>
+				<openjpa:fetch-group name="DescFetchGroup">
+					<openjpa:fetch-attribute name="description"/>
+				</openjpa:fetch-group>
+				<openjpa:fetch-group name="DepartmentFetchGroup">
+					<openjpa:fetch-attribute name="dept"/>
+				</openjpa:fetch-group>
+				<openjpa:fetch-group name="AggregateEmployeeFetchGroup1">
+					<openjpa:fetch-attribute name="dept"/>
+					<openjpa:fetch-attribute name="address"/>
+					<openjpa:fetch-attribute name="manager" recursion-depth="1"/>
+				</openjpa:fetch-group>
+				<openjpa:fetch-group name="AggregateEmployeeFetchGroup1">
+					<openjpa:referenced-fetch-group>DepartmentFetchGroup</openjpa:referenced-fetch-group>
+				</openjpa:fetch-group>
+				<openjpa:fetch-group name="AggregateEmployeeFetchGroup3">
+					<openjpa:referenced-fetch-group>DepartmentFetchGroup</openjpa:referenced-fetch-group>
+					<openjpa:referenced-fetch-group>AddressFetchGroup</openjpa:referenced-fetch-group>
+					<openjpa:referenced-fetch-group>ManagerFetchGroup1A</openjpa:referenced-fetch-group>
+				</openjpa:fetch-group>
+				<openjpa:fetch-group name="AggregateEmployeeFetchGroup4">
+					<openjpa:fetch-attribute name="dept"/>
+					<openjpa:fetch-attribute name="address"/>
+					<openjpa:referenced-fetch-group>ManagerFetchGroup1A</openjpa:referenced-fetch-group>
+				</openjpa:fetch-group>
+			</openjpa:fetch-groups>
+		</openjpa:entity>
+	</entity>
+	<entity class="org.apache.openjpa.persistence.fetchgroups.FGManager">
+		<attributes>
+			<basic name="rating" fetch="LAZY">
+				<openjpa:basic load-fetch-group="AddressFetchGroup"/>
+			</basic>
+		</attributes>
+		<openjpa:entity>
+			<openjpa:fetch-groups>
+				<openjpa:fetch-group name="MDataFetchGroup">
+					<openjpa:fetch-attribute name="mData"/>
+				</openjpa:fetch-group>
+				<openjpa:fetch-group name="EmployeesFetchGroup">
+					<openjpa:fetch-attribute name="employees"/>
+				</openjpa:fetch-group>
+			</openjpa:fetch-groups>
+		</openjpa:entity>
+	</entity>
+	
+</entity-mappings>
\ No newline at end of file

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/fetch-groups-orm.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/foreign-key-orm.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/foreign-key-orm.xml?rev=1207320&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/foreign-key-orm.xml (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/foreign-key-orm.xml Mon Nov 28 15:44:58 2011
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.   
+-->
+<entity-mappings xmlns="http://www.apache.org/openjpa/ns/orm/extendable" 
+	xmlns:openjpa="http://www.apache.org/openjpa/ns/orm" 
+	xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	version="2.0">
+
+	<openjpa:openjpa-version version="1.0"/>
+	
+	<entity class="org.apache.openjpa.persistence.jdbc.query.domain.Application">
+		<attributes>
+			<many-to-one name="user">
+				<orm:join-column nullable="true"/>
+				<openjpa:many-to-one>
+					<openjpa:foreign-key  delete-action="NULL"/>
+				</openjpa:many-to-one>
+			</many-to-one>
+		</attributes>
+	</entity>
+	
+</entity-mappings>
\ No newline at end of file

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/foreign-key-orm.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/nonstandard-orm.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/nonstandard-orm.xml?rev=1207320&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/nonstandard-orm.xml (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/nonstandard-orm.xml Mon Nov 28 15:44:58 2011
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.   
+-->
+<entity-mappings xmlns="http://www.apache.org/openjpa/ns/orm/extendable" 
+	xmlns:openjpa="http://www.apache.org/openjpa/ns/orm" 
+	xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	version="2.0">
+	
+	<openjpa:openjpa-version version="1.0"/>
+	
+	<entity class="org.apache.openjpa.persistence.jdbc.annotations.ExtensionsEntity"
+		metadata-complete="true">
+		<table name="ExtensionsEntityXML"/>
+		<attributes>
+			<basic name="uuid">
+				<orm:column name="UUID_HEX"></orm:column>
+				<openjpa:basic>
+					<openjpa:generated-value generator="uuid-hex"/>
+				</openjpa:basic>
+			</basic>
+			<basic name="uuidString">
+				<orm:column name="UUID_STRING"></orm:column>
+				<openjpa:basic>
+					<openjpa:generated-value generator="uuid-string"/>
+				</openjpa:basic>
+			</basic>
+			<basic name="uuidT4Hex">
+				<orm:column name="UUIDT4_HEX"></orm:column>
+				<openjpa:basic>
+					<openjpa:generated-value generator="uuid-type4-hex"/>
+				</openjpa:basic>
+			</basic>
+			<basic name="uuidT4String">
+				<orm:column name="UUIDT4_STRING"></orm:column>
+				<openjpa:basic>
+					<openjpa:generated-value generator="uuid-type4-string"/>
+				</openjpa:basic>
+			</basic>
+			<basic name="seq" fetch="LAZY">
+				<openjpa:basic>
+					<openjpa:read-only/>
+					<openjpa:generated-value strategy="SEQUENCE" generator="system"/>
+				</openjpa:basic>
+			</basic>
+			<basic name="externalValues">
+				<openjpa:basic type="int.class">
+					<openjpa:external-values>
+						<openjpa:external-value java-value="M" datastore-value="1"/>
+						<openjpa:external-value java-value="F" datastore-value="2"/>
+					</openjpa:external-values>
+				</openjpa:basic>
+			</basic>
+			<many-to-one name="rel" fetch="LAZY">
+				<orm:join-column name="REL_ID" referenced-column-name="ID"/>
+				<openjpa:many-to-one dependent="false" inverse-logical="owner"/>
+			</many-to-one>
+			<many-to-one name="owner">
+				<orm:join-column name="OWNER_ID" referenced-column-name="ID"/>
+			</many-to-one>
+			<many-to-many name="lrs">
+				<openjpa:many-to-many lrs="true"/>
+			</many-to-many>
+			<many-to-many name="eager">
+				<openjpa:many-to-many 
+					eager-fetch-mode="JOIN"
+					element-dependent="true"
+					element-class-criteria="true"/>
+			</many-to-many>
+			<openjpa:attributes>
+				<openjpa:persistent name="externalizer"
+					externalizer="getName"
+					factory="Class.forName"/>
+			</openjpa:attributes>
+		</attributes>
+		<openjpa:entity version-strategy="state-comparison">
+			<openjpa:fetch-group name="detail">
+				<openjpa:fetch-attribute name="rel" recursion-depth="-1"/>
+				<openjpa:fetch-attribute name="seq"/>
+			</openjpa:fetch-group>
+			<openjpa:data-cache enabled="false"/>
+			<openjpa:data-store-id strategy="SEQUENCE" generator="system"/>
+		</openjpa:entity>
+	</entity>
+	<entity class="org.apache.openjpa.persistence.jdbc.annotations.NonstandardMappingEntity">
+		<table name="NONSTD_ENTITY"/>
+		<discriminator-column name="DISCRIM" length="128"/>
+		<attributes>
+			<openjpa:attributes>
+				<openjpa:persistent name="custom"
+					strategy="org.apache.openjpa.persistence.jdbc.annotations.PointHandler">
+					<openjpa:columns>
+						<openjpa:column name="X_COL"/>
+						<openjpa:column name="Y_COL"/>
+					</openjpa:columns>
+					<openjpa:index name="PNT_IDX"/>
+				</openjpa:persistent>
+			</openjpa:attributes>
+		</attributes>
+		<openjpa:entity discriminator-strategy="class-name">
+			<openjpa:data-store-id-column name="OID"/>
+		</openjpa:entity>
+		
+	</entity>
+	
+</entity-mappings>

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/nonstandard-orm.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml?rev=1207320&r1=1207319&r2=1207320&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/persistence.xml Mon Nov 28 15:44:58 2011
@@ -392,4 +392,41 @@
 			<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" />
 		</properties>
 	</persistence-unit>
+	
+	<persistence-unit name="nonstandard-mapping-xml">
+        <mapping-file>META-INF/nonstandard-orm.xml</mapping-file>
+        
+        <properties>
+            <property name="openjpa.jdbc.SynchronizeMappings"
+                  value="buildSchema(ForeignKeys=true)"/>
+        </properties>
+    </persistence-unit>
+    
+    <persistence-unit name="fetch-groups-xml">
+        <mapping-file>META-INF/fetch-groups-orm.xml</mapping-file>
+        
+        <properties>
+            <property name="openjpa.jdbc.SynchronizeMappings"
+                  value="buildSchema(ForeignKeys=true)"/>
+        </properties>
+    </persistence-unit>
+    
+    <persistence-unit name="foreign-key-xml">
+        <mapping-file>META-INF/foreign-key-orm.xml</mapping-file>
+        
+        <properties>
+            <property name="openjpa.jdbc.SynchronizeMappings"
+                  value="buildSchema(ForeignKeys=true)"/>
+        </properties>
+    </persistence-unit>
+    
+    <persistence-unit name="version-columns-xml">
+        <mapping-file>META-INF/version-columns-orm.xml</mapping-file>
+        
+        <properties>
+            <property name="openjpa.jdbc.SynchronizeMappings"
+                  value="buildSchema(ForeignKeys=true)"/>
+        </properties>
+    </persistence-unit>
+
 </persistence>

Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/version-columns-orm.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/version-columns-orm.xml?rev=1207320&view=auto
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/version-columns-orm.xml (added)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/version-columns-orm.xml Mon Nov 28 15:44:58 2011
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.   
+-->
+<entity-mappings xmlns="http://www.apache.org/openjpa/ns/orm/extendable" 
+	xmlns:openjpa="http://www.apache.org/openjpa/ns/orm" 
+	xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	version="2.0">
+
+	<openjpa:openjpa-version version="1.0"/>
+	
+	<entity class="org.apache.openjpa.persistence.jdbc.annotations.MultiColumnVersionPC"
+		metadata-complete="true">
+		<table name="MCV"/>
+		<attributes>
+			<id name="id">
+				<orm:generated-value/>
+			</id>
+			<basic name="id"/>
+			<basic name="name"/>
+		</attributes>
+		<openjpa:entity version-strategy="version-numbers">
+			<openjpa:version-columns>
+				<openjpa:version-column name="v1"/>
+				<openjpa:version-column name="v2"/>
+				<openjpa:version-column name="v3"
+					column-definition="FLOAT"
+					scale="3"
+					precision="10"/>
+			</openjpa:version-columns>	
+		</openjpa:entity>
+	</entity>
+	<entity class="org.apache.openjpa.persistence.jdbc.annotations.MultiColumnSecondaryVersionPC"
+		metadata-complete="true">
+		<table name="MCSV"/>
+		<secondary-table name="MCSV1">
+			<orm:primary-key-join-column name="ID"/>
+		</secondary-table>
+		<secondary-table name="MCSV2">
+			<orm:primary-key-join-column name="ID"/>
+		</secondary-table>
+		<attributes>
+			<id name="id">
+				<orm:generated-value/>
+			</id>
+			<basic name="name"/>
+			<basic name="s1">
+				<orm:column table="MCSV1"/>
+			</basic>
+			<basic name="s2">
+				<orm:column table="MCSV2"/>
+			</basic>
+		</attributes>
+		<openjpa:entity version-strategy="version-numbers">
+			<openjpa:version-columns>
+				<openjpa:version-column name="v11" table="MCSV1"/>
+				<openjpa:version-column name="v12" table="MCSV1"/>
+				<openjpa:version-column name="v21" table="MCSV2"/>
+				<openjpa:version-column name="v01"/>
+			</openjpa:version-columns>
+		</openjpa:entity>
+	</entity>
+	
+</entity-mappings>
\ No newline at end of file

Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/META-INF/version-columns-orm.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java?rev=1207320&r1=1207319&r2=1207320&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java Mon Nov 28 15:44:58 2011
@@ -815,24 +815,29 @@ public class AnnotationPersistenceMetaDa
      * Parse @DataStoreId.
      */
     private void parseDataStoreId(ClassMetaData meta, DataStoreId id) {
+        parseDataStoreId(meta, id.strategy(), id.generator());
+    }
+    
+    static void parseDataStoreId(ClassMetaData meta, GenerationType strategy, 
+        String generator) {
         meta.setIdentityType(ClassMetaData.ID_DATASTORE);
 
-        int strat = getGeneratedValueStrategy(meta, id.strategy(),
-            id.generator());
+        int strat = getGeneratedValueStrategy(meta, strategy,
+            generator);
         if (strat != -1)
             meta.setIdentityStrategy(strat);
         else {
-            switch (id.strategy()) {
+            switch (strategy) {
                 case TABLE:
                 case SEQUENCE:
                     // technically we should have separate system table and
                     // sequence generators, but it's easier to just rely on
                     // the system org.apache.openjpa.Sequence setting for both
-                    if (StringUtils.isEmpty(id.generator()))
+                    if (StringUtils.isEmpty(generator))
                         meta.setIdentitySequenceName(
                             SequenceMetaData.NAME_SYSTEM);
                     else
-                        meta.setIdentitySequenceName(id.generator());
+                        meta.setIdentitySequenceName(generator);
                     break;
                 case AUTO:
                     meta.setIdentityStrategy(ValueStrategies.NATIVE);
@@ -841,11 +846,11 @@ public class AnnotationPersistenceMetaDa
                     meta.setIdentityStrategy(ValueStrategies.AUTOASSIGN);
                     break;
                 default:
-                    throw new UnsupportedException(id.strategy().toString());
+                    throw new UnsupportedException(strategy.toString());
             }
         }
     }
-
+    
     /**
      * Warn that @FlushMode is not supported.
      */
@@ -859,14 +864,21 @@ public class AnnotationPersistenceMetaDa
      * 
      */
     private void parseDataCache(ClassMetaData meta, DataCache cache) {
-        if (cache.timeout() != Integer.MIN_VALUE) {
-            meta.setDataCacheTimeout(cache.timeout());
+        parseDataCache(meta, cache.enabled(), cache.name(), cache.timeout());
+    }
+    
+    static void parseDataCache(ClassMetaData meta,
+            boolean enabled,
+            String name,
+            int timeout) {
+        if (timeout != Integer.MIN_VALUE) {
+            meta.setDataCacheTimeout(timeout);
         }
-        String cacheName = cache.name();
+        String cacheName = name;
         if (StringUtils.isEmpty(cacheName)) {
             cacheName = org.apache.openjpa.datacache.DataCache.NAME_DEFAULT;
         }
-        meta.setDataCacheName(cache.enabled() ? cacheName : null);
+        meta.setDataCacheName(enabled ? cacheName : null);
     }
 
     private void parseManagedInterface(ClassMetaData meta,
@@ -1033,48 +1045,78 @@ public class AnnotationPersistenceMetaDa
      * fetch group A which explicitly includes f to its custom fetch groups but
      * also will also add any fetch group B that includes A.
      */
-    private void parseFetchGroups(ClassMetaData meta, FetchGroup... groups) {
-        org.apache.openjpa.meta.FetchGroup fg;
-        for (FetchGroup group : groups) {
-            if (StringUtils.isEmpty(group.name()))
-                throw new MetaDataException(_loc.get("unnamed-fg", meta));
-
-            fg = meta.addDeclaredFetchGroup(group.name());
-            if (group.postLoad())
-                fg.setPostLoad(true);
-            for (String s : group.fetchGroups()) {
-                fg.addDeclaredInclude(s);
-            }
-        }
-        // Add the parent-child style bi-links between fetch groups in a
-        // separate pass.
-        for (FetchGroup group:groups) {
-        	fg = meta.getFetchGroup(group.name());
-        	String[] includedFetchGropNames = fg.getDeclaredIncludes();
-        	for (String includedFectchGroupName:includedFetchGropNames) {
-        		org.apache.openjpa.meta.FetchGroup child =
-        	    meta.getFetchGroup(includedFectchGroupName);
-        		if (child == null)
-                    throw new UserException(_loc.get("missing-included-fg",
-                            meta.getDescribedType().getName(), fg.getName(),
-                            includedFectchGroupName));
-        		child.addContainedBy(fg);
-        	}
-        }
-
-        for (FetchGroup group : groups) {
-            fg = meta.getFetchGroup(group.name());
-            for (FetchAttribute attr : group.attributes())
-                parseFetchAttribute(meta, fg, attr);
-        }
-    }
+    static void parseFetchGroups(ClassMetaData meta, FetchGroup... groups) {
+       FetchGroupImpl[] fetchGroupImpls = new FetchGroupImpl[groups.length];
+       for (int i = 0; i < groups.length; i++) {
+           FetchAttribute[] fetchAttributes = groups[i].attributes();
+           FetchAttributeImpl[] fetchAttributeImpls= null;
+           if (fetchAttributes != null && fetchAttributes.length > 0) {
+               fetchAttributeImpls = new FetchAttributeImpl[fetchAttributes.length];
+               for (int j = 0; j < fetchAttributes.length; j++) {
+                   fetchAttributeImpls[j] = 
+                           new FetchAttributeImpl(fetchAttributes[j].name(), fetchAttributes[j].recursionDepth()); 
+               }
+           }
+           fetchGroupImpls[i] = new FetchGroupImpl(groups[i].name(), groups[i].postLoad());
+           if (fetchAttributeImpls != null) {
+               fetchGroupImpls[i].setAttributes(fetchAttributeImpls);
+           }
+           if (groups[i].fetchGroups() != null) {
+               fetchGroupImpls[i].setFetchGroups(groups[i].fetchGroups());
+           }
+       }
+       
+       parseFetchGroups(meta, fetchGroupImpls);
+    }
+   
+   /**
+    * Parse fetch group input for the FetchGroup and FetchGroups annotations
+    * as well as for the fetch-group and fetch-groups XML metadata
+    * @param meta
+    * @param groups
+    */
+   static void parseFetchGroups(ClassMetaData meta, FetchGroupImpl... groups) {
+       org.apache.openjpa.meta.FetchGroup fg;
+       for (FetchGroupImpl group : groups) {
+           if (StringUtils.isEmpty(group.name()))
+               throw new MetaDataException(_loc.get("unnamed-fg", meta));
+
+           fg = meta.addDeclaredFetchGroup(group.name());
+           if (group.postLoad())
+               fg.setPostLoad(true);
+           for (String s : group.fetchGroups()) {
+               fg.addDeclaredInclude(s);
+           }
+       }
+       // Add the parent-child style bi-links between fetch groups in a
+       // separate pass.
+       for (FetchGroupImpl group:groups) {
+           fg = meta.getFetchGroup(group.name());
+           String[] includedFetchGropNames = fg.getDeclaredIncludes();
+           for (String includedFectchGroupName:includedFetchGropNames) {
+               org.apache.openjpa.meta.FetchGroup child =
+               meta.getFetchGroup(includedFectchGroupName);
+               if (child == null)
+                   throw new UserException(_loc.get("missing-included-fg",
+                           meta.getDescribedType().getName(), fg.getName(),
+                           includedFectchGroupName));
+               child.addContainedBy(fg);
+           }
+       }
+
+       for (FetchGroupImpl group : groups) {
+           fg = meta.getFetchGroup(group.name());
+           for (FetchAttributeImpl attr : group.attributes())
+               parseFetchAttribute(meta, fg, attr);
+       }
+   }
 
 
     /**
      * Set a field's fetch group.
      */
-    private void parseFetchAttribute(ClassMetaData meta,
-        org.apache.openjpa.meta.FetchGroup fg, FetchAttribute attr) {
+    private static void parseFetchAttribute(ClassMetaData meta,
+        org.apache.openjpa.meta.FetchGroup fg, FetchAttributeImpl attr) {
         FieldMetaData field = meta.getDeclaredField(attr.name());
         if (field == null
             || field.getManagement() != FieldMetaData.MANAGE_PERSISTENT)
@@ -1983,6 +2025,74 @@ public class AnnotationPersistenceMetaDa
 			return compare;
 		}
 	}
+    
+    /**
+     * An internal class used to mimic the FetchGroup annotation.
+     * This is needed to process the fetch-group element in xml
+     * metadata with common code for the annotation.
+     */
+    static class FetchGroupImpl {
+        private String name = "";
+        private boolean postLoad = false;
+        private FetchAttributeImpl[] attributes = {};
+        private String[] fetchGroups = {};
+        
+        FetchGroupImpl(String name, boolean postLoad)
+        {
+            this.name = name;
+            this.postLoad = postLoad;
+        }
+
+        public String name() {
+            return name;
+        }
+
+        public boolean postLoad() {
+            return postLoad;
+        }
+
+        public FetchAttributeImpl[] attributes() {
+            return attributes;
+        }
+
+        public String[] fetchGroups() {
+            return fetchGroups;
+        }
+
+
+        public void setAttributes(FetchAttributeImpl[] attributes) {
+            this.attributes = attributes;
+        }
+
+        public void setFetchGroups(String[] fetchGroups) {
+            this.fetchGroups = fetchGroups;
+        }
+    }
+    
+    /**
+     * An internal class used to mimic the FetchAttribute annotation.
+     * This is needed to process the fetch-attribute element in xml
+     * metadata with common code for the annotation.
+     */
+    static class FetchAttributeImpl {
+        private String name = "";
+        private int recursionDepth = Integer.MIN_VALUE;
+        
+        public FetchAttributeImpl(String name, int recursionDepth) {
+            this.name = name;
+            this.recursionDepth = recursionDepth;
+        }
+        
+        public String name() {
+            return name;
+        }
+
+        public int recursionDepth() {
+            return recursionDepth;
+        }
+
+        
+    }
 
     protected String normalizeSequenceName(String seqName) {
         return seqName;

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java?rev=1207320&r1=1207319&r2=1207320&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java Mon Nov 28 15:44:58 2011
@@ -73,10 +73,13 @@ public enum MetaDataTag {
     ELEM_DEPENDENT,
     ELEM_TYPE,
     EXTERNAL_VALS,
+    EXTERNAL_VAL,
     EXTERNALIZER,
     FACTORY,
     FETCH_GROUP,
     FETCH_GROUPS,
+    FETCH_ATTRIBUTE,
+    REFERENCED_FETCH_GROUP,
     INVERSE_LOGICAL,
     KEY_DEPENDENT,
     KEY_TYPE,
@@ -85,5 +88,6 @@ public enum MetaDataTag {
     MANAGED_INTERFACE,
     READ_ONLY,
     TYPE,
-    REPLICATED
+    REPLICATED,
+    OPENJPA_VERSION
 }



Mime
View raw message