Jump to: navigation, search

Difference between revisions of "EclipseLink/Examples/DBWS/DBWSIntermediateAttribute"

Line 4: Line 4:
 
It is possible to change an <element-tag> to an "attribute" with a <code>o.e.p.tools.dbws.NamingConventionTransformer</code>
 
It is possible to change an <element-tag> to an "attribute" with a <code>o.e.p.tools.dbws.NamingConventionTransformer</code>
 
In the <tt>eclipselink-dbwsutils.jar</tt>, there are built-in transformers that form a [http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern <i>Chain-of-Responsibility</i>]
 
In the <tt>eclipselink-dbwsutils.jar</tt>, there are built-in transformers that form a [http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern <i>Chain-of-Responsibility</i>]
<br clear="all"/>
+
 
[[Image:NCTChainOfResponsibility.png]]
+
[[Image:NCTChainOfResponsibility.png|650px]]
 
<br clear="all"/>
 
<br clear="all"/>
  
In the <tt>org.eclipse.persistence.tools.dbws.NamingConventionTransformer</tt> services file, the transformer chain is listed in order:
+
In the <tt>o.e.p.tools.dbws.NamingConventionTransformer</tt> services file, the transformer chain is listed in order:
 +
<pre>
 +
eclipselink-dbwsutils.jar
 +
 +
+---META-INF
 +
|  |  MANIFEST.MF
 +
|  | 
 +
|  \---services
 +
|          org.eclipse.persistence.tools.dbws.NamingConventionTransformer
 +
</pre>
 
:<tt>org.eclipse.persistence.tools.dbws.ToLowerTransformer
 
:<tt>org.eclipse.persistence.tools.dbws.ToLowerTransformer
 
:org.eclipse.persistence.tools.dbws.TypeSuffixTransformer
 
:org.eclipse.persistence.tools.dbws.TypeSuffixTransformer
 
:org.eclipse.persistence.tools.dbws.SQLX2003Transformer</tt>
 
:org.eclipse.persistence.tools.dbws.SQLX2003Transformer</tt>

Revision as of 10:56, 3 June 2009

Changing an <element-tag> to an "attribute"

As seen in the Basic Table example, the DBWSBuilder-generated eclipselink-dbws-schema.xsd file derives <element-tag> names from the Database table metadata:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 >
  <xsd:complexType name="empType">
    <xsd:sequence>
      <xsd:element name="empno" type="xsd:int" xsi:nil="false"/>
      <xsd:element name="ename" type="xsd:string" xsi:nil="true"/>
      <xsd:element name="job" type="xsd:string" xsi:nil="true"/>
      <xsd:element name="mgr" type="xsd:int" minOccurs="0" xsi:nil="true"/>
      <xsd:element name="hiredate" type="xsd:dateTime" xsi:nil="true"/>
      <xsd:element name="sal" type="xsd:decimal" xsi:nil="true"/>
      <xsd:element name="comm" type="xsd:int" minOccurs="0" xsi:nil="true"/>
      <xsd:element name="deptno" type="xsd:int" xsi:nil="true"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>


It is possible to change an <element-tag> to an "attribute" with a o.e.p.tools.dbws.NamingConventionTransformer In the eclipselink-dbwsutils.jar, there are built-in transformers that form a Chain-of-Responsibility

NCTChainOfResponsibility.png

In the o.e.p.tools.dbws.NamingConventionTransformer services file, the transformer chain is listed in order:

eclipselink-dbwsutils.jar
|   
+---META-INF
|   |   MANIFEST.MF
|   |   
|   \---services
|           org.eclipse.persistence.tools.dbws.NamingConventionTransformer
org.eclipse.persistence.tools.dbws.ToLowerTransformer
org.eclipse.persistence.tools.dbws.TypeSuffixTransformer
org.eclipse.persistence.tools.dbws.SQLX2003Transformer