EclipseLink/Development/DBWS/ParseDDLFS

From Eclipsepedia

Jump to: navigation, search

Parsing DDL for Metadata Functional Spec

Document History

Date Author Version Description & Notes
110601 Mike Norman 1.0 - use DBWS_METADATA to get information on database artifacts
110720 Mike Norman 1.1 - clarify scope: only intended to work with Oracle databases

DBMS_METADATA requires 'filter's to make the DDL presentable to the parser.
In order to 'future-proof' ourselves from possible changes to DBMS_METADATA's
implementation, ensure that the filters can be overridden by the end-user

Overview

The primary job of the DBWSBuilder utility is to extract metadata from the database about some artifact (i.e. a Table or a StoredProcedure) that is to be used as the basis of a Web Service. The DBWSBuilder translates the retrieved information (field names, arguments, scalar or composite datatypes, etc.) into DBWS runtime artifacts (EclipseLink Project XML files, WSDL and XML schema, etc.) Thus it is crucial that DBWSBuilder get complete and accurate information from the database.

Requirements

Scope

This feature is intended only for parsing Oracle DDL - it is not a general SQL/DDL parser for other databases.

Public API

The goal of this feature is to make no changes to public API

  • existing dbws builder files will still work; no new elements/attributes added
  • IDE integration (JDev, Dali) unchanged

Use Cases

The goal of this feature is to support all existing use cases as well as provide capabilities to support the following new cases:

Reusable Standalone library

Other projects have expressed an interest in this solution. The DDL Parser will be implemented as standalone, not requiring any classes from either eclipselink.jar or eclipselink-dbwsutils.jar

Extracting DDL

There is a utility method available in the Oracle database DBMS_METADATA.GET_DDL(specType, typeName, schema) that has been available since 9i that successfully returns DDL for a wide-variety of artifacts:

  • package specification
  • table specification
  • object types: structs, varrays, nested tables
  • top-level procedures and functions.

This means that the existing JPub code in o.e.p.platform.database.oracle.publisher is removed

Refactoring Strategy

Switching from JPub to parsing DDL is admittedly riskly as it is a 'break-the-world' change: work must be done to implement existing functionality. However, the above use cases cannot be supported with the existing code-base. In addition, the elimination of JPub legacy code lead to no other choice going forward.

Open Issues

This section lists the pending open issues.

Issue # Owner Description / Notes
1 MWN DBMS_METADATA cannot provide DDL for packages that have been 'wrapped', a type of encryption that obfuscates the DDL. Some alternative way to provide the DDL would need to be required (such as a location outside the DB i.e. file system or remote URL).
2 MWN If a schema user references a type from a different schema, then the first schema must have the SELECT_CATALOG_ROLE granted to it.