Skip to main content

Notice: This Wiki is now read only and edits are no longer 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/Development/DBWS/ParseDDLDS"

(Parsing DDL for Metadata)
(Parsing DDL for Metadata)
Line 4: Line 4:
 
For Oracle databases, <tt>DBWSBuilder</tt> uses a modified cut-down version of the JPublisher classes to send SQL queries to Data Dictionary views (<tt>ALL_OBJECTS</tt>, <tt>ALL_ARGUMENTS</tt>, etc.) that is then converted to an in-memory object-graph of all relevant information about the specific database artifact required for the Web Service. This object-graph is then ''walked'' and the required DBWS runtime artifacts generated.
 
For Oracle databases, <tt>DBWSBuilder</tt> uses a modified cut-down version of the JPublisher classes to send SQL queries to Data Dictionary views (<tt>ALL_OBJECTS</tt>, <tt>ALL_ARGUMENTS</tt>, etc.) that is then converted to an in-memory object-graph of all relevant information about the specific database artifact required for the Web Service. This object-graph is then ''walked'' and the required DBWS runtime artifacts generated.
  
Unfortunately, the information in the Data Dictionary views can be (under certain circumstances) incomplete or inaccurate, or the in-memory object-graph constructed from the views can be distorted. For example, the arguments to a StoredProcedure may have a default thus making it optional. This in turn means that the calling sequence can change:
+
Unfortunately, the information in the Data Dictionary views can be (under certain circumstances) incomplete or inaccurate, or the in-memory object-graph constructed from the views can be distorted. For example, an argument to a StoredProcedure may have a default value assigned to it, thus making it optional. This in turn means that the calling sequence can change in that fewer arguments need be passed in:
 
<source lang="sql">
 
<source lang="sql">
 
CREATE OR REPLACE PACKAGE SOMEPKG AS
 
CREATE OR REPLACE PACKAGE SOMEPKG AS
Line 18: Line 18:
 
     WHATEVER IN VARCHAR2 default 'bogus');
 
     WHATEVER IN VARCHAR2 default 'bogus');
 
END;
 
END;
 +
</source>
 +
The object-graph created 4 StoredProcedure representations:
 +
<source lang="plain">
 +
DOSOMETHING(MYREC,STUFF)
 +
DOSOMETHING(MYREC,STUFF, P_EMPNO)
 +
DOSOMETHING(MYREC,STUFF, P_EMPNO, FLAG)
 +
DOSOMETHING(MYREC,STUFF, P_EMPNO, FLAG, WHATEVER)
 +
</source>
 +
however, there are an additional 4 possibilities:
 +
<source lang="plain">
 +
DOSOMETHING(MYREC,STUFF, FLAG)
 +
DOSOMETHING(MYREC,STUFF, WHATEVER)
 +
DOSOMETHING(MYREC,STUFF, FLAG, WHATEVER)
 +
DOSOMETHING(MYREC,STUFF, P_EMPNO, WHATEVER)
 
</source>
 
</source>

Revision as of 16:27, 31 May 2011

Parsing DDL for Metadata

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 (JAX-WS compliant) Web Service. The DBWSBuilder translates the information (fields, arguments, scalar or complex datatypes, etc.) into DBWS runtime artifacts (e.g. EclipseLink Project XML files, JAX-WS Provider class, etc.) Thus it is crucial that DBWSBuilder get complete and accurate metadata from the database.

For Oracle databases, DBWSBuilder uses a modified cut-down version of the JPublisher classes to send SQL queries to Data Dictionary views (ALL_OBJECTS, ALL_ARGUMENTS, etc.) that is then converted to an in-memory object-graph of all relevant information about the specific database artifact required for the Web Service. This object-graph is then walked and the required DBWS runtime artifacts generated.

Unfortunately, the information in the Data Dictionary views can be (under certain circumstances) incomplete or inaccurate, or the in-memory object-graph constructed from the views can be distorted. For example, an argument to a StoredProcedure may have a default value assigned to it, thus making it optional. This in turn means that the calling sequence can change in that fewer arguments need be passed in:

CREATE OR REPLACE PACKAGE SOMEPKG AS
 
  TYPE EMP_REC IS RECORD(
    EMPNO EMP.EMPNO%TYPE,
    FNAME EMP.FNAME%TYPE,
    LNAME EMP.LNAME%TYPE
  );
 
  PROCEDURE DOSOMETHING(MYREC IN OUT EMP_REC, STUFF IN VARCHAR2,
    P_EMPNO IN NUMBER := 20, FLAG IN BOOLEAN DEFAULT FALSE,
    WHATEVER IN VARCHAR2 DEFAULT 'bogus');
END;

The object-graph created 4 StoredProcedure representations:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, otj, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


DOSOMETHING(MYREC,STUFF)
DOSOMETHING(MYREC,STUFF, P_EMPNO)
DOSOMETHING(MYREC,STUFF, P_EMPNO, FLAG)
DOSOMETHING(MYREC,STUFF, P_EMPNO, FLAG, WHATEVER)

however, there are an additional 4 possibilities:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, otj, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


DOSOMETHING(MYREC,STUFF, FLAG)
DOSOMETHING(MYREC,STUFF, WHATEVER)
DOSOMETHING(MYREC,STUFF, FLAG, WHATEVER)
DOSOMETHING(MYREC,STUFF, P_EMPNO, WHATEVER)

Back to the top