-
Notifications
You must be signed in to change notification settings - Fork 83
Description
To get a description of Entities or Properties in the form of (xml)
<Annotation Term="Core.Description" String="Description Test"/>
we use the solution of the second step posted in #37 (comment), by creating an extension of JPAEdmMetadataPostProcessor overriding method provideReferences:
String uri = "http://docs.oasisopen.org/odata/odata/v4.0/os/vocabularies/Org.OData.Core.V1.xml";
IntermediateReferenceAccess reference = references.addReference(uri, "annotations/Org.OData.Core.V1.xml");
reference.addInclude("Org.OData.Core.V1", "Core");
However, in Spring Boot this fails with the error
nested exception is com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException: Parsing of 'annotations/Org.OData.Core.V1.xml' failed with message 'file:/app.jar!/BOOT-INF/classes!/annotations/Org.OData.Core.V1.xml (No such file or directory)'.
Reason for this is that the method loadXML in class CsdlDocumentReader uses this.getClass().getClassLoader().getResource(path) instead of this.getClass().getClassLoader().getResourceAsStream(path).