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

EclipseLink/Development/DBWS/Overview

< EclipseLink‎ | Development‎ | DBWS
Revision as of 12:49, 16 April 2014 by David.mccann.oracle.com (Talk | contribs) (Basic Flow)

High-level Overview of EclipseLink DBWS

The purpose of this document is to provide a high-level overview of the design and runtime portions of the DBWS component. In addition, an outline of relevant changes from version to version will be provided. The EclipseLink DBWS documentation can be found here: http://www.eclipse.org/eclipselink/documentation/2.5/dbws/toc.htm.

Design time Component

The DBWS builder is responsible for processing input from the user (or tooling, such as JDeveloper), then scraping the database DDL based on this input. The information retrieved from the database is used to construct a meta-model, which is in turn used to generate a number of artifacts required by the DBWS runtime in order to service SOAP message requests.

The following artifacts will be generated by the builder:

  • WSDL (JAX-WS 2.0)
  • JPA metadata
  • JAXB metadata
  • XML Schema
  • Sessions XML
  • DBWS XML-Relational (XR) file (defines querie operations used by the XR runtime)
  • web.xml
  • DBWSProvider (Web service provider - deployed in a servlet container)
  • ProviderListener (servlet listener impl.)


Typical .war file structure

   \---web-inf
   |
   |   web.xml
   |
   +---classes
   |   +---META-INF
   |   |       eclipselink-dbws.xml
   |   |       eclipselink-dbws-or.xml
   |   |       eclipselink-dbws-ox.xml
   |   |       eclipselink-dbws-sessions.xml
   |   |
   |   \---_dbws
   |           DBWSProvider.class            -- auto-generated JAX-WS 2.0 Provider
   |           ProviderListener.class        -- auto-generated Servlet implementation
   |
   \---wsdl
           eclipselink-dbws-schema.xsd
           eclipselink-dbws.wsdl
           swaref.xsd                        -- optionally generated is swaRef is being utilized


Supported Input

Following are the types of input DBWS supports:

  • SQL
    • generate operations based on SQL statement(s)
  • DB Table
    • CRUD operations generated by default
    • Custom SQL statements can be applied as well
    • Nested procedures are supported
  • Custom SQL
    • Allows additional operations to be defined on a given table, for example, the ability to search for one or more entries based on a field other than the PK field
  • Secondary SQL
    • Allows separate design/runtime SQL statements to be defined
    • Design time SQL used to build operations and runtime SQL executed at runtime
  • Stored function/procedure
  • PL/SQL stored function/procedure

Simple XML

DBWS provides the ability to wrap results in custom XML tags; this is useful where the structure of the results are not known, such as in the case of a ref cursor. If the 'isSimpleXmlFormat' flag is set to true, the results will look like the following:

<?xml version="1.0" encoding="UTF-8"?>
<simple-xml-format>
  <simple-xml>
    <ID>1</ID>
    <NAME>Joe Oracle</NAME>
  </simple-xml>
  <simple-xml>
    <ID>2</ID>
    <NAME>Jane Oracle</NAME>
  </simple-xml>
</simple-xml-format>

Note that both the simple-xml-format and simple-xml element names are customizable.

Basic Flow

User Input --> Scrape DB, Generate Meta-model --> Build JAXB/JPA metadata, XR query operations, WSDL and XML schema based on meta-model --> Generate Web app and WebService impl. --> Package results

Evolution of DBWS

EclipseLink 2.4

EclipseLink 2.4 was the first release containing the Oracle DDL parser. This JavaCC based parser was designed to better handle parsing Oracle-specific DDL, providing the ability to process PL/SQL and advanced Oracle JDBC types, such as Object and Object table types. Another major change was abandoning the visitor pattern that was used to create projects and descriptors based on the types discovered in the DDL. As of 2.4, a database type meta-model is constructed based on results of the DDLParser parse or JDBC driver metadata, and this meta-model is used to build the various required artifacts.

Information about the DDLParser's design and functionality can be found here: http://wiki.eclipse.org/index.php?title=EclipseLink/Development/DBWS/ParseDDLDS . In particular, the "Parsing Technology" section is worth reviewing.

EclipseLink 2.5

The major change in this release was removal of the legacy EclipseLink deployment XML project files in favor of JPA/JAXB metadata. In addition, much of the code was reworked to accommodate generation of the metadata vs. deployment XML artifacts.

It is important to note that 2.5 and 2.6 DBWS code bases are virtually identical.

Back to the top