Show TOC

Enabling JPA Models as OData ServicesLocate this document in the navigation structure

Enabling JPA models as OData services using Integration Gateway.

Context

Integration Gateway allows you to expose OData services by using JPA models as input that is already in sync with the underlying database. Use OData Modeler to define an OData model which should match the JPA model properties. The OData JPA processor fetches data at runtime.For details of the tasks performed using OData Modeler, see the OData Modeler Documentation on https://help.hana.ondemand.comInformation published on SAP site.

Integration Gateway provides Custom Processors, a plug-in mechanism to provide your own logic on top of the output generated by the API toolkit for SAP Mobile Platform to enhance / modify the content. See Defining Custom Code on https://help.hana.ondemand.comInformation published on SAP site. The relevant content is located in Start of the navigation path API toolkit for SAP Mobile Platform Documentation Next navigation step  Binding Data Sources Next navigation step  Defining Custom Code End of the navigation path.

OData Feature Status
Create Supported
Read Supported
Update Supported
Delete Supported
Query Supported
Navigation Supported
Delta token Supported (via custom processor)
Tombstones Supported (via custom processor)
System query options: $orderby, $skip, $top, $select, $inlinecount, $filter.
Note For JPA, when querying $select you should include the key property in the request URL along with the other property on which the query is based.
Supported
$count Supported
Complex types Supported
$expand and $format Not supported
Deep insert Not supported
Custom query options Not supported
$batch Not supported
Function imports Not supported
$link Not supported
$value Not supported
$filter Details
String functions
  • Supported:
    • bool substringof(string po, string p1)
    • string substring(string p0, int pos)
    • string substring(string p0, int pos, int length)
    • string tolower(string p0)
  • Not supported:
    • string trim(string p0)
    • string concat(string p0, string p1)
    • int length(string p0)
    • int indexof(string p0, string p1)
    • string replace(string p0, string find, string replace)
    • bool endswith(string p0, string p1)
    • bool startswith(string p0, string p1)
    • string toupper(string p0)
Partially supported
Logical operators - all the logical operators are supported except for 'Not'. Partially supported
Date functions Not supported
Math functions Not supported
Arithmetic operators Not supported
Type functions Not supported
Note The JPA model must be active on the SAP Mobile Platform Server. The JPA JAR must be packaged as a P2 feature in a P2 update site and enabled as a custom feature on the server. For more information on enabling custom features on the SAP Mobile Platform server, see Start of the navigation path SAP Mobile Platform 3.0 Next navigation step  SAP Mobile Platform Server Next navigation step  Administrator Next navigation step  Server Administration Next navigation step  Managing SAP Mobile Platform Server Features End of the navigation path.

Procedure

  1. Use API toolkit for SAP Mobile Platform to register the service:

    For details of the tasks performed in this step, see API toolkit for SAP Mobile Platform Documentation on https://help.hana.ondemand.comInformation published on SAP site. The relevant topic to refer to is provided in the corresponding sub steps below.

    1. Create an OData implementation project. See Creating an OData Implementation Project.
    2. Select the JPA datasource to bind with an entity set. See Selecting a Datasource.
    3. Use the Custom Processor plug-in to define your own logic. See Defining Custom Code.
    4. You can generate integration content or generate and deploy it. See Generating and Deploying Service Implementation Project.
  2. Log in to Gateway Management Cockpit. If you chose:
    1. Generate Integration Content, deploy the content bundle. See Deploying a Custom Service from Gateway Management Cockpit for more information.
    2. Generate and Deploy Integration Content, you should see the registered service in the Registered Services screen.
  3. Assign an existing destination to the service or entity sets. See Assigning and Removing OData Service Destinations. Otherwise, create a new destination, see Creating a Destination on Gateway Management Cockpit and then assign it.