Jump to: navigation, search


< EclipseLink‎ | Examples‎ | DBWS
Revision as of 10:06, 7 October 2010 by Michael.norman.oracle.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Skip a database column so that is does not show up in generated schema

As seen in the previous Intermediate example, a user can provide a custom NamingConventionTransformer. The following NamingConventionTransformer will:

  • name the schema element 'simple'
  • make the element names lowercase
  • skip the SINCE field
package foo.bar.blah;
import org.eclipse.persistence.tools.dbws.DefaultNamingConventionTransformer;
import static org.eclipse.persistence.tools.dbws.NamingConventionTransformer.ElementStyle.ELEMENT;
import static org.eclipse.persistence.tools.dbws.NamingConventionTransformer.ElementStyle.NONE;
public class MyNamingConventionTransformer extends DefaultNamingConventionTransformer {
    public String generateSchemaAlias(String tableName) {
        return super.generateSchemaAlias("simple");
    public String generateElementAlias(String originalElementName) {
        return super.generateElementAlias(originalElementName.toLowerCase());
    public ElementStyle styleForElement(String elementName) {
        if ("since".equalsIgnoreCase(elementName)) {
            return NONE;
        return ELEMENT;