You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2013/09/30 16:11:08 UTC
svn commit: r1527578 -
/incubator/olingo/site/trunk/content/doc/tutorials/jpafunctionimport.mdtext
Author: sklevenz
Date: Mon Sep 30 14:11:08 2013
New Revision: 1527578
URL: http://svn.apache.org/r1527578
Log:
CMS commit to olingo by sklevenz
Modified:
incubator/olingo/site/trunk/content/doc/tutorials/jpafunctionimport.mdtext
Modified: incubator/olingo/site/trunk/content/doc/tutorials/jpafunctionimport.mdtext
URL: http://svn.apache.org/viewvc/incubator/olingo/site/trunk/content/doc/tutorials/jpafunctionimport.mdtext?rev=1527578&r1=1527577&r2=1527578&view=diff
==============================================================================
--- incubator/olingo/site/trunk/content/doc/tutorials/jpafunctionimport.mdtext (original)
+++ incubator/olingo/site/trunk/content/doc/tutorials/jpafunctionimport.mdtext Mon Sep 30 14:11:08 2013
@@ -31,7 +31,8 @@ This section explains how to enable cust
</dependency>
2. Create a Java class and annotate the Java methods implementing custom operations with Function Import and Parameter Java annotations as shown below. Java methods can be created in JPA entity types and these methods can be annotated with EDM annotations for function import.
-
+
+ :::java
package org.apache.olingo.odata2.jpa.processor.ref.extension;
import java.util.List;
@@ -132,6 +133,7 @@ This section explains how to enable cust
3. Create a Java class by implementing the interface *org.apache.olingo.odata2.processor.api.jpa.model* to register the annotated Java methods.
+ :::java
public class SalesOrderProcessingExtension implements JPAEdmExtension {
@Override
public void extendJPAEdmSchema(final JPAEdmSchemaView arg0 {
@@ -148,6 +150,7 @@ This section explains how to enable cust
4. Register the class created in step 3 with *ODataJPAContext* as shown below. The registration can be done during the initialization of *ODataJPAContext* in OData JPA Service Factory along with initializing persistence unit name, entity manager factory instance and optional mapping model.
+ :::java
oDataJPAContext.setJPAEdmExtension((JPAEdmExtension) new SalesOrderProcessingExtension());
*Note*: You must register the class because the OData JPA Processor Library should be informed about the list of Java methods that it needs to process in a project. If we do not register, then OData JPA Processor Library should scan all the classes and the methods in the Java project looking for EDM annotations. In order to avoid such overload, it is mandatory to specify the list of Java methods that shall be transformed into function imports in a class.
\ No newline at end of file