Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
V2 2.0.12
-
None
-
None
Description
The JPA Processor Core crashes with a null pointer exception when an Entity with the following conditions is parsed:
- The Entity has multiple Id columns (composite key)
- This leads to the case that the JPAEdmEntityType.getIdType() returns null.
- The Entity also has at least one Embedded attribute class
- This leads to the following coding in org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmProperty.build
if (isBuildModeComplexType == false && entityTypeView.getJPAEntityType().getIdType().getJavaType().equals(currentAttribute.getJavaType())) {
As getIdType() returns null this inevitably leads to a NullPointerException.
Workaround:
By using a JPAEDMMappingModel we can ignore any Embedded attributes in our Entities.
This currently works for us, as we do not need to share these properties in OData, but it is not a permanent solution.
Note:
We do not quite understand why getIdType returns null - but we also cannot find any other place where it is used. It is possible that the composite key is not relevant, and instead getIdType does not work as expected.