Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/FAQ/DBWS"

(New page: == EclipseLink Database Web Services (DBWS) == === Description === The goal of DBWS is to enable simple and efficient access to relational database artifacts via a Web Service. DBWS exte...)
 
(How are Oracle PL/SQL Records and Collections Handled?)
 
(25 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== EclipseLink Database Web Services (DBWS) ==
+
__TOC__
  
=== Description ===
+
== What is EclipseLink DBWS? ==
  
The goal of DBWS is to enable simple and efficient access to relational database artifacts via a Web Service. DBWS extends EclipseLink's core capabilities while leveraging existing components (ORM, MOXy).
+
===Overview===
  
EclipseLink DBWS has two parts: a design-time tooling component and a runtime provider component that takes a service descriptor (along with related deployment artifacts) and realizes it as a JAX-WS 2.0 Web Service. The runtime provider uses EclipseLink to bridge between the database and the XML SOAP Messages used by a Web Service client.
+
{{:EclipseLink/UserGuide/DBWS/Overview#EclipseLink_DBWS_Overview}}
  
An DBWS service may be comprised of any number of '''operations''' of which there are 4 types:
+
==== Who uses this feature? ====
# Insert - inserts into the database persistent entities described by an XML document.
+
# Update - updates database persistent entities described by an XML document.
+
# Delete - removes from the database persistent entities described by an XML document.
+
# Query - retrieves from the database persistent entities described by an XML document. <br>Selection criteria for Query operations can be specified by:
+
#* custom <tt>SQL</tt>
+
#* Stored Procedures
+
#* TopLink Expressions
+
#* JP-QL
+
  
The XML documents used by operations conform to an XML Schema Definition <tt>.xsd</tt> document auto-generated by the design-time tooling. Alternatively, if no <tt>.xsd</tt> is available, a pre-defined simple XML format (SXF) can be used.
 
 
=== Who uses this feature? ===
 
 
Anyone who wishes to expose a database artifact as a Web Service.
 
Anyone who wishes to expose a database artifact as a Web Service.
  
=== Why do they use it? ===
+
==== Why do they use it? ====
  
 
EclipseLink DBWS provides a simple light-weight metadata model that requires no Java programming, yet is highly extensible.
 
EclipseLink DBWS provides a simple light-weight metadata model that requires no Java programming, yet is highly extensible.
  
h4. What technologies apply?
+
==== What technologies apply? ====
 +
 
 +
EclipseLink JPA/ORM, MOXy, [http://jcp.org/en/jsr/detail?id=224 JAX-WS]
 +
 
 +
== What version of JavaSE does DBWS support? ==
 +
 
 +
Using the EclipseLink DBWS design-time tools requires JDK 1.6 (or higher) while the DBWS runtime requires JDK 1.5 or higher.
 +
 
 +
== How are Oracle PL/SQL Records and Collections Handled? ==
 +
 
 +
Oracle PL/SQL Record and Collection types cannot be transported over JDBC.  To compensate for this, an anonymous block of PL/SQL code will be generated that contains functions responsible for converting to/from equivalent JDBC and PL/SQL types, based on the information passed to the DBWS Builder. In order for this to work, each PL/SQL record or collection type that will be an <tt>IN</tt>, <tt>IN OUT</tt>, <tt>OUT</tt> or <tt>RETURN</tt> argument (or any PL/SQL record/collection type nested within these) will need to have an equivalent JDBC type - the name of the type is expected to be in the form <tt><package name>_<type name></tt>.
 +
 
 +
For example, given the following PL/SQL Package:
 +
<source lang="plsql" enclose="div">
 +
CREATE OR REPLACE PACKAGE MYPKG AS
 +
  TYPE TBL1 IS TABLE OF VARCHAR2(111) INDEX BY BINARY_INTEGER;
 +
  TYPE ARECORD IS RECORD (
 +
    T1 TBL1,
 +
    T2 BOOLEAN
 +
  );
 +
  FUNCTION F1(FOO IN VARCHAR2) RETURN ARECORD;
 +
END MYPKG;
 +
</source>
 +
 
 +
The following equivalent JDBC types are required:
 +
<source lang="plsql" enclose="div">
 +
CREATE OR REPLACE TYPE MYPKG_TBL1 AS TABLE OF VARCHAR2(111)
  
EclipseLink OR/OXM, JAX-WS
+
CREATE OR REPLACE TYPE MYPKG_ARECORD AS OBJECT (
 +
  T1 MYPKG_TBL1,
 +
  T2 BOOLEAN
 +
)
 +
</source>
  
[[Category:EclipseLink FAQ|DBWS,X-R]]
+
[[Category:EclipseLink FAQ|DBWS]]

Latest revision as of 14:36, 25 July 2012

What is EclipseLink DBWS?

Overview

For the current version, see: Developing Persistence Architectures Using EclipseLink Database Web Services, Release 2.4

For EclispeLink DBWS Overview, see http://www.eclipse.org/eclipselink/documentation/2.4/dbws/overview.htm

Who uses this feature?

Anyone who wishes to expose a database artifact as a Web Service.

Why do they use it?

EclipseLink DBWS provides a simple light-weight metadata model that requires no Java programming, yet is highly extensible.

What technologies apply?

EclipseLink JPA/ORM, MOXy, JAX-WS

What version of JavaSE does DBWS support?

Using the EclipseLink DBWS design-time tools requires JDK 1.6 (or higher) while the DBWS runtime requires JDK 1.5 or higher.

How are Oracle PL/SQL Records and Collections Handled?

Oracle PL/SQL Record and Collection types cannot be transported over JDBC. To compensate for this, an anonymous block of PL/SQL code will be generated that contains functions responsible for converting to/from equivalent JDBC and PL/SQL types, based on the information passed to the DBWS Builder. In order for this to work, each PL/SQL record or collection type that will be an IN, IN OUT, OUT or RETURN argument (or any PL/SQL record/collection type nested within these) will need to have an equivalent JDBC type - the name of the type is expected to be in the form <package name>_<type name>.

For example, given the following PL/SQL Package:

CREATE OR REPLACE PACKAGE MYPKG AS
  TYPE TBL1 IS TABLE OF VARCHAR2(111) INDEX BY BINARY_INTEGER;
  TYPE ARECORD IS RECORD (
    T1 TBL1,
    T2 BOOLEAN
  );
  FUNCTION F1(FOO IN VARCHAR2) RETURN ARECORD;
END MYPKG;

The following equivalent JDBC types are required:

CREATE OR REPLACE TYPE MYPKG_TBL1 AS TABLE OF VARCHAR2(111)

CREATE OR REPLACE TYPE MYPKG_ARECORD AS OBJECT (
  T1 MYPKG_TBL1,
  T2 BOOLEAN
)

Copyright © Eclipse Foundation, Inc. All Rights Reserved.