Skip to main content
Jump to: navigation, search


Naming Convention for schema elements

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:complexType name="empType">
      <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"/>

Converting the database metadata into the names of <element-tag>'s is the job of's

public interface NamingConventionTransformer {

    public enum ElementStyle {

    public String generateSchemaName(String tableName);

    public String generateElementAlias(String originalElementName);

    public ElementStyle styleForElement(String originalElementName);

In the eclipselink-dbwsutils.jar, there are built-in transformers that form a Chain-of-Responsibility


In the services file, the transformer chain is listed in order:

|   |  
|   \---services
            contains 3 lines:

=== Changing an <element-tag> to an "attrib It is possible to change an <element-tag> to an "attribute" with a custom transformer:

Back to the top