Create a Physical Data Service from a Java Function This page last changed on Nov 27, 2008. .stickable, h1, h2, h3, h4, h5 false true Show Sticky notes Hide Sticky notes Save Cancel Oracle Data Service Integrator Documentation > Data Services Developer's Guide # How To Create a Physical Data Service from a Java Function
| Prefer all related topics on a single page? Click here.
You can create physical data services based on custom Java functions that return both simple and complex types.
| Before you can create physical data services based on custom Java functions, you must create a Java class containing both the schema and function information. For more information, see Preparing to Create Physical Data Services From Java Functions. For more information about supported Java types and the corresponding generated data services, see Physical Data Services from Java Functions Overview.
### Topics Setting Up the Physical Data Service Creation Wizard Accessing Java Functions Selecting Java Functions to Import Setting Characteristics of Imported Java Functions Setting the Physical Data Service Name See Also ## Setting Up the Physical Data Service Creation Wizard Physical data services are created using a wizard. ##### Physical Data Service Creation Wizard ### Starting the Wizard To start the physical data service creation wizard: Right-click on your dataspace project or any folder in your project. Choose New > Physical Data Service ##### Creating a New Physical Data Service ## Accessing Java Functions After you choose Java Function as your data source, you need to specify a class name containing the Java functions. ##### Choosing Java Function as a Data Source ### Choosing the Java class: To choose the Java class containing the Java functions: Choose Java Function from the Data source type drop-down list. Click Browse. The Open Java Class dialog appears. Select the Java `.class` file and click Open. The `.class` file must reside in the same dataspace into which you are importing the Java functions. Click Next. ##### Open Java Class Dialog ## Selecting Java Functions to Import After you select Java Function as your data source, you need to select the Java functions to import. ##### Selecting Java Function Dialog To select the Java functions to import: Select the Java functions you want to import by checking the corresponding box. Select `With Change Summary` to have Oracle Data Service Integrator declare the parameter or return value as `changed-element` enabling you to use it with update operations. This option is only available for SDO DataObject-generated classes. Click Next. ## Setting Characteristics of Imported Java Functions After choosing the Java functions to import, you can optionally set the characteristics of the functions. ##### Setting Characteristics of Imported Java Functions The following table describes the available options for each function you have selected to import. ##### Options Available for Imported Java Functions
Characteristic | Options | Comment
--- | --- | ---
Operation name | Adjust as needed | You can change the nominated name to any legal XML name using the built-in line editor.
Public | Boolean | By default Java function-derived operations are protected. A checkbox allows you to mark any function or procedure as public. (Once in a data service, operations can be marked private as needed.)
Kind | Read Create Update Delete Library function Library procedure | Functions determined to return void are automatically marked as library procedures. You can change the nominated function type. The wizard attempts to correctly set the function type being imported.
| Operations marked as create, update, or delete functions will be packaged in an Entity data service. Otherwise, the resulting data service will be of type Library.
is Primary | Boolean | Not applicable for Java functions.
Root Element | Root element of the operation | For complex data types the topmost element is listed.
Target Namespace | Imported value | This represents the target namespace of the generated data service.
To set the characteristics of imported Java functions: Optionally edit the details of each operation: Click Next. ## Setting the Physical Data Service Name You can set the name of your data service to any legal name that does not conflict with another name in the current dataspace. To complete the wizard: Type the name of the data service in the Data service name field. Click Finish. Oracle Data Service Integrator creates a pragma (visible in Source view) that defines the function signature and relevant schema type for complex types such as schema elements or SDO types. If there are existing data services in your project, you have the option of adding functions and procedures to that library or creating a new library for them. All the Java file functions are located in the same data service.
| When importing a Java function that itself has one or more dependent (or referenced) schemas, the wizard creates second-level schemas according to internal naming conventions. If several operations reference the same secondary schemas, the generated name for the secondary schema may change if you re-import or synchronize with the Java class.
## See Also ##### Concepts Physical Data Services from Java Functions Overview ##### How Tos Preparing to Create Physical Data Services From Java Functions Creating XMLBean Support for Java Functions

Document generated by Confluence on Jan 13, 2009 15:57