Class JPAConversionHelper
java.lang.Object
com.sap.olingo.jpa.processor.core.modify.JPAConversionHelper
Helper method for modifying requests.
Mainly created to increase testability
- Author:
- Oliver Grande
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildGetterMap(Object instance)Creates a map of attribute name and the return value of there getter method.org.apache.olingo.commons.api.data.EntityconvertInputStream(org.apache.olingo.server.api.OData odata, org.apache.olingo.server.api.ODataRequest request, org.apache.olingo.commons.api.format.ContentType requestFormat, List<org.apache.olingo.server.api.uri.UriResource> uriResourceParts)Converts the payload of a request into the corresponding odata entityconvertKeyToLocal(org.apache.olingo.server.api.OData odata, org.apache.olingo.server.api.ODataRequest request, org.apache.olingo.commons.api.edm.EdmEntitySet edmEntitySet, com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEntityType et, Object newPOJO)static ObjectconvertParameter(org.apache.olingo.commons.api.data.Parameter param, com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAServiceDocument sd)convertProperties(org.apache.olingo.server.api.OData odata, com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAStructuredType st, List<org.apache.olingo.commons.api.data.Property> odataProperties)Creates nested map of attributes and there (new) values.convertUriKeys(org.apache.olingo.server.api.OData odata, com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAStructuredType st, List<org.apache.olingo.server.api.uri.UriParameter> keyPredicates)determineGetter(Object instance)LikebuildGetterMap(java.lang.Object), but without buffer<S, T> ObjectprocessAttributeConverter(Object value, com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAttribute attribute)
-
Constructor Details
-
JPAConversionHelper
public JPAConversionHelper()
-
-
Method Details
-
convertParameter
public static Object convertParameter(org.apache.olingo.commons.api.data.Parameter param, com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAServiceDocument sd) throws com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException- Throws:
com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException
-
buildGetterMap
Creates a map of attribute name and the return value of there getter method.It is assumed that the method name is composed from get> and the name of the attribute and that the attribute name starts with a lower case letter.
- Parameters:
instance-- Returns:
- Throws:
ODataJPAProcessorException
-
convertInputStream
public org.apache.olingo.commons.api.data.Entity convertInputStream(org.apache.olingo.server.api.OData odata, org.apache.olingo.server.api.ODataRequest request, org.apache.olingo.commons.api.format.ContentType requestFormat, List<org.apache.olingo.server.api.uri.UriResource> uriResourceParts) throws ODataJPAProcessorExceptionConverts the payload of a request into the corresponding odata entity- Parameters:
odata-request-requestFormat-uriResourceParts-- Returns:
- Throws:
ODataJPAProcessorException
-
convertKeyToLocal
public String convertKeyToLocal(org.apache.olingo.server.api.OData odata, org.apache.olingo.server.api.ODataRequest request, org.apache.olingo.commons.api.edm.EdmEntitySet edmEntitySet, com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEntityType et, Object newPOJO) throws org.apache.olingo.server.api.serializer.SerializerException, ODataJPAProcessorException- Parameters:
odata-request-edmEntitySet-et-newPOJO-- Returns:
- Throws:
org.apache.olingo.server.api.serializer.SerializerExceptionODataJPAProcessorException
-
convertProperties
public Map<String,Object> convertProperties(org.apache.olingo.server.api.OData odata, com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAStructuredType st, List<org.apache.olingo.commons.api.data.Property> odataProperties) throws ODataJPAProcessExceptionCreates nested map of attributes and there (new) values. Primitive values are instances of e.g. Integer. Embedded Types are returned as maps.- Parameters:
odata-st-odataProperties-- Returns:
- Throws:
ODataJPAProcessException
-
convertUriKeys
public Map<String,Object> convertUriKeys(org.apache.olingo.server.api.OData odata, com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAStructuredType st, List<org.apache.olingo.server.api.uri.UriParameter> keyPredicates) throws ODataJPAFilterException, ODataJPAProcessorException- Parameters:
keyPredicates-- Returns:
- Throws:
ODataJPAFilterExceptionODataJPAProcessorException
-
determineGetter
LikebuildGetterMap(java.lang.Object), but without buffer- Parameters:
instance-- Returns:
- Throws:
ODataJPAProcessorException
-
processAttributeConverter
-