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/UserGuide/DBWS/DBWSBuilderAPI"

(DBWSBuilder API)
Line 4: Line 4:
 
It is normally invoked from the command-line via its <code>main</code> method:
 
It is normally invoked from the command-line via its <code>main</code> method:
 
<css>
 
<css>
   .source-text {padding: 1em; border: 1px solid; color: black; background-color: #ffffff; line-height: 1.1em;}
+
   .source-text {padding: 1em; border: 1px solid; color: black; background-color: #ffffff;}
 
</css>
 
</css>
 
<source lang="text">
 
<source lang="text">
 
prompt > dbwsbuilder.cmd -builderFile {path_to_builder.xml} -stageDir {path_to_stageDir} -packageAs {packager}
 
prompt > dbwsbuilder.cmd -builderFile {path_to_builder.xml} -stageDir {path_to_stageDir} -packageAs {packager}
 
</source>
 
</source>
The the given builder XML file is parsed:
+
The given builder XML file is parsed:
 
<css>
 
<css>
   .source-xml {padding: 1em; border: 1px solid; color: black; background-color: #ffffff; line-height: 1.1em;}
+
   .source-xml {padding: 1em; border: 1px solid; color: black; background-color: #ffffff;}
 
</css>
 
</css>
 
<source lang="xml">
 
<source lang="xml">
Line 30: Line 30:
 
</dbws-builder>
 
</dbws-builder>
 
</source>
 
</source>
 +
by the OXM Project <code>o.e.p.tools.dbws.DBWSBuilderModelProject</code> producing model objects that represent <tt>properties</tt> and <tt>&lt;table&gt;</tt> operations. Thus the public class <b><code>org.eclipse.persistence.tools.dbws.DBWSBuilder</code></b> can be populated
 +
programmatically through property setters (i.e. <b><code>setDriver()</code></b>, <b><code>setUrl()</code></b>) and adding table or procedure operations via the public <b><code>addDbTable()</code></b> and <b><code>addDbStoredProcedure()</code></b> methods; SQL operations via <b><code>addSqlOperation()</code></b>.
  
You can also set the <tt>DBWSBuilder</tt>’s properties, add table or procedure definitions and SQL operations programmatically through <tt>DBWSBuilder</tt>’s API.
+
Once all the data and definitions have been set, the builder is invoked through the <b><code>build(...)</code></b> method:
 
+
<css>
The class <b><code>org.eclipse.persistence.tools.dbws.DBWSBuilder</code></b> is public and can be populated programmatically through property setters (i.e. <b><code>setDriver()</code></b>, <b><code>setUrl()</code></b>) and adding table or procedure definitions via the public <b><code>addDbTable()</code></b> and <b><code>addDbStoredProcedure()</code></b> methods; SQL operations via <b><code>addSqlOperation()</code></b> (NB - before adding a table or procedure definition, it is recommended that the public <b><code>checkTables()</code></b> and <b><code>checkStoredProcedures()</code></b> methods be used to ensure that the definitions are supported). Once all the data and definitions have been set, the builder is invoked through the <b><code>build(...)</code></b> method:
+
  .source-java {padding: 1em; border: 1px solid; color: black; background-color: #ffffff;}
 
+
</css>
 
<source lang="java">
 
<source lang="java">
 
public void build(OutputStream dbwsSchemaStream, OutputStream dbwsSessionsStream,
 
public void build(OutputStream dbwsSchemaStream, OutputStream dbwsSessionsStream,
Line 42: Line 44:
 
         throws WSDLException
 
         throws WSDLException
 
</source>
 
</source>
 
  
 
</onlyinclude>
 
</onlyinclude>
Information pending
 
  
 
[[Category: DBWS]]
 
[[Category: DBWS]]

Revision as of 13:37, 17 April 2009

DBWSBuilder API

The EclipseLink DBWS design-time utility - DBWSBuilder - is a Java application that generates EclipseLink DBWS files and assembles them into deployable archives.
It is normally invoked from the command-line via its main method:

prompt > dbwsbuilder.cmd -builderFile {path_to_builder.xml} -stageDir {path_to_stageDir} -packageAs {packager}

The given builder XML file is parsed:

<?xml version="1.0" encoding="UTF-8"?>
<dbws-builder xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    <properties>
        <property name="projectName">test</property>
        <property name="driver">oracle.jdbc.OracleDriver</property>
        <property name="password">tiger</property>
        <property name="url">jdbc:oracle:thin:@localhost:1521:ORCL</property>
        <property name="username">scott</property>
    </properties>
    <table
      catalogPattern="%"
      schemaPattern="SCOTT"
      tableNamePattern="EMP"
    />
</dbws-builder>

by the OXM Project o.e.p.tools.dbws.DBWSBuilderModelProject producing model objects that represent properties and <table> operations. Thus the public class org.eclipse.persistence.tools.dbws.DBWSBuilder can be populated programmatically through property setters (i.e. setDriver(), setUrl()) and adding table or procedure operations via the public addDbTable() and addDbStoredProcedure() methods; SQL operations via addSqlOperation().

Once all the data and definitions have been set, the builder is invoked through the build(...) method:

public void build(OutputStream dbwsSchemaStream, OutputStream dbwsSessionsStream,
        OutputStream dbwsServiceStream, OutputStream dbwsOrStream, OutputStream dbwsOxStream,
        OutputStream swarefStream, OutputStream webXmlStream, OutputStream wsdlStream,
        OutputStream codeGenProviderStream, OutputStream sourceProviderStream, Logger logger)
        throws WSDLException

Back to the top