You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by GitBox <gi...@apache.org> on 2021/11/23 11:04:09 UTC

[GitHub] [openjpa] solomax commented on a change in pull request #89: [OPENJPA-2881] orm* schemas are available offline

solomax commented on a change in pull request #89:
URL: https://github.com/apache/openjpa/pull/89#discussion_r755015601



##########
File path: openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java
##########
@@ -575,17 +577,25 @@ protected Object getSchemaSource() {
         boolean useExtendedSchema = true;
         // if the version and/or schema location is for 1.0, use the 1.0
         // schema
-        if (_ormVersion != null &&
-            _ormVersion.equals(XMLVersionParser.VERSION_1_0) ||
-            (_schemaLocation != null &&
-            _schemaLocation.indexOf(ORM_XSD_1_0) != -1)) {
+        if (XMLVersionParser.VERSION_1_0.equals(_ormVersion)
+                || (_schemaLocation != null && _schemaLocation.indexOf(ORM_XSD_1_0) > -1)) {
             ormxsd = "orm-xsd.rsrc";
             useExtendedSchema = false;
+        } else if (XMLVersionParser.VERSION_2_0.equals(_ormVersion)
+                || (_schemaLocation != null && _schemaLocation.indexOf(ORM_XSD_2_0) > -1)) {
+            ormxsd = "orm_2_0-xsd.rsrc";
+        } else if (XMLVersionParser.VERSION_2_1.equals(_ormVersion)
+                || (_schemaLocation != null && _schemaLocation.indexOf(ORM_XSD_2_1) > -1)) {
+            ormxsd = "orm_2_1.xsd.rsrc";
+            useExtendedSchema = false;

Review comment:
       @rmannibucau IMO the main PRO is to be able to work completely offline
   I have no idea how to write test like this :(




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@openjpa.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org