[OLINGO-1301] Fix for metadata redefine OLINGO-1301
authormibo <mibo@apache.org>
Mon, 15 Oct 2018 20:04:02 +0000 (22:04 +0200)
committermibo <mibo@apache.org>
Tue, 16 Oct 2018 19:04:41 +0000 (21:04 +0200)
odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmMappingModelService.java

index 846ecbd..69153ec 100644 (file)
@@ -218,8 +218,9 @@ public class JPAEdmMappingModelService implements JPAEdmMappingModelAccess {
     if (mappingModelStream != null) {
       return mappingModelStream;
     }
-    return JPAEdmMappingModelService.class.getClassLoader().getResourceAsStream("../../" + mappingModelName);
-
+    ClassLoader classLoader = JPAEdmMappingModelService.class.getClassLoader();
+    InputStream modelStream = classLoader.getResourceAsStream("../../" + mappingModelName);
+    return (modelStream != null) ? modelStream : classLoader.getResourceAsStream(mappingModelName);
   }
 
   @Override