Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » DBWS / NamingConventionTransformer(NamingConventionTransformer only works partially when generating webservices based on pl/sql packages)
DBWS / NamingConventionTransformer [message #1044034] Thu, 18 April 2013 08:13 Go to next message
Kurt Geens is currently offline Kurt Geens
Messages: 2
Registered: April 2013
Junior Member
I'm generating a webservice using the DBWS utility based on oracle pl/sql packaged procedures. These procedures (and the types related to it) have fairly undescriptive names, so I want to change these names to meaningful ones in the webservice. For this, I'm using an override of the DefaultNamingConventionTransformer, as suggested. However, it seems that only the generateSchemaAlias function is being picked up, while both generateElementAlias and styleForElement are untouched.

To simplify debugging matters I have reduced the overwritten java class to the following:

package axirs.dbws.nct;

import org.eclipse.persistence.tools.dbws.DefaultNamingConventionTransformer;
import static org.eclipse.persistence.tools.dbws.NamingConventionTransformer.ElementStyle.ELEMENT;

public class OmzetAppNamingConventionTransformer extends DefaultNamingConventionTransformer {

  @Override
  public String generateSchemaAlias(String tableName) {
    System.out.println("generateSchemaAlias tableName: " + tableName);
    return super.generateSchemaAlias(tableName + "Type");
  }

  @Override
  public String generateElementAlias(String originalElementName) {
    System.out.println("generateElementAlias originalElementName: " + originalElementName);
    return super.generateElementAlias(originalElementName);
  }

  @Override
  public ElementStyle styleForElement(String elementName) {
    System.out.println("custom styleForElement: " + elementName);
    return ELEMENT;
  }

}


While generating the webservice, only the tableName messages appear, the other two don't.

Example of the packages/types on which this is based:

CREATE TYPE otoaucr AS OBJECT
( deusrnm VARCHAR2(20)
, depwhsh VARCHAR2(32) );
/
CREATE TYPE otoabrs AS OBJECT
( desuccs VARCHAR2(5)
, deermsg VARCHAR2(200) );
/
CREATE OR REPLACE PACKAGE pck_app_turnover AS
  PROCEDURE authenticate ( i_user_credentials    IN  otoaucr
                         , o_user_authentication OUT otoabrs );
END pck_app_turnover;
/


Any ideas on what's going wrong? I'm quite sure that my builder.xml file is correct, as the webservice generates properly. The naming convention jar has been generated correctly as well, including the manifest, as the generateSchemaAlias is picked up. I'm rather clueless as to the reason why the other 2 functions aren't...
Re: DBWS / NamingConventionTransformer [message #1044278 is a reply to message #1044034] Thu, 18 April 2013 13:57 Go to previous messageGo to next message
David McCann is currently offline David McCann
Messages: 20
Registered: July 2009
Junior Member
The two methods in question are only hit when processing a database table. Since you're building the service based on PL/SQL procedures, you won't see those being hit.

To verify that the transformer chain is working correctly, I built a customtransformer.jar based on your code, and ran the build script from an EclipseLink 2.4.1 install against a TABLE, and all methods get hit as expected.

We should be utilizing these methods when generating a schema for procs/funcs as well as tables. I will open an enhancement request (or bug perhaps) to track the issue.

--Dave
Re: DBWS / NamingConventionTransformer [message #1044294 is a reply to message #1044278] Thu, 18 April 2013 14:30 Go to previous messageGo to next message
David McCann is currently offline David McCann
Messages: 20
Registered: July 2009
Junior Member
FYI: https://bugs.eclipse.org/bugs/show_bug.cgi?id=406016
Re: DBWS / NamingConventionTransformer [message #1044643 is a reply to message #1044294] Fri, 19 April 2013 02:52 Go to previous message
Kurt Geens is currently offline Kurt Geens
Messages: 2
Registered: April 2013
Junior Member
Hi David,

Thanks for your feedback and for logging the bug. I'll look forward to seeing this resolved in a future version.

Kind regards,
Kurt
Previous Topic:xsi:type with namespace using MOXy
Next Topic:Generate Tables from Entities results in NoInitialContextException
Goto Forum:
  


Current Time: Wed Apr 16 18:47:57 EDT 2014

Powered by FUDForum. Page generated in 0.01601 seconds