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/NamingConventionTransformer"

(Proposed new Interface org.eclipse.persistence.tools.dbws.NamingConventionTransformer)
(Proposed new Interface org.eclipse.persistence.tools.dbws.NamingConventionTransformer)
Line 48: Line 48:
 
</source>
 
</source>
 
The algorithm above will be converted to a series of transformers (operating as a [http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern <i>Chain-of-Responsibility</i>]) that cooperate together to transform the database table's metadata <br/>
 
The algorithm above will be converted to a series of transformers (operating as a [http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern <i>Chain-of-Responsibility</i>]) that cooperate together to transform the database table's metadata <br/>
(table name, table columns) into the schema's <tt><xsd:complexType></tt> and <tt><xsd:element></tt>s.
+
(table name, table columns) into the schema's <tt><xsd:complexType></tt> and <tt><xsd:element></tt>'s.
 +
 
 +
- <tt>isUserTransformer</tt> <br/>
 +
lkdfsldkfj
 +
-- <tt>generateTableAlias</tt> <br/>
 +
more asldkfj;sadfjk

Revision as of 12:50, 12 September 2008

DBWS Schema Naming Convention Transformers

Document History

Date Author Version Description & Notes
080911 Mike Norman 1.0

DBWS utility enhancement: Naming convention of generated schema types

bug 234677
The DBWSBuilder utility should allow the user to alter the names of the generated schema types.
The algorithm currently in use is very simple:

  • table name ==> translate any characters un-supported by XML1 ==> to_lowercase ==> add suffix 'Type' ==> top-level complex element type in .xsd file
  • column name ==> translate characters ==> to_lowercase ==> element tag name2

1 - same algorithm documented as part of the SQL/X specification (a.k.a. ISO/IEC 9075-14:2003 Part 14)
2 - All columns expressed as XML elements

Proposed new Interface org.eclipse.persistence.tools.dbws.NamingConventionTransformer

The proposed fix for bug 234677 is the introduction of a new Interface class:

package org.eclipse.persistence.tools.dbws;
 
public interface NamingConventionTransformer {
 
    public enum ElementStyle {
        ELEMENT, ATTRIBYTE
    };
 
    public boolean isUserTransformer();
 
    public String generateTableAlias(String tableName);
 
    public String generateSchemaTypeAlias(String originalSchemaName);
 
    public String generateWrapperElementNameAlias(String originalWrapperElementName);
 
    public String generateElementNameAlias(String originalElementName);
 
    public ElementStyle styleForElement(String elementName);
}

The algorithm above will be converted to a series of transformers (operating as a Chain-of-Responsibility) that cooperate together to transform the database table's metadata
(table name, table columns) into the schema's <xsd:complexType> and <xsd:element>'s.

- isUserTransformer
lkdfsldkfj -- generateTableAlias
more asldkfj;sadfjk

Back to the top