Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Creating EclipseLink Files for Deployment (ELUG)"
m (→What You May Need to Know About Creating Deployment Files for a EclipseLink Database Web Service) |
m |
||
Line 18: | Line 18: | ||
* [[#eclispelink-dbws-schema.xsd|eclispelink-dbws-schema.xsd]] | * [[#eclispelink-dbws-schema.xsd|eclispelink-dbws-schema.xsd]] | ||
− | Workbench provides the ability to create deployment files from a Workbench project (see [[Creating%20a%20Project%20(ELUG)|Exporting Project Information]]). After you build a project, you have two options to create the deployment files: | + | Workbench provides the ability to create deployment files from a Workbench project (see [[Creating%20a%20Project%20(ELUG)#Exporting Project Information)|Exporting Project Information]]). After you build a project, you have two options to create the deployment files: |
* Create XML deployment files that require no compiling. | * Create XML deployment files that require no compiling. | ||
* Create Java source files, which you compile and deploy outside of Workbench. | * Create Java source files, which you compile and deploy outside of Workbench. | ||
Line 43: | Line 43: | ||
For a POJO application, you define your project metadata in a <tt>project.xml</tt> file. | For a POJO application, you define your project metadata in a <tt>project.xml</tt> file. | ||
− | The <tt>project.xml</tt> file provides a simple and flexible way to configure, modify, and troubleshoot the project metadata. Because of these attributes, the <tt>project.xml</tt> file is the preferred way to configure a EclipseLink project.Workbench provides a graphical tool to build and edit the <tt>project.xml</tt> file. For information on creating projects with Workbench, see [[#the project.xml File with Workbench]]. | + | The <tt>project.xml</tt> file provides a simple and flexible way to configure, modify, and troubleshoot the project metadata. Because of these attributes, the <tt>project.xml</tt> file is the preferred way to configure a EclipseLink project.Workbench provides a graphical tool to build and edit the <tt>project.xml</tt> file. For information on creating projects with Workbench, see [[#Creating the project.xml File with Workbench|Creating the project.xml File with Workbench]]. |
+ | |||
+ | |||
====JPA Applications and Project Metadata==== | ====JPA Applications and Project Metadata==== | ||
For a JPA application, you can express project metadata using JPA annotations, <tt>persistence.xml</tt>, <tt>orm.xml</tt>, and EclipseLink JPA annotation and <tt>persistence.xml</tt> property extensions. The EclipseLink JPA persistence provider interprets all these sources of metadata to create an in-memory EclipseLink session and project at run time. | For a JPA application, you can express project metadata using JPA annotations, <tt>persistence.xml</tt>, <tt>orm.xml</tt>, and EclipseLink JPA annotation and <tt>persistence.xml</tt> property extensions. The EclipseLink JPA persistence provider interprets all these sources of metadata to create an in-memory EclipseLink session and project at run time. | ||
− | Using EclipseLink JPA, you also have the option of specifying your metadata using EclipseLink <tt>sessions.xml</tt> and <tt>project.xml</tt> while accessing your persistent classes using JPA and an <tt>EntityManger</tt>. For more information, see [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)# | + | Using EclipseLink JPA, you also have the option of specifying your metadata using EclipseLink <tt>sessions.xml</tt> and <tt>project.xml</tt> while accessing your persistent classes using JPA and an <tt>EntityManger</tt>. For more information, see [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)#What You May Need to Know About EclipseLink JPA Overriding Mechanisms|What You May Need to Know About EclipseLink JPA Overriding Mechanisms]]. |
+ | |||
+ | |||
====Creating the project.xml File with Workbench==== | ====Creating the project.xml File with Workbench==== | ||
Because you must synchronize the <tt>project.xml</tt> file with the classes and data source associated with your application, we recommend that you not modify this file manually. Workbench ensures proper synchronization, and is the best way to make changes to the project. Simply modify the project in Workbench and redeploy the <tt>project.xml</tt> file. Using this option reduces development time by eliminating the need to regenerate and recompile Java code each time the project changes. | Because you must synchronize the <tt>project.xml</tt> file with the classes and data source associated with your application, we recommend that you not modify this file manually. Workbench ensures proper synchronization, and is the best way to make changes to the project. Simply modify the project in Workbench and redeploy the <tt>project.xml</tt> file. Using this option reduces development time by eliminating the need to regenerate and recompile Java code each time the project changes. | ||
− | See [[Creating%20a%20Project%20(ELUG)|Exporting Project Information]] for detailed information on exporting the deployment XML information. | + | See [[Creating%20a%20Project%20(ELUG)#Exporting Project Information|Exporting Project Information]] for detailed information on exporting the deployment XML information. |
Line 60: | Line 64: | ||
'''Note'''<nowiki>:</nowiki> You can name this file with a name other than <tt>project.xml</tt><nowiki>; however, for clarity, this discussion assumes that the file has not been renamed.</nowiki> | '''Note'''<nowiki>:</nowiki> You can name this file with a name other than <tt>project.xml</tt><nowiki>; however, for clarity, this discussion assumes that the file has not been renamed.</nowiki> | ||
|} | |} | ||
+ | |||
+ | |||
====Creating project.xml Programatically==== | ====Creating project.xml Programatically==== | ||
Line 74: | Line 80: | ||
'''Note:'''If you are using EJB 3.0, you can use annotations to specify most of what you formerly specified in the <tt>project.xml</tt> file. To override annotations or specify options not supported by annotations, you can still provide a <tt>project.xml</tt> file in your EJB 3.0 application. For more information on what annotations are currently supported, see ''Oracle Fusion Middleware Enterprise JavaBeans Developer's Guide for Oracle Containers for Java EE'' | '''Note:'''If you are using EJB 3.0, you can use annotations to specify most of what you formerly specified in the <tt>project.xml</tt> file. To override annotations or specify options not supported by annotations, you can still provide a <tt>project.xml</tt> file in your EJB 3.0 application. For more information on what annotations are currently supported, see ''Oracle Fusion Middleware Enterprise JavaBeans Developer's Guide for Oracle Containers for Java EE'' | ||
|} | |} | ||
+ | |||
+ | |||
===sessions.xml File=== | ===sessions.xml File=== | ||
Line 81: | Line 89: | ||
====XSD File Format==== | ====XSD File Format==== | ||
− | The <tt>sessions.xml</tt> file XSD is <tt>eclipse_persistence_sessions_1_0.xsd</tt> and it is located in the ''<tt><ECLISPELINK_HOME></tt>''<tt>\config\xsds</tt> directory as well as on the web at www.eclipse.org/eclipselink/xsds/eclipse_persistence_sessions_1_0.xsd. | + | The <tt>sessions.xml</tt> file XSD is <tt>eclipse_persistence_sessions_1_0.xsd</tt> and it is located in the ''<tt><ECLISPELINK_HOME></tt>''<tt>\config\xsds</tt> directory as well as on the web at http://www.eclipse.org/eclipselink/xsds/eclipse_persistence_sessions_1_0.xsd. |
When you use the XSD formatted <tt>sessions.xml</tt> file, the EclipseLink run time separates <tt>sessions.xml</tt> file validation from session instantiation. Separating XML file formatting problems from Session Manager session instantiation problems simplifies troubleshooting. Exceptions thrown during validation clearly indicate that the failure is due to an invalid <tt>sessions.xml</tt> file, as the following illustrates. | When you use the XSD formatted <tt>sessions.xml</tt> file, the EclipseLink run time separates <tt>sessions.xml</tt> file validation from session instantiation. Separating XML file formatting problems from Session Manager session instantiation problems simplifies troubleshooting. Exceptions thrown during validation clearly indicate that the failure is due to an invalid <tt>sessions.xml</tt> file, as the following illustrates. | ||
Line 91: | Line 99: | ||
Exception Description: A End tag does not match start tag 'session'. was thrown while parsing the XML file against the XML schema. | Exception Description: A End tag does not match start tag 'session'. was thrown while parsing the XML file against the XML schema. | ||
Internal Exception: oracle.xml.parser.v2.XMLParseException: End tag does not match start tag 'session'. | Internal Exception: oracle.xml.parser.v2.XMLParseException: End tag does not match start tag 'session'. | ||
+ | |||
+ | |||
====POJO Applications and Session Metadata==== | ====POJO Applications and Session Metadata==== | ||
Line 102: | Line 112: | ||
For a JPA application, you can express session metadata using JPA annotations, <tt>persistence.xml</tt>, <tt>orm.xml</tt>, and EclipseLink JPA annotation and <tt>persistence.xml</tt> property extensions. The EclipseLink JPA persistence provider interprets all these sources of metadata to create an in-memory EclipseLink session and project at run time. | For a JPA application, you can express session metadata using JPA annotations, <tt>persistence.xml</tt>, <tt>orm.xml</tt>, and EclipseLink JPA annotation and <tt>persistence.xml</tt> property extensions. The EclipseLink JPA persistence provider interprets all these sources of metadata to create an in-memory EclipseLink session and project at run time. | ||
− | Using EclipseLink JPA, you also have the option of specifying your metadata using EclipseLink <tt>sessions.xml</tt> and <tt>project.xml</tt> while accessing your persistent classes using JPA and an <tt>EntityManger</tt>. For more information, see [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)|What You May Need to Know About EclipseLink JPA Overriding Mechanisms]]. | + | Using EclipseLink JPA, you also have the option of specifying your metadata using EclipseLink <tt>sessions.xml</tt> and <tt>project.xml</tt> while accessing your persistent classes using JPA and an <tt>EntityManger</tt>. For more information, see [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)#What You May Need to Know About EclipseLink JPA Overriding Mechanisms|What You May Need to Know About EclipseLink JPA Overriding Mechanisms]]. |
Line 142: | Line 152: | ||
<span id="Example 8-2"></span> | <span id="Example 8-2"></span> | ||
''''' eclispelink-dbws.xml File''''' | ''''' eclispelink-dbws.xml File''''' | ||
− | |||
− | |||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<dbws xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | <dbws xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
Line 187: | Line 195: | ||
For more information, see the following: | For more information, see the following: | ||
− | * [[#Deployment Files for EclipseLink Database Web Services]] | + | * [[#Deployment Files for EclipseLink Database Web Services|Deployment Files for EclipseLink Database Web Services]] |
− | * [[#BuildDBWSWar]] | + | * [[#BuildDBWSWar|BuildDBWSWar]] |
Line 194: | Line 202: | ||
====XSD File Format==== | ====XSD File Format==== | ||
The <tt>eclipselink-dbws-service.xml</tt> file XSD is <tt>eclipselink-dbws_1.xsd</tt> and it is located in the ''<tt><ECLIPSELINK_HOME></tt>''<tt>\config\xsds</tt> directory. | The <tt>eclipselink-dbws-service.xml</tt> file XSD is <tt>eclipselink-dbws_1.xsd</tt> and it is located in the ''<tt><ECLIPSELINK_HOME></tt>''<tt>\config\xsds</tt> directory. | ||
+ | |||
+ | |||
===eclispelink-dbws-schema.xsd=== | ===eclispelink-dbws-schema.xsd=== | ||
Line 203: | Line 213: | ||
<span id="Table 8-2"></span> | <span id="Table 8-2"></span> | ||
''''' Typical Database Metadata''''' | ''''' Typical Database Metadata''''' | ||
− | |||
{| class="RuleFormalWideMax" dir="ltr" title="Typical Database Metadata" summary="This table lists the metadata from a typical database." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | {| class="RuleFormalWideMax" dir="ltr" title="Typical Database Metadata" summary="This table lists the metadata from a typical database." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
Line 372: | Line 381: | ||
For more information, see [[#Deployment Files for EclipseLink Database Web Services|Deployment Files for EclipseLink Database Web Services]] | For more information, see [[#Deployment Files for EclipseLink Database Web Services|Deployment Files for EclipseLink Database Web Services]] | ||
+ | |||
+ | |||
==Creating Deployment Files for Java Applications== | ==Creating Deployment Files for Java Applications== | ||
Line 377: | Line 388: | ||
Java applications require the following deployment files: | Java applications require the following deployment files: | ||
− | * [[#project.xml File]] | + | * [[#project.xml File|project.xml File]] |
− | * [[#sessions.xml File]] | + | * [[#sessions.xml File|sessions.xml File]] |
Line 386: | Line 397: | ||
JSP and servlet applications require the following deployment files: | JSP and servlet applications require the following deployment files: | ||
− | * [[#project.xml File]] | + | * [[#project.xml File|project.xml File]] |
− | * [[#sessions.xml File]] | + | * [[#sessions.xml File|sessions.xml File]] |
Line 402: | Line 413: | ||
===How to Create Deployment Files for EJB 3.0 Session Bean Applications=== | ===How to Create Deployment Files for EJB 3.0 Session Bean Applications=== | ||
− | We recommend using JPA annotations and persistence unit properties, or a special-case <tt>eclipselink.session-xml</tt> persistence unit property (see [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)|EclipseLink JPA Persistence Unit Properties for Database, Session, and Application Server]]) in your EJB 3.0 session bean application. | + | We recommend using JPA annotations and persistence unit properties, or a special-case <tt>eclipselink.session-xml</tt> persistence unit property (see [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)#EclipseLink JPA Persistence Unit Properties for Database, Session, and Application Server|EclipseLink JPA Persistence Unit Properties for Database, Session, and Application Server]]) in your EJB 3.0 session bean application. |
You may also choose to use the [[#project.xml File|project.xml File]] and [[#sessions.xml File|sessions.xml File]]. | You may also choose to use the [[#project.xml File|project.xml File]] and [[#sessions.xml File|sessions.xml File]]. | ||
Line 410: | Line 421: | ||
* [[Introduction to EclipseLink JPA (ELUG)|EclipseLink JPA Overview]] | * [[Introduction to EclipseLink JPA (ELUG)|EclipseLink JPA Overview]] | ||
* [[Developing Applications Using EclipseLink JPA (ELUG)|Application Development with EclipseLink JPA)]] | * [[Developing Applications Using EclipseLink JPA (ELUG)|Application Development with EclipseLink JPA)]] | ||
+ | |||
+ | |||
==Creating Deployment Files for JPA Applications== | ==Creating Deployment Files for JPA Applications== | ||
See [[Packaging and Deploying EclipseLink JPA Applications (ELUG)|Packaging and Deploying EclipseLink JPA Applications]] for information on how to create deployment files for your JPA application. | See [[Packaging and Deploying EclipseLink JPA Applications (ELUG)|Packaging and Deploying EclipseLink JPA Applications]] for information on how to create deployment files for your JPA application. | ||
+ | |||
+ | |||
==Creating Deployment Files for EclipseLink Database Web Services== | ==Creating Deployment Files for EclipseLink Database Web Services== | ||
This section describes how to automatically generate a WAR file containing the WSDL and all deployment files a EclipseLink database Web service requires, including the following: | This section describes how to automatically generate a WAR file containing the WSDL and all deployment files a EclipseLink database Web service requires, including the following: | ||
− | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]] | + | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]] |
− | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]] | + | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]] |
− | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure]] | + | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure]] |
− | * [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization]] | + | * [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization|How to Customize a EclipseLink Database Web Service Using Java: Session Customization]] |
− | * [[#How to Customize a EclipseLink Database Web Service Using project.xml and sessions.xml]] | + | * [[#How to Customize a EclipseLink Database Web Service Using project.xml and sessions.xml|How to Customize a EclipseLink Database Web Service Using project.xml and sessions.xml]] |
− | * [[#How to Configure Ant to Use EclipseLink Database Web Services Tasks]] | + | * [[#How to Configure Ant to Use EclipseLink Database Web Services Tasks|ow to Configure Ant to Use EclipseLink Database Web Services Tasks]] |
− | * [[#What You May Need to Know About Creating Deployment Files for a EclipseLink Database Web Service]] | + | * [[#What You May Need to Know About Creating Deployment Files for a EclipseLink Database Web Service|What You May Need to Know About Creating Deployment Files for a EclipseLink Database Web Service]] |
Line 449: | Line 464: | ||
> | > | ||
− | <Table | + | <Table <!-- Generates CRUD operations --> |
catalogPattern="%" | catalogPattern="%" | ||
schemaPattern="SCOTT" | schemaPattern="SCOTT" | ||
tableNamePattern="XR_EMP" | tableNamePattern="XR_EMP" | ||
> | > | ||
− | <Operations> | + | <Operations> <!-- Additional operations --> |
<SQLOperation | <SQLOperation | ||
name="findXREmpByName" | name="findXREmpByName" | ||
Line 486: | Line 501: | ||
</BuildDBWSWar> | </BuildDBWSWar> | ||
</div><br>Optionally, specify a <tt>SessionCustomizer</tt> class name using the <tt>BuildDBWSWar</tt> attribute <tt>sessionCustomizerClassName</tt>.For more information, see the following: | </div><br>Optionally, specify a <tt>SessionCustomizer</tt> class name using the <tt>BuildDBWSWar</tt> attribute <tt>sessionCustomizerClassName</tt>.For more information, see the following: | ||
− | * [[#BuildDBWSWar]] | + | * [[#BuildDBWSWar|BuildDBWSWar]] |
− | * [[#GenerateFromTables]] | + | * [[#GenerateFromTables|GenerateFromTables]] |
− | * [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization]] | + | * [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization|How to Customize a EclipseLink Database Web Service Using Java: Session Customization]] |
− | * [[#EclipseLink Database Web Services WAR File]]</li> | + | * [[#EclipseLink Database Web Services WAR File|EclipseLink Database Web Services WAR File]]</li> |
<li> Package and deploy the EclipseLink database Web service. For more information, see the following: | <li> Package and deploy the EclipseLink database Web service. For more information, see the following: | ||
* [[Packaging%20a%20EclipseLink%20Application%20(ELUG)|Packaging a EclipseLink Database Web Service]] | * [[Packaging%20a%20EclipseLink%20Application%20(ELUG)|Packaging a EclipseLink Database Web Service]] | ||
* [[Deploying%20a%20EclipseLink%20Application%20(ELUG)|Deploying a EclipseLink Database Web Service]]</li></ol> | * [[Deploying%20a%20EclipseLink%20Application%20(ELUG)|Deploying a EclipseLink Database Web Service]]</li></ol> | ||
+ | |||
+ | |||
===How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL=== | ===How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL=== | ||
Line 535: | Line 552: | ||
</div> | </div> | ||
Optionally, specify a <tt>SessionCustomizer</tt> class name using the <tt>BuildDBWSWar</tt> attribute <tt>sessionCustomizerClassName</tt>.For more information, see the following: | Optionally, specify a <tt>SessionCustomizer</tt> class name using the <tt>BuildDBWSWar</tt> attribute <tt>sessionCustomizerClassName</tt>.For more information, see the following: | ||
− | * [[#BuildDBWSWar]] | + | * [[#BuildDBWSWar|BuildDBWSWar]] |
− | * [[#GenerateFromSQL]] | + | * [[#GenerateFromSQL|GenerateFromSQL]] |
− | * [[#SQLOperation]] | + | * [[#SQLOperation|SQLOperation]] |
− | * [[#Binding]] | + | * [[#Binding|Binding]] |
− | * [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization]] | + | * [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization|How to Customize a EclipseLink Database Web Service Using Java: Session Customization]] |
− | * [[#EclipseLink Database Web Services WAR File]]</li></ol> | + | * [[#EclipseLink Database Web Services WAR File|EclipseLink Database Web Services WAR File]]</li></ol> |
<li> Package and deploy the EclipseLink database Web service.For more information, see the following: | <li> Package and deploy the EclipseLink database Web service.For more information, see the following: | ||
* [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#CHDCHGEC|Packaging a EclipseLink Database Web Service]] | * [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#CHDCHGEC|Packaging a EclipseLink Database Web Service]] | ||
Line 546: | Line 563: | ||
</ol> | </ol> | ||
− | |||
+ | |||
+ | ===How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure=== | ||
You can generate a EclipseLink database Web service from one or more stored procedures, stored functions, and triggers defined in an existing relational database schema using Ant. | You can generate a EclipseLink database Web service from one or more stored procedures, stored functions, and triggers defined in an existing relational database schema using Ant. | ||
Line 580: | Line 598: | ||
</div> | </div> | ||
Optionally, specify a <tt>SessionCustomizer</tt> class name using the <tt>BuildDBWSWar</tt> attribute <tt>sessionCustomizerClassName</tt>.For more information, see the following: | Optionally, specify a <tt>SessionCustomizer</tt> class name using the <tt>BuildDBWSWar</tt> attribute <tt>sessionCustomizerClassName</tt>.For more information, see the following: | ||
− | * [[#BuildDBWSWar]] | + | * [[#BuildDBWSWar|BuildDBWSWar]] |
− | * [[#GenerateFromStoredProcedures]] | + | * [[#GenerateFromStoredProcedures|GenerateFromStoredProcedures]] |
− | * [[#Operations]] | + | * [[#Operations|Operations]] |
− | * [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization]] | + | * [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization|How to Customize a EclipseLink Database Web Service Using Java: Session Customization]] |
− | * [[#EclipseLink Database Web Services WAR File]]</li> | + | * [[#EclipseLink Database Web Services WAR File|EclipseLink Database Web Services WAR File]]</li> |
<li> Package and deploy the EclipseLink database Web service.For more information, see the following: | <li> Package and deploy the EclipseLink database Web service.For more information, see the following: | ||
* [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#CHDCHGEC|Packaging a EclipseLink Database Web Service]] | * [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#CHDCHGEC|Packaging a EclipseLink Database Web Service]] | ||
Line 590: | Line 608: | ||
</ol> | </ol> | ||
− | |||
+ | |||
+ | ===How to Customize a EclipseLink Database Web Service Using Java: Session Customization=== | ||
You can customize a EclipseLink database Web service with a EclipseLink <tt>SessionCustomizer</tt>. | You can customize a EclipseLink database Web service with a EclipseLink <tt>SessionCustomizer</tt>. | ||
Line 608: | Line 627: | ||
} | } | ||
} | } | ||
− | </div><br>For more information, see [[#Customizing EclipseLink Database Web Services]].</li> | + | </div><br>For more information, see [[#Customizing EclipseLink Database Web Services|Customizing EclipseLink Database Web Services]].</li> |
<li> Add the <tt>SessionCustomizer</tt> to the Ant classpath.</li> | <li> Add the <tt>SessionCustomizer</tt> to the Ant classpath.</li> | ||
− | <li> Execute the <tt>BuildDBWSWar</tt> Ant task, as | + | <li> Execute the <tt>BuildDBWSWar</tt> Ant task, as this example shows.When you execute the <tt>BuildDBWSWar</tt> Ant task, specify the <tt>SessionCustomizer</tt> class name using the <tt>BuildDBWSWar</tt> attribute <tt>sessionCustomizerClassName</tt>.<br><span id="Example 8-8"></span>''''' Building the EclipseLink Database Web Service WAR File With a Session Customizer''''' <div class="tt"> |
<BuildDBWSWar | <BuildDBWSWar | ||
Line 626: | Line 645: | ||
</div><br>For more information, see the following: | </div><br>For more information, see the following: | ||
− | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]] | + | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]] |
− | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]] | + | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]] |
− | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure]] | + | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure]] |
− | * [[#BuildDBWSWar]] | + | * [[#BuildDBWSWar|BuildDBWSWar]] |
− | * [[#EclipseLink Database Web Services WAR File]]</li> | + | * [[#EclipseLink Database Web Services WAR File|EclipseLink Database Web Services WAR File]]</li> |
<li> Package and deploy the EclipseLink database Web service.For more information, see the following: | <li> Package and deploy the EclipseLink database Web service.For more information, see the following: | ||
* [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#CHDCHGEC|Packaging a EclipseLink Database Web Service]] | * [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#CHDCHGEC|Packaging a EclipseLink Database Web Service]] | ||
Line 638: | Line 657: | ||
===How to Customize a EclipseLink Database Web Service Using project.xml and sessions.xml=== | ===How to Customize a EclipseLink Database Web Service Using project.xml and sessions.xml=== | ||
− | |||
You can customize a EclipseLink database Web service by creating your own <tt>project.xml</tt> and <tt>sessions.xml</tt> files. | You can customize a EclipseLink database Web service by creating your own <tt>project.xml</tt> and <tt>sessions.xml</tt> files. | ||
Line 660: | Line 678: | ||
</div><br>Executing the <tt>BuildDBWSWar</tt> Ant task with a generator creates the necessary EclipseLink database Web service files and subdirectories. | </div><br>Executing the <tt>BuildDBWSWar</tt> Ant task with a generator creates the necessary EclipseLink database Web service files and subdirectories. | ||
For more information, see the following: | For more information, see the following: | ||
− | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]] | + | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]] |
− | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]] | + | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]] |
− | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure]] | + | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure]] |
− | * [[#BuildDBWSWar]]</li> | + | * [[#BuildDBWSWar|BuildDBWSWar]]</li> |
<li> Manually create your <tt>project.xml</tt> files and <tt>sessions.xml</tt> file using the Workbench: | <li> Manually create your <tt>project.xml</tt> files and <tt>sessions.xml</tt> file using the Workbench: | ||
* Map your objects to your relational database in a EclipseLink relational project (see [[Introduction%20to%20Relational%20Projects%20(ELUG)#BABECJJD|Introduction to Relational Projects]]). | * Map your objects to your relational database in a EclipseLink relational project (see [[Introduction%20to%20Relational%20Projects%20(ELUG)#BABECJJD|Introduction to Relational Projects]]). | ||
Line 674: | Line 692: | ||
* [[Introduction%20to%20Projects (ELUG)|Introduction to Projects]] | * [[Introduction%20to%20Projects (ELUG)|Introduction to Projects]] | ||
* [[Introduction%20to%20EclipseLink%20Sessions%20(ELUG)#CACJAFDF|Introduction to EclipseLink Sessions]] | * [[Introduction%20to%20EclipseLink%20Sessions%20(ELUG)#CACJAFDF|Introduction to EclipseLink Sessions]] | ||
− | * [[#What You May Need to Know About Creating Deployment Files for a EclipseLink Database Web Service]]</li> | + | * [[#What You May Need to Know About Creating Deployment Files for a EclipseLink Database Web Service|What You May Need to Know About Creating Deployment Files for a EclipseLink Database Web Service]]</li> |
<li> Replace the generated <tt>project.xml</tt> files and <tt>sessions.xml</tt> file in your EclipseLink database Web services directory hierarchy with your custom <tt>project.xml</tt> files and <tt>sessions.xml</tt> files.</li> | <li> Replace the generated <tt>project.xml</tt> files and <tt>sessions.xml</tt> file in your EclipseLink database Web services directory hierarchy with your custom <tt>project.xml</tt> files and <tt>sessions.xml</tt> files.</li> | ||
<li> Execute the <tt>BuildDBWSWar</tt> Ant task without a generator, as the following example shows.<br><span id="Example 8-10"></span>''''' Building the EclipseLink Database Web Service WAR File''''' | <li> Execute the <tt>BuildDBWSWar</tt> Ant task without a generator, as the following example shows.<br><span id="Example 8-10"></span>''''' Building the EclipseLink Database Web Service WAR File''''' | ||
Line 692: | Line 710: | ||
</div> | </div> | ||
Executing the <tt>BuildDBWSWar</tt> Ant task without a generator assembles the EclipseLink database Web service files in the subdirectory of the current working directory named according to the <tt>EclipseLinkProjectName</tt> attribute.For more information, see the following: | Executing the <tt>BuildDBWSWar</tt> Ant task without a generator assembles the EclipseLink database Web service files in the subdirectory of the current working directory named according to the <tt>EclipseLinkProjectName</tt> attribute.For more information, see the following: | ||
− | * [[#BuildDBWSWar]] | + | * [[#BuildDBWSWar|BuildDBWSWar]] |
− | * [[#EclipseLink Database Web Services WAR File]]</li> | + | * [[#EclipseLink Database Web Services WAR File|EclipseLink Database Web Services WAR File]]</li> |
<li> Package and deploy the EclipseLink database Web service.For more information, see the following: | <li> Package and deploy the EclipseLink database Web service.For more information, see the following: | ||
− | * [[Packaging%20a%20EclipseLink%20Application%20(ELUG)# | + | * [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#Packaging a EclipseLink Database Web Service|Packaging a EclipseLink Database Web Service]] |
− | * [[Deploying%20a%20EclipseLink%20Application%20(ELUG)# | + | * [[Deploying%20a%20EclipseLink%20Application%20(ELUG)#Deploying a EclipseLink Database Web Service|Deploying a EclipseLink Database Web Service]]</li> |
</ol> | </ol> | ||
+ | |||
+ | |||
===How to Configure Ant to Use EclipseLink Database Web Services Tasks=== | ===How to Configure Ant to Use EclipseLink Database Web Services Tasks=== | ||
Line 717: | Line 737: | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r2c1-t8" headers="r1c1-t8" align="left" | | | id="r2c1-t8" headers="r1c1-t8" align="left" | | ||
− | <tt> | + | <tt>eclipselink-dbws-tools.jar</tt> |
| headers="r2c1-t8 r1c2-t8" align="left" | | | headers="r2c1-t8 r1c2-t8" align="left" | | ||
EclipseLink database Web services Ant tasks and type definitions. | EclipseLink database Web services Ant tasks and type definitions. | ||
Line 723: | Line 743: | ||
<tt><</tt>''<tt>ECLIPSELINK_HOME</tt>''<tt>>/lib/java/shared/org.eclipse.persistence.dbws/11.1.1.0.0</tt> | <tt><</tt>''<tt>ECLIPSELINK_HOME</tt>''<tt>>/lib/java/shared/org.eclipse.persistence.dbws/11.1.1.0.0</tt> | ||
|}<br></li> | |}<br></li> | ||
− | <li> Declare EclipseLink database Web service tasks in a <tt>eclipselinkant-lib.xml</tt> file, as | + | <li> Declare EclipseLink database Web service tasks in a <tt>eclipselinkant-lib.xml</tt> file, as this example shows.<span id="Example 8-11"></span><br>''''' eclipselink-ant-lib.xml File for EclipseLink Database Web Service Ant Tasks''''' |
<div class="pre"> | <div class="pre"> | ||
<?xml version="1.0"?> | <?xml version="1.0"?> | ||
Line 753: | Line 773: | ||
</antlib> | </antlib> | ||
</div></li> | </div></li> | ||
− | <li> Include the <tt> | + | <li> Include the <tt>eclipselink-ant-lib.xml</tt> file in your Ant <tt>build.xml</tt> file, as [[#Example 8-12|Specifying the eclipselink-ant-lib.xml File in a build.xml File]] shows.<br><span id="Example 8-12"></span>''''' Specifying the eclipselink-ant-lib.xml File in a build.xml File''''' |
<div class="pre"> | <div class="pre"> | ||
<project name="MyBuild" default="validate.session" basedir="." xmlns:eclispelink="eclispelinklib"> | <project name="MyBuild" default="validate.session" basedir="." xmlns:eclispelink="eclispelinklib"> | ||
Line 762: | Line 782: | ||
</li> | </li> | ||
</ol> | </ol> | ||
+ | |||
===What You May Need to Know About Creating Deployment Files for a EclipseLink Database Web Service=== | ===What You May Need to Know About Creating Deployment Files for a EclipseLink Database Web Service=== | ||
− | + | This figure illustrates the process for creating EclipseLink database Web service deployment files. | |
− | + | ||
Line 782: | Line 802: | ||
* [[Introduction to EclipseLink%20Application%20Development%20(ELUG)#Considering EclipseLink Database Web Service Architecture|Considering EclipseLink Database Web Service Architecture]] | * [[Introduction to EclipseLink%20Application%20Development%20(ELUG)#Considering EclipseLink Database Web Service Architecture|Considering EclipseLink Database Web Service Architecture]] | ||
− | * [[# | + | * [[#eclipselink-dbws.xml File|eclipselink-dbws.xml File]]. |
* [[Packaging%20a%20EclipseLink%20Application%20(ELUG)|Packaging a EclipseLink Database Web Service]] | * [[Packaging%20a%20EclipseLink%20Application%20(ELUG)|Packaging a EclipseLink Database Web Service]] | ||
* [[Deploying%20a%20EclipseLink%20Application%20(ELUG)|Deploying a EclipseLink Database Web Service]] | * [[Deploying%20a%20EclipseLink%20Application%20(ELUG)|Deploying a EclipseLink Database Web Service]] | ||
Line 789: | Line 809: | ||
====EclipseLink Database Web Services Ant Tasks==== | ====EclipseLink Database Web Services Ant Tasks==== | ||
− | + | This table lists the Ant tasks that you can use to generate EclipseLink database Web services. | |
− | + | ||
Line 796: | Line 815: | ||
''''' EclipseLink Database Web Services Ant Tasks''''' | ''''' EclipseLink Database Web Services Ant Tasks''''' | ||
− | {| class="RuleFormalMax" dir="ltr" title="EclipseLink Database Web Services Ant Tasks" summary="This table lists the EclipseLinkdatabase Web service Ant tasks and their | + | {| class="RuleFormalMax" dir="ltr" title="EclipseLink Database Web Services Ant Tasks" summary="This table lists the EclipseLinkdatabase Web service Ant tasks and their EclipseLink Java class equivalent." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" |
|- align="left" valign="top" | |- align="left" valign="top" | ||
! id="r1c1-t9" align="left" valign="bottom" | '''Task''' | ! id="r1c1-t9" align="left" valign="bottom" | '''Task''' | ||
Line 802: | Line 821: | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r2c1-t9" headers="r1c1-t9" align="left" | | | id="r2c1-t9" headers="r1c1-t9" align="left" | | ||
− | [[#Binding]]<br> | + | [[#Binding|Binding]]<br> |
| headers="r2c1-t9 r1c2-t9" align="left" | | | headers="r2c1-t9 r1c2-t9" align="left" | | ||
<tt>org.eclipse.persistence.tools.dbws.Binding</tt> | <tt>org.eclipse.persistence.tools.dbws.Binding</tt> | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r3c1-t9" headers="r1c1-t9" align="left" | | | id="r3c1-t9" headers="r1c1-t9" align="left" | | ||
− | [[#BuildDBWSWar]]<br> | + | [[#BuildDBWSWar|BuildDBWSWar]]<br> |
| headers="r3c1-t9 r1c2-t9" align="left" | | | headers="r3c1-t9 r1c2-t9" align="left" | | ||
<tt>org.eclipse.persistence.tools.dbws.BuildDBWSWar</tt> | <tt>org.eclipse.persistence.tools.dbws.BuildDBWSWar</tt> | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r4c1-t9" headers="r1c1-t9" align="left" | | | id="r4c1-t9" headers="r1c1-t9" align="left" | | ||
− | [[#GenerateFromSQL]]<br> | + | [[#GenerateFromSQL|GenerateFromSQL]]<br> |
| headers="r4c1-t9 r1c2-t9" align="left" | | | headers="r4c1-t9 r1c2-t9" align="left" | | ||
<tt>org.eclipse.persistence.tools.dbws.GenerateFromSQL</tt> | <tt>org.eclipse.persistence.tools.dbws.GenerateFromSQL</tt> | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r5c1-t9" headers="r1c1-t9" align="left" | | | id="r5c1-t9" headers="r1c1-t9" align="left" | | ||
− | [[#GenerateFromStoredProcedures]]<br> | + | [[#GenerateFromStoredProcedures|GenerateFromStoredProcedures]]<br> |
| headers="r5c1-t9 r1c2-t9" align="left" | | | headers="r5c1-t9 r1c2-t9" align="left" | | ||
<tt>org.eclipse.persistence.tools.dbws.GenerateFromStoredProcedure</tt> | <tt>org.eclipse.persistence.tools.dbws.GenerateFromStoredProcedure</tt> | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r6c1-t9" headers="r1c1-t9" align="left" | | | id="r6c1-t9" headers="r1c1-t9" align="left" | | ||
− | [[#GenerateFromTables]]<br> | + | [[#GenerateFromTables|GenerateFromTables]]<br> |
| headers="r6c1-t9 r1c2-t9" align="left" | | | headers="r6c1-t9 r1c2-t9" align="left" | | ||
<tt>org.eclipse.persistence.tools.dbws.GenerateFromTables</tt> | <tt>org.eclipse.persistence.tools.dbws.GenerateFromTables</tt> | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r7c1-t9" headers="r1c1-t9" align="left" | | | id="r7c1-t9" headers="r1c1-t9" align="left" | | ||
− | [[#Operations]]<br> | + | [[#Operations|Operations]]<br> |
| headers="r7c1-t9 r1c2-t9" align="left" | | | headers="r7c1-t9 r1c2-t9" align="left" | | ||
<tt>org.eclipse.persistence.tools.dbws.Operations</tt> | <tt>org.eclipse.persistence.tools.dbws.Operations</tt> | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r8c1-t9" headers="r1c1-t9" align="left" | | | id="r8c1-t9" headers="r1c1-t9" align="left" | | ||
− | [[#Procedure]]<br> | + | [[#Procedure|Procedure]]<br> |
| headers="r8c1-t9 r1c2-t9" align="left" | | | headers="r8c1-t9 r1c2-t9" align="left" | | ||
<tt>org.eclipse.persistence.tools.dbws.Procedure</tt> | <tt>org.eclipse.persistence.tools.dbws.Procedure</tt> | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r9c1-t9" headers="r1c1-t9" align="left" | | | id="r9c1-t9" headers="r1c1-t9" align="left" | | ||
− | [[#SQLOperation]]<br> | + | [[#SQLOperation|SQLOperation]]<br> |
| headers="r9c1-t9 r1c2-t9" align="left" | | | headers="r9c1-t9 r1c2-t9" align="left" | | ||
<tt>org.eclipse.persistence.tools.dbws.SQLOperation</tt> | <tt>org.eclipse.persistence.tools.dbws.SQLOperation</tt> | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r10c1-t9" headers="r1c1-t9" align="left" | | | id="r10c1-t9" headers="r1c1-t9" align="left" | | ||
− | [[#Table]]<br> | + | [[#Table|Table]]<br> |
| headers="r10c1-t9 r1c2-t9" align="left" | | | headers="r10c1-t9 r1c2-t9" align="left" | | ||
<tt>org.eclipse.persistence.tools.dbws.Table</tt> | <tt>org.eclipse.persistence.tools.dbws.Table</tt> | ||
Line 849: | Line 868: | ||
<br> | <br> | ||
− | You can invoke these Ant tasks directly on the command line or within your application's build system. For more information, see [[#How to Configure Ant to Use EclipseLink Database Web Services Tasks]]. | + | You can invoke these Ant tasks directly on the command line or within your application's build system. For more information, see [[#How to Configure Ant to Use EclipseLink Database Web Services Tasks|How to Configure Ant to Use EclipseLink Database Web Services Tasks]]. |
====EclipseLink Database Web Services WAR File==== | ====EclipseLink Database Web Services WAR File==== | ||
− | When you generate a EclipseLink database Web service, all generated files are packaged into a WAR file, as the following example shows. [[#table_8_5| | + | When you generate a EclipseLink database Web service, all generated files are packaged into a WAR file, as the following example shows. [[#table_8_5|EclipseLink Database Web Service WAR File Contents]] lists the files in these WAR files. |
− | For more information, see [[#EclipseLink Database Web Services Ant Tasks]]. | + | For more information, see [[#EclipseLink Database Web Services Ant Tasks|EclipseLink Database Web Services Ant Tasks]]. |
<span id="Example 8-13"></span> | <span id="Example 8-13"></span> | ||
''''' EclipseLink Database Web Services WAR File''''' | ''''' EclipseLink Database Web Services WAR File''''' | ||
− | + | eclipselink-dbws.war | |
indexl | indexl | ||
swaref.xsd | swaref.xsd | ||
Line 884: | Line 903: | ||
<span id="table_8_5"></span> | <span id="table_8_5"></span> | ||
− | ''''' | + | '''''EclipseLink Database Web Service WAR File Contents''''' |
{| class="RuleFormalMax" dir="ltr" title="EclipseLink Database Web Service WAR File Contents" summary="This table lists the files in a EclipseLink database Web service WAR file." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | {| class="RuleFormalMax" dir="ltr" title="EclipseLink Database Web Service WAR File Contents" summary="This table lists the files in a EclipseLink database Web service WAR file." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | ||
Line 904: | Line 923: | ||
<tt>topink-dbws-schema.xsd</tt> | <tt>topink-dbws-schema.xsd</tt> | ||
| headers="r4c1-t10 r1c2-t10" align="left" | | | headers="r4c1-t10 r1c2-t10" align="left" | | ||
− | Contains XML type definitions for operation arguments and return types. The EclipseLink database Web service automatically generates this file from your database table metadata and uses it to derive element-tag names and types. For more information, see [[#eclispelink-dbws-schema.xsd]]. | + | Contains XML type definitions for operation arguments and return types. The EclipseLink database Web service automatically generates this file from your database table metadata and uses it to derive element-tag names and types. For more information, see [[#eclispelink-dbws-schema.xsd|eclispelink-dbws-schema.xsd]]. |
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r5c1-t10" headers="r1c1-t10" align="left" | | | id="r5c1-t10" headers="r1c1-t10" align="left" | | ||
Line 924: | Line 943: | ||
<tt>eclispelink-dbws.xml</tt> | <tt>eclispelink-dbws.xml</tt> | ||
| headers="r8c1-t10 r1c2-t10" align="left" | | | headers="r8c1-t10 r1c2-t10" align="left" | | ||
− | The EclipseLink database Web services configuration file.For more information, see [[#eclispelink-dbws.xml File]]. | + | The EclipseLink database Web services configuration file.For more information, see [[#eclispelink-dbws.xml File|eclispelink-dbws.xml File]]. |
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r9c1-t10" headers="r1c1-t10" align="left" | | | id="r9c1-t10" headers="r1c1-t10" align="left" | | ||
Line 952: | Line 971: | ||
For more information, see the following: | For more information, see the following: | ||
+ | * [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#Packaging a EclipseLink Database Web Service|Packaging a EclipseLink Database Web Service]] | ||
+ | * [[Deploying%20a%20EclipseLink%20Application%20(ELUG)#Deploying a EclipseLink Database Web Service|Deploying a EclipseLink Database Web Service]] | ||
+ | |||
− | |||
− | |||
====Unstructured Data==== | ====Unstructured Data==== | ||
Line 964: | Line 984: | ||
* scalar results such as from a stored function or a count of updated-rows from an update operation. | * scalar results such as from a stored function or a count of updated-rows from an update operation. | ||
− | The OC4J Web services provider will return such unstructured data as documents that conform to the Simple XML Format (SXF) schema shown in | + | The OC4J Web services provider will return such unstructured data as documents that conform to the Simple XML Format (SXF) schema shown in this example. |
Line 987: | Line 1,007: | ||
* The default root-element tag name is simple-xml-format and each row uses the tag name simple-xml. You can customize these element tag names using attributes <tt>simpleXMLFormatTag</tt> and <tt>xmlTag</tt> in Ant tasks and. | * The default root-element tag name is simple-xml-format and each row uses the tag name simple-xml. You can customize these element tag names using attributes <tt>simpleXMLFormatTag</tt> and <tt>xmlTag</tt> in Ant tasks and. | ||
* Columnar data uses tag names taken either from the database schema (the actual database column name) or from the stored procedure, stored function, or trigger. | * Columnar data uses tag names taken either from the database schema (the actual database column name) or from the stored procedure, stored function, or trigger. | ||
− | * If a column is a primary key, the EclipseLink database Web service adds a <tt>isPrimaryKey</tt> attribute to the column tag and sets it to <tt>true</tt>, as shown for <tt>EMPNO</tt> in | + | * If a column is a primary key, the EclipseLink database Web service adds a <tt>isPrimaryKey</tt> attribute to the column tag and sets it to <tt>true</tt>, as shown for <tt>EMPNO</tt> in this example. |
Line 1,021: | Line 1,041: | ||
For more information, see the following: | For more information, see the following: | ||
+ | * [[#GenerateFromSQL|GenerateFromSQL]] | ||
+ | * [[#GenerateFromStoredProcedures|GenerateFromStoredProcedures]] | ||
+ | * [[#Operations|Operations]] | ||
− | |||
− | |||
− | |||
− | |||
+ | ====Customizing EclipseLink Database Web Services==== | ||
To customize a EclipseLink database Web service, you can do the following: | To customize a EclipseLink database Web service, you can do the following: | ||
− | * Implement a EclipseLink <tt>SessionCustomizer</tt> class.A <tt>SessionCustomizer</tt> is a Java class that implements the <tt>org.eclipse.persistence.sessionconfiguration.SessionCustomizer</tt> interface and provides a default (zero-argument) constructor.Use this class's <tt>customize</tt> method, which takes an <tt>oracle.toplink.essentials.sessions.Session</tt>, to programmatically access advanced EclipseLink session API. Using this API you can get object relational and XML descriptors and from descriptors, you can get object relational and XML mappings.In this way, you can access all session, descriptor, and mapping API to customize any part of the EclipseLink runtime that the EclipseLink database Web service generates. For example, to turn off the session cache. This approach is best when you just want to customize a few details.You specify the <tt>SessionCustomizer</tt> when you execute the [[#BuildDBWSWar]] Ant task.By default, the session names are defined based on the <tt> | + | * Implement a EclipseLink <tt>SessionCustomizer</tt> class.A <tt>SessionCustomizer</tt> is a Java class that implements the <tt>org.eclipse.persistence.sessionconfiguration.SessionCustomizer</tt> interface and provides a default (zero-argument) constructor.Use this class's <tt>customize</tt> method, which takes an <tt>oracle.toplink.essentials.sessions.Session</tt>, to programmatically access advanced EclipseLink session API. Using this API you can get object relational and XML descriptors and from descriptors, you can get object relational and XML mappings.<br>In this way, you can access all session, descriptor, and mapping API to customize any part of the EclipseLink runtime that the EclipseLink database Web service generates. For example, to turn off the session cache. This approach is best when you just want to customize a few details.You specify the <tt>SessionCustomizer</tt> when you execute the [[#BuildDBWSWar|BuildDBWSWar]] Ant task.By default, the session names are defined based on the <tt>eclipselink-dbws.xml</tt> file <tt>name</tt> attribute as follows: |
** relational session name: ''<tt>name</tt>''<tt>-dbws-or-session</tt> | ** relational session name: ''<tt>name</tt>''<tt>-dbws-or-session</tt> | ||
** object-xml session name: ''<tt>name</tt>''<tt>-dbws-ox-session</tt> | ** object-xml session name: ''<tt>name</tt>''<tt>-dbws-ox-session</tt> | ||
Line 1,037: | Line 1,057: | ||
For more information, see the following: | For more information, see the following: | ||
− | * [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization]] | + | * [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization|How to Customize a EclipseLink Database Web Service Using Java: Session Customization]] |
− | * [[#How to Customize a EclipseLink Database Web Service Using project.xml and sessions.xml]] | + | * [[#How to Customize a EclipseLink Database Web Service Using project.xml and sessions.xml|How to Customize a EclipseLink Database Web Service Using project.xml and sessions.xml]] |
− | * [[#BuildDBWSWar]] | + | * [[#BuildDBWSWar|BuildDBWSWar]] |
* ''EclipseLink API Reference'' | * ''EclipseLink API Reference'' | ||
+ | |||
+ | |||
===Binding=== | ===Binding=== | ||
− | |||
The <tt>Binding</tt> Ant task is a EclipseLink database Web services task you use to bind an argument in an SQL statement to an XSD data type. | The <tt>Binding</tt> Ant task is a EclipseLink database Web services task you use to bind an argument in an SQL statement to an XSD data type. | ||
Line 1,051: | Line 1,072: | ||
====Using Parameters==== | ====Using Parameters==== | ||
− | |||
− | |||
<span id="Table 8-6"></span> | <span id="Table 8-6"></span> | ||
''''' Binding Task Parameters''''' | ''''' Binding Task Parameters''''' | ||
Line 1,065: | Line 1,084: | ||
<tt>name</tt> | <tt>name</tt> | ||
| headers="r2c1-t11 r1c2-t11" align="left" | | | headers="r2c1-t11 r1c2-t11" align="left" | | ||
− | The name of the stored procedure, stored function, or trigger to execute. The parent task that owns the <tt>Operation</tt> specifies the database that provides the stored procedure, stored function, or trigger.For more information, see [[#GenerateFromSQL]]. | + | The name of the stored procedure, stored function, or trigger to execute. The parent task that owns the <tt>Operation</tt> specifies the database that provides the stored procedure, stored function, or trigger.For more information, see [[#GenerateFromSQL|GenerateFromSQL]]. |
| headers="r2c1-t11 r1c3-t11" align="left" | | | headers="r2c1-t11 r1c3-t11" align="left" | | ||
Yes | Yes | ||
Line 1,113: | Line 1,132: | ||
− | For more information, see [[#SQLOperation]]. | + | For more information, see [[#SQLOperation|SQLOperation]]. |
===BuildDBWSWar=== | ===BuildDBWSWar=== | ||
Line 1,120: | Line 1,139: | ||
When you execute the <tt>BuildDBWSWar</tt> task with a generator, the <tt>BuildDBWSWar</tt> task generates EclipseLink database Web services files and assemble them into a Web Archive (WAR) file. The <tt>BuildDBWSWar</tt> task supports the following generators: | When you execute the <tt>BuildDBWSWar</tt> task with a generator, the <tt>BuildDBWSWar</tt> task generates EclipseLink database Web services files and assemble them into a Web Archive (WAR) file. The <tt>BuildDBWSWar</tt> task supports the following generators: | ||
− | + | * [[#GenerateFromSQL|GenerateFromSQL]] | |
− | * | + | * [[#GenerateFromStoredProcedures|GenerateFromStoredProcedures]] |
− | * | + | * [[#GenerateFromTables|GenerateFromTables]] |
− | * | + | |
When you execute the <tt>BuildDBWSWar</tt> task without a generator, the <tt>BuildDBWSWar</tt> task assembles EclipseLink database Web services files in a subdirectory of the current working directory named according to the <tt>EclipseLinkProjectName</tt> attribute into a Web Archive (WAR) file. | When you execute the <tt>BuildDBWSWar</tt> task without a generator, the <tt>BuildDBWSWar</tt> task assembles EclipseLink database Web services files in a subdirectory of the current working directory named according to the <tt>EclipseLinkProjectName</tt> attribute into a Web Archive (WAR) file. | ||
Line 1,134: | Line 1,152: | ||
====Using Parameters==== | ====Using Parameters==== | ||
− | |||
− | |||
<span id="Table 8-7"></span> | <span id="Table 8-7"></span> | ||
''''' BuildDBWSWar Task Parameters''''' | ''''' BuildDBWSWar Task Parameters''''' | ||
Line 1,151: | Line 1,167: | ||
Reference to a path defined elsewhere.The EclipseLink database Web services classpath must includes references to: | Reference to a path defined elsewhere.The EclipseLink database Web services classpath must includes references to: | ||
* JDBC driver | * JDBC driver | ||
− | * EclipseLink database platform (see [[#platformClassName]]) | + | * EclipseLink database platform (see [[#platformClassName|platformClassName]]) |
− | * EclipseLink session customizer class, if used (see <tt>[[#sessionCustomizerClassName]]</tt>) | + | * EclipseLink session customizer class, if used (see <tt>[[#sessionCustomizerClassName|sessionCustomizerClassName]]</tt>) |
− | * <tt> | + | * <tt>eclipselink-xr-tools.jar</tt> file that contains the EclipseLink database Web services Ant tasksAlternatively, you can use a nested Ant [http://ant.apache.org/manual/usingl#path <tt>classpath</tt>] element. |
| headers="r2c1-t12 r1c3-t12" align="left" | | | headers="r2c1-t12 r1c3-t12" align="left" | | ||
Yes | Yes | ||
Line 1,240: | Line 1,256: | ||
* relational session name: ''<tt>projectName</tt>''<tt>-dbws-or-session</tt> | * relational session name: ''<tt>projectName</tt>''<tt>-dbws-or-session</tt> | ||
* object-xml session name: ''<tt>projectName</tt>''<tt>-dbws-ox-session</tt>The EclipseLink project file names are not configurable and are set to the following: | * object-xml session name: ''<tt>projectName</tt>''<tt>-dbws-ox-session</tt>The EclipseLink project file names are not configurable and are set to the following: | ||
− | * relational project file name: <tt> | + | * relational project file name: <tt>eclipselink-dbws-or.xml</tt> |
− | * object-xml project file name: <tt> | + | * object-xml project file name: <tt>eclipselink-dbws-ox.xml</tt> |
| headers="r8c1-t12 r1c3-t12" align="left" | | | headers="r8c1-t12 r1c3-t12" align="left" | | ||
Yes–when you execute this task with a generator to generate a new service.No–when you execute this task without a generator to assemble pre-existing metadata files. | Yes–when you execute this task with a generator to generate a new service.No–when you execute this task without a generator to assemble pre-existing metadata files. | ||
| headers="r8c1-t12 r1c4-t12" align="left" | | | headers="r8c1-t12 r1c4-t12" align="left" | | ||
− | <tt> | + | <tt>eclipselink-dbws.xml</tt> file element <tt>name</tt>. For more information, see [[#eclipselink-dbws.xml File|eclipselink-dbws.xml File]]. |
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r9c1-t12" headers="r1c1-t12" align="left" | | | id="r9c1-t12" headers="r1c1-t12" align="left" | | ||
Line 1,265: | Line 1,281: | ||
Yes–when you execute this task with a generator to generate a new service.No–when you execute this task without a generator to assemble pre-existing metadata files. | Yes–when you execute this task with a generator to generate a new service.No–when you execute this task without a generator to assemble pre-existing metadata files. | ||
| headers="r10c1-t12 r1c4-t12" align="left" | | | headers="r10c1-t12 r1c4-t12" align="left" | | ||
− | <tt> | + | <tt>eclipselink-dbws-sessions.xml</tt> |
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r11c1-t12" headers="r1c1-t12" align="left" | | | id="r11c1-t12" headers="r1c1-t12" align="left" | | ||
<tt>targetNameSpace</tt> | <tt>targetNameSpace</tt> | ||
| headers="r11c1-t12 r1c2-t12" align="left" | | | headers="r11c1-t12 r1c2-t12" align="left" | | ||
− | The URI of the target namespace that the EclipseLink database Web service inserts into the <tt> | + | The URI of the target namespace that the EclipseLink database Web service inserts into the <tt>eclipselink-dbws-schema.xsd</tt> file. For more information, see [[#eclipselink-dbws-schema.xsd]]. |
| headers="r11c1-t12 r1c3-t12" align="left" | | | headers="r11c1-t12 r1c3-t12" align="left" | | ||
No | No | ||
Line 1,286: | Line 1,302: | ||
|} | |} | ||
− | |||
− | |||
− | |||
+ | ====Specifying Parameters as Nested Elements==== | ||
+ | You can specify the following as nested elements of this task: | ||
* Ant [http://ant.apache.org/manual/usingl#path <tt>classpath</tt>] element | * Ant [http://ant.apache.org/manual/usingl#path <tt>classpath</tt>] element | ||
* [[#GenerateFromSQL|GenerateFromSQL]]; | * [[#GenerateFromSQL|GenerateFromSQL]]; | ||
Line 1,297: | Line 1,312: | ||
* [[#GenerateFromTables|GenerateFromTables]]. | * [[#GenerateFromTables|GenerateFromTables]]. | ||
− | |||
− | + | ||
+ | ====Examples==== | ||
+ | This example shows a typical <tt>BuildDBWSWar</tt> task. | ||
Line 1,309: | Line 1,325: | ||
sessionsFileName="emp-sessions.xml" | sessionsFileName="emp-sessions.xml" | ||
platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | ||
− | classpathref=" | + | classpathref="eclipselink.dbws.path" |
> | > | ||
<GenerateFromTables | <GenerateFromTables | ||
Line 1,357: | Line 1,373: | ||
For more information, see the following: | For more information, see the following: | ||
+ | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]] | ||
+ | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]] | ||
+ | * [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure]] | ||
+ | |||
− | |||
− | |||
− | |||
===GenerateFromSQL=== | ===GenerateFromSQL=== | ||
− | |||
The <tt>GenerateFromSQL</tt> task is a EclipseLink database Web services task you use to generate a Web service based on one or more SQL statements you specify with <tt>SQLOperation</tt> nested elements. You specify SQL statements with respect to the existing relational database schema that the <tt>SQLOperation</tt> element's parent identifies. | The <tt>GenerateFromSQL</tt> task is a EclipseLink database Web services task you use to generate a Web service based on one or more SQL statements you specify with <tt>SQLOperation</tt> nested elements. You specify SQL statements with respect to the existing relational database schema that the <tt>SQLOperation</tt> element's parent identifies. | ||
Line 1,373: | Line 1,389: | ||
====Using Parameters==== | ====Using Parameters==== | ||
− | |||
− | |||
<span id="Table 8-8"></span> | <span id="Table 8-8"></span> | ||
''''' GenerateFromSQL Task Parameters''''' | ''''' GenerateFromSQL Task Parameters''''' | ||
Line 1,422: | Line 1,436: | ||
|} | |} | ||
− | + | ||
====Specifying Parameters as Nested Elements==== | ====Specifying Parameters as Nested Elements==== | ||
− | |||
You can specify the following parameters as nested elements of this task: | You can specify the following parameters as nested elements of this task: | ||
− | |||
*[[#SQLOperation|SQLOperation]] | *[[#SQLOperation|SQLOperation]] | ||
*[[#Binding|Binding]] | *[[#Binding|Binding]] | ||
+ | |||
+ | |||
====Examples==== | ====Examples==== | ||
− | |||
[[#Example 8-18|GenerateFromSQL Task]] shows a typical <tt>GenerateFromSQL</tt> task that specifies an <tt>SQLOperation</tt>. | [[#Example 8-18|GenerateFromSQL Task]] shows a typical <tt>GenerateFromSQL</tt> task that specifies an <tt>SQLOperation</tt>. | ||
Line 1,445: | Line 1,458: | ||
sessionsFileName="emp-sessions.xml" | sessionsFileName="emp-sessions.xml" | ||
platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | ||
− | classpathref=" | + | classpathref="eclipselink.dbws.path" |
> | > | ||
<GenerateFromSQL | <GenerateFromSQL | ||
Line 1,470: | Line 1,483: | ||
For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]]. | For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]]. | ||
+ | |||
+ | |||
===GenerateFromStoredProcedures=== | ===GenerateFromStoredProcedures=== | ||
− | |||
The <tt>GenerateFromStoredProcedures</tt> task is a EclipseLink database Web services task you use to generate a Web service based on one or more stored procedures, stored functions, or triggers you specify with <tt>Procedure</tt> nested elements. You specify stored procedures, stored functions, or triggers with respect to the existing relational database schema that the <tt>Procedure</tt> element's parent identifies. | The <tt>GenerateFromStoredProcedures</tt> task is a EclipseLink database Web services task you use to generate a Web service based on one or more stored procedures, stored functions, or triggers you specify with <tt>Procedure</tt> nested elements. You specify stored procedures, stored functions, or triggers with respect to the existing relational database schema that the <tt>Procedure</tt> element's parent identifies. | ||
Line 1,482: | Line 1,496: | ||
====Using Parameters==== | ====Using Parameters==== | ||
− | |||
− | |||
<span id="Table 8-9"></span> | <span id="Table 8-9"></span> | ||
''''' GenerateFromStoredProcedures Task Parameters''''' | ''''' GenerateFromStoredProcedures Task Parameters''''' | ||
Line 1,531: | Line 1,543: | ||
|} | |} | ||
− | |||
− | |||
− | |||
+ | |||
+ | ====Specifying Parameters as Nested Elements==== | ||
+ | You can specify the following parameters as nested elements of this task: | ||
* [[#SQLOperation|SQLOperation]] | * [[#SQLOperation|SQLOperation]] | ||
* [[#Binding|Binding]] | * [[#Binding|Binding]] | ||
− | |||
+ | |||
+ | ====Examples==== | ||
[[#Example 8-19|GenerateFromStoredProcedures Task]] shows a typical <tt>GenerateFromStoredProcedures</tt> task that specifies a <tt>Procedure</tt> for each of two stored procedures. | [[#Example 8-19|GenerateFromStoredProcedures Task]] shows a typical <tt>GenerateFromStoredProcedures</tt> task that specifies a <tt>Procedure</tt> for each of two stored procedures. | ||
Line 1,558: | Line 1,571: | ||
sessionsFileName="emp-sessions.xml" | sessionsFileName="emp-sessions.xml" | ||
platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | ||
− | classpathref=" | + | classpathref="eclipselink.dbws.path" |
> | > | ||
<GenerateFromStoredProcedures | <GenerateFromStoredProcedures | ||
Line 1,575: | Line 1,588: | ||
</BuildDBWSWar> | </BuildDBWSWar> | ||
− | |||
For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure]]. | For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure]]. | ||
+ | |||
+ | |||
===GenerateFromTables=== | ===GenerateFromTables=== | ||
− | |||
The <tt>GenerateFromTables</tt> task is a EclipseLink database Web services task you use to generate a Web service based on one or more relational database tables. | The <tt>GenerateFromTables</tt> task is a EclipseLink database Web services task you use to generate a Web service based on one or more relational database tables. | ||
This task generates the following operations for each table you specify using one or more <tt>Table</tt> nested elements: | This task generates the following operations for each table you specify using one or more <tt>Table</tt> nested elements: | ||
− | |||
* <tt>create</tt> | * <tt>create</tt> | ||
* <tt>findAll</tt> | * <tt>findAll</tt> | ||
Line 1,599: | Line 1,611: | ||
====Using Parameters==== | ====Using Parameters==== | ||
− | + | <span id="Table 8-10"></span> | |
− | + | ''''' GenerateFromTables Task Parameters''''' | |
− | + | ||
− | ''''' | + | |
{| class="RuleFormalWideMax" dir="ltr" title="GenerateFromTables Task Parameters" summary="This table lists the attributes applicable to this task." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | {| class="RuleFormalWideMax" dir="ltr" title="GenerateFromTables Task Parameters" summary="This table lists the attributes applicable to this task." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | ||
Line 1,614: | Line 1,624: | ||
<tt>driver</tt> | <tt>driver</tt> | ||
| headers="r2c1-t15 r1c2-t15" align="left" | | | headers="r2c1-t15 r1c2-t15" align="left" | | ||
− | The fully qualified name of the JDBC driver class to use to connect to the relational database. This class must be in the task classpath.This attribute is inherited from the Ant [http://ant.apache.org/manual/CoreTasks/sqll <tt>Sql</tt>] task.'''Example:''' <tt>oracle.jdbc.OracleDriver</tt> | + | The fully qualified name of the JDBC driver class to use to connect to the relational database. This class must be in the task classpath.This attribute is inherited from the Ant [http://ant.apache.org/manual/CoreTasks/sqll <tt>Sql</tt>] task. |
+ | |||
+ | '''Example:''' <tt>oracle.jdbc.OracleDriver</tt> | ||
| headers="r2c1-t15 r1c3-t15" align="left" | | | headers="r2c1-t15 r1c3-t15" align="left" | | ||
No–Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>. | No–Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>. | ||
Line 1,632: | Line 1,644: | ||
<tt>url</tt> | <tt>url</tt> | ||
| headers="r4c1-t15 r1c2-t15" align="left" | | | headers="r4c1-t15 r1c2-t15" align="left" | | ||
− | The connection URL to use when connecting the relational database.This attribute is inherited from the Ant [http://ant.apache.org/manual/CoreTasks/sqll <tt>Sql</tt>] task.'''Example:''' <tt>jdbc:oracle:thin:@</tt>''<tt>HOST_NAME</tt>''<tt><nowiki>:</nowiki></tt>''<tt>PORT</tt>''<tt><nowiki>:</nowiki></tt>''<tt>SID</tt>'' | + | The connection URL to use when connecting the relational database.This attribute is inherited from the Ant [http://ant.apache.org/manual/CoreTasks/sqll <tt>Sql</tt>] task. |
+ | |||
+ | '''Example:''' <tt>jdbc:oracle:thin:@</tt>''<tt>HOST_NAME</tt>''<tt><nowiki>:</nowiki></tt>''<tt>PORT</tt>''<tt><nowiki>:</nowiki></tt>''<tt>SID</tt>'' | ||
| headers="r4c1-t15 r1c3-t15" align="left" | | | headers="r4c1-t15 r1c3-t15" align="left" | | ||
No–Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>. | No–Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>. | ||
Line 1,653: | Line 1,667: | ||
You can specify the following parameters as nested elements of this task: | You can specify the following parameters as nested elements of this task: | ||
− | |||
* [[#Table|Table]]–this is a mandatory element. The <tt>GenerateFromTables</tt> task requires at least one <tt>Table</tt> element. | * [[#Table|Table]]–this is a mandatory element. The <tt>GenerateFromTables</tt> task requires at least one <tt>Table</tt> element. | ||
− | |||
+ | |||
+ | ====Examples==== | ||
[[#Example 8-20|GenerateFromTables Task]] shows a typical <tt>GenerateFromTables</tt> task. | [[#Example 8-20|GenerateFromTables Task]] shows a typical <tt>GenerateFromTables</tt> task. | ||
Line 1,672: | Line 1,686: | ||
sessionsFileName="emp-sessions.xml" | sessionsFileName="emp-sessions.xml" | ||
platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | ||
− | classpathref=" | + | classpathref="eclipselink.dbws.path" |
> | > | ||
<GenerateFromTables | <GenerateFromTables | ||
Line 1,692: | Line 1,706: | ||
− | For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]]. | + | For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]]. |
− | |||
+ | |||
+ | ===Operations=== | ||
The <tt>Operations</tt> task is a EclipseLink database Web services task you use to specify one or more stored procedure or SQL operations. | The <tt>Operations</tt> task is a EclipseLink database Web services task you use to specify one or more stored procedure or SQL operations. | ||
− | This task is applicable only in <tt>Table</tt> tasks. For more information, see [[#Table]. | + | This task is applicable only in <tt>Table</tt> tasks. For more information, see [[#Table|Table]]. |
====Using Parameters==== | ====Using Parameters==== | ||
− | |||
This task has no parameters (only nested elements). | This task has no parameters (only nested elements). | ||
Line 1,709: | Line 1,723: | ||
====Specifying Parameters as Nested Elements==== | ====Specifying Parameters as Nested Elements==== | ||
− | |||
You can specify the following parameters as nested elements of this task: | You can specify the following parameters as nested elements of this task: | ||
− | |||
*[[#Procedure|Procedure]] | *[[#Procedure|Procedure]] | ||
*[[#SQLOperation|SQLOperation]] | *[[#SQLOperation|SQLOperation]] | ||
+ | |||
+ | |||
====Examples==== | ====Examples==== | ||
− | |||
This example shows a typical <tt>Operations</tt> task. | This example shows a typical <tt>Operations</tt> task. | ||
Line 1,722: | Line 1,735: | ||
<span id="Example 8-21"></span> | <span id="Example 8-21"></span> | ||
''''' Operations Task''''' | ''''' Operations Task''''' | ||
− | |||
− | |||
<BuildDBWSWar | <BuildDBWSWar | ||
destfile="emp.war" | destfile="emp.war" | ||
Line 1,729: | Line 1,740: | ||
sessionsFileName="emp-sessions.xml" | sessionsFileName="emp-sessions.xml" | ||
platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | ||
− | classpathref=" | + | classpathref="eclipselink.dbws.path" |
> | > | ||
<GenerateFromTables | <GenerateFromTables | ||
Line 1,777: | Line 1,788: | ||
− | For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]. | + | For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]]. |
+ | |||
+ | |||
===Procedure=== | ===Procedure=== | ||
Line 1,785: | Line 1,798: | ||
You can invoke this task from the following parent tasks: | You can invoke this task from the following parent tasks: | ||
− | * | + | * [[#GenerateFromStoredProcedures|GenerateFromStoredProcedures]] |
− | * | + | * [[#Operations|Operations]] |
====Using Parameters==== | ====Using Parameters==== | ||
− | + | <span id="Table 8-11"></span> | |
− | + | '''''Procedure Task Parameters''''' | |
− | + | ||
− | ''''' | + | |
{| class="RuleFormalWideMax" dir="ltr" title="Procedure Task Parameters" summary="This table lists the attributes applicable to this task." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | {| class="RuleFormalWideMax" dir="ltr" title="Procedure Task Parameters" summary="This table lists the attributes applicable to this task." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | ||
Line 1,846: | Line 1,857: | ||
Specifies whether or not the procedure returns information in the Simple XML Format (SXF). Valid values are: | Specifies whether or not the procedure returns information in the Simple XML Format (SXF). Valid values are: | ||
* <tt>true</tt> - the operation returns information in the Simple XML Format. | * <tt>true</tt> - the operation returns information in the Simple XML Format. | ||
− | * <tt>false</tt> - the operation returns information in the Simple XML Format.For more information, see [[#Unstructured Data]. | + | * <tt>false</tt> - the operation returns information in the Simple XML Format.For more information, see [[#Unstructured Data|Unstructured Data]]. |
| headers="r6c1-t16 r1c3-t16" align="left" | | | headers="r6c1-t16 r1c3-t16" align="left" | | ||
Yes | Yes | ||
Line 1,855: | Line 1,866: | ||
<tt>simpleXMLFormatTag</tt> | <tt>simpleXMLFormatTag</tt> | ||
| headers="r7c1-t16 r1c2-t16" align="left" | | | headers="r7c1-t16 r1c2-t16" align="left" | | ||
− | The name of the root-level Simple XML Format element-tag.For more information, see [[#Unstructured Data]. | + | The name of the root-level Simple XML Format element-tag.For more information, see [[#Unstructured Data|Unstructured Data]]. |
| headers="r7c1-t16 r1c3-t16" align="left" | | | headers="r7c1-t16 r1c3-t16" align="left" | | ||
No | No | ||
Line 1,864: | Line 1,875: | ||
<tt>xmlTag</tt> | <tt>xmlTag</tt> | ||
| headers="r8c1-t16 r1c2-t16" align="left" | | | headers="r8c1-t16 r1c2-t16" align="left" | | ||
− | The name of the grouping XML element-tag for rows.For more information, see [[#Unstructured Data]. | + | The name of the grouping XML element-tag for rows.For more information, see [[#Unstructured Data|Unstructured Data]]. |
| headers="r8c1-t16 r1c3-t16" align="left" | | | headers="r8c1-t16 r1c3-t16" align="left" | | ||
No | No | ||
Line 1,884: | Line 1,895: | ||
<tt>returnType</tt> | <tt>returnType</tt> | ||
| headers="r10c1-t16 r1c2-t16" align="left" | | | headers="r10c1-t16 r1c2-t16" align="left" | | ||
− | Specifies a return type when the operation's return type cannot be deduced from database metadata. Valid values are any type that the <tt> | + | Specifies a return type when the operation's return type cannot be deduced from database metadata. Valid values are any type that the <tt>eclipselink-dbws-schema.xsd</tt> file defines. For more information, see [[#eclipselink-dbws-schema.xsd]. |
| headers="r10c1-t16 r1c3-t16" align="left" | | | headers="r10c1-t16 r1c3-t16" align="left" | | ||
No | No | ||
Line 1,892: | Line 1,903: | ||
<br> | <br> | ||
+ | |||
+ | |||
====Examples==== | ====Examples==== | ||
− | |||
This example shows a <tt>Procedure</tt> task. | This example shows a <tt>Procedure</tt> task. | ||
Line 1,900: | Line 1,912: | ||
<span id="Example 8-22"></span> | <span id="Example 8-22"></span> | ||
''''' Procedure Task''''' | ''''' Procedure Task''''' | ||
− | |||
− | |||
<BuildDBWSWar | <BuildDBWSWar | ||
destfile="emp.war" | destfile="emp.war" | ||
Line 1,907: | Line 1,917: | ||
sessionsFileName="emp-sessions.xml" | sessionsFileName="emp-sessions.xml" | ||
platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | ||
− | classpathref=" | + | classpathref="eclipselink.dbws.path" |
> | > | ||
<GenerateFromStoredProcedures | <GenerateFromStoredProcedures | ||
Line 1,939: | Line 1,949: | ||
<span id="Example 8-23"></span> | <span id="Example 8-23"></span> | ||
''''' Unstructured Data Result''''' | ''''' Unstructured Data Result''''' | ||
− | |||
− | |||
<?xml version = '1.0' encoding = 'UTF-8'?> | <?xml version = '1.0' encoding = 'UTF-8'?> | ||
<EmployeesByEmpNoDeptNo> | <EmployeesByEmpNoDeptNo> | ||
Line 1,963: | Line 1,971: | ||
− | For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]]. | + | For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]]. |
+ | |||
+ | |||
===SQLOperation=== | ===SQLOperation=== | ||
− | |||
The <tt>SQLOperation</tt> task is a EclipseLink database Web services task you use to specify an SQL statement. | The <tt>SQLOperation</tt> task is a EclipseLink database Web services task you use to specify an SQL statement. | ||
You can invoke this task from the following parent tasks: | You can invoke this task from the following parent tasks: | ||
− | + | * [[#GenerateFromSQL|GenerateFromSQL]] | |
− | * | + | * [[#Operations|Operations]] |
− | * | + | |
====Using Parameters==== | ====Using Parameters==== | ||
− | + | <span id="Table 8-12"></span> | |
− | + | ''''' SQLOperation Task Parameters''''' | |
− | + | ||
− | ''''' | + | |
{| class="RuleFormalWideMax" dir="ltr" title="SQLOperation Task Parameters" summary="This table lists the attributes applicable to this task." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | {| class="RuleFormalWideMax" dir="ltr" title="SQLOperation Task Parameters" summary="This table lists the attributes applicable to this task." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | ||
Line 2,013: | Line 2,019: | ||
Specifies whether or not the procedure returns information in the Simple XML Format (SXF). Valid values are: | Specifies whether or not the procedure returns information in the Simple XML Format (SXF). Valid values are: | ||
* <tt>true</tt> - the operation returns information in the Simple XML Format. | * <tt>true</tt> - the operation returns information in the Simple XML Format. | ||
− | * <tt>false</tt> - the operation returns information in the Simple XML Format.For more information, see [[#Unstructured Data]. | + | * <tt>false</tt> - the operation returns information in the Simple XML Format.For more information, see [[#Unstructured Data|Unstructured Data]]. |
| headers="r4c1-t17 r1c3-t17" align="left" | | | headers="r4c1-t17 r1c3-t17" align="left" | | ||
Yes | Yes | ||
Line 2,022: | Line 2,028: | ||
<tt>simpleXMLFormatTag</tt> | <tt>simpleXMLFormatTag</tt> | ||
| headers="r5c1-t17 r1c2-t17" align="left" | | | headers="r5c1-t17 r1c2-t17" align="left" | | ||
− | The name of the root-level Simple XML Format element-tag.For more information, see [[#Unstructured Data]. | + | The name of the root-level Simple XML Format element-tag.For more information, see [[#Unstructured Data|Unstructured Data]]. |
| headers="r5c1-t17 r1c3-t17" align="left" | | | headers="r5c1-t17 r1c3-t17" align="left" | | ||
No | No | ||
Line 2,031: | Line 2,037: | ||
<tt>xmlTag</tt> | <tt>xmlTag</tt> | ||
| headers="r6c1-t17 r1c2-t17" align="left" | | | headers="r6c1-t17 r1c2-t17" align="left" | | ||
− | The name of the grouping XML element-tag for rows.For more information, see [[#Unstructured Data]. | + | The name of the grouping XML element-tag for rows.For more information, see [[#Unstructured Data|Unstructured Data]]. |
| headers="r6c1-t17 r1c3-t17" align="left" | | | headers="r6c1-t17 r1c3-t17" align="left" | | ||
No | No | ||
Line 2,051: | Line 2,057: | ||
<tt>returnType</tt> | <tt>returnType</tt> | ||
| headers="r8c1-t17 r1c2-t17" align="left" | | | headers="r8c1-t17 r1c2-t17" align="left" | | ||
− | Specifies a return type when the operation's return type cannot be deduced from database metadata. Valid values are any type that the <tt> | + | Specifies a return type when the operation's return type cannot be deduced from database metadata. Valid values are any type that the <tt>eclipselink-dbws-schema.xsd</tt> file defines. For more information, see [[#eclipselink-dbws-schema.xsd]. |
| headers="r8c1-t17 r1c3-t17" align="left" | | | headers="r8c1-t17 r1c3-t17" align="left" | | ||
No | No | ||
Line 2,058: | Line 2,064: | ||
|} | |} | ||
− | + | ||
+ | |||
====Specifying Parameters as Nested Elements==== | ====Specifying Parameters as Nested Elements==== | ||
− | |||
You can specify the following parameter as nested element of this task: | You can specify the following parameter as nested element of this task: | ||
− | + | * [[#Binding|Binding]] | |
− | * | + | |
====Examples==== | ====Examples==== | ||
− | + | This example shows two <tt>SQLOperation</tt> tasks. | |
− | + | ||
Line 2,080: | Line 2,084: | ||
sessionsFileName="emp-sessions.xml" | sessionsFileName="emp-sessions.xml" | ||
platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | ||
− | classpathref=" | + | classpathref="eclipselink.dbws.path" |
> | > | ||
<GenerateFromSQL | <GenerateFromSQL | ||
Line 2,131: | Line 2,135: | ||
− | For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]]. | + | For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]]. |
− | |||
+ | |||
+ | ===Table=== | ||
The <tt>Table</tt> task is a EclipseLink database Web services task you use to specify a database table. | The <tt>Table</tt> task is a EclipseLink database Web services task you use to specify a database table. | ||
− | This task is applicable only in <tt>GenerateFromTables</tt> tasks. For more information, see [[#GenerateFromTables]. | + | This task is applicable only in <tt>GenerateFromTables</tt> tasks. For more information, see [[#GenerateFromTables|GenerateFromTables]]. |
Line 2,143: | Line 2,148: | ||
====Using Parameters==== | ====Using Parameters==== | ||
− | + | <span id="Table 8-13"></span> | |
− | + | ''''' Table Task Parameters''''' | |
− | ''''' | + | |
{| class="RuleFormalWideMax" dir="ltr" title="Table Task Parameters" summary="This table lists the attributes applicable to this task." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | {| class="RuleFormalWideMax" dir="ltr" title="Table Task Parameters" summary="This table lists the attributes applicable to this task." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | ||
Line 2,182: | Line 2,186: | ||
|} | |} | ||
− | |||
− | |||
+ | |||
+ | |||
+ | ====Specifying Parameters as Nested Elements==== | ||
You can specify the following parameters as nested elements of this task: | You can specify the following parameters as nested elements of this task: | ||
+ | * [[#Operations|Operations]] | ||
− | |||
− | |||
+ | ====Examples==== | ||
The following example shows a typical <tt>Table</tt> task. | The following example shows a typical <tt>Table</tt> task. | ||
Line 2,206: | Line 2,211: | ||
sessionsFileName="emp-sessions.xml" | sessionsFileName="emp-sessions.xml" | ||
platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" | ||
− | classpathref=" | + | classpathref="eclipselink.dbws.path" |
> | > | ||
<GenerateFromTables | <GenerateFromTables | ||
Line 2,225: | Line 2,230: | ||
− | For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]]. | + | For more information, see [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]]. |
− | |||
− | |||
+ | ==Configuring the orion-ejb-jar.xml File for OC4J== | ||
+ | To deploy a EclipseLink application to OC4J Release R1 or later, modify the <tt>orion-ejb-jar.xml</tt> file. For more information, see [[#How to Configure persistence-manager Entries|How to Configure persistence-manager Entries]]. | ||
− | |||
+ | ===How to Configure persistence-manager Entries=== | ||
If you are using EclipseLink as your OC4J persistence manager, the default persistence manager in Release R1, you can configure the <tt>persistence-manager</tt> subentry (see [[#Table 8-14|orion-ejb-jar.xml File persistence-manager Entries]]) in the <tt>orion-ejb-jar.xml</tt> file. | If you are using EclipseLink as your OC4J persistence manager, the default persistence manager in Release R1, you can configure the <tt>persistence-manager</tt> subentry (see [[#Table 8-14|orion-ejb-jar.xml File persistence-manager Entries]]) in the <tt>orion-ejb-jar.xml</tt> file. | ||
Line 2,252: | Line 2,257: | ||
'''''orion-ejb-jar.xml File persistence-manager Entries''''' | '''''orion-ejb-jar.xml File persistence-manager Entries''''' | ||
− | {| class="HRuleFormalMax" dir="ltr" title="orion-ejb-jar.xml File persistence-manager Entries" summary="This table lists the orion-ejb-jar.xml persistence-manager subentries that you can configure when | + | {| class="HRuleFormalMax" dir="ltr" title="orion-ejb-jar.xml File persistence-manager Entries" summary="This table lists the orion-ejb-jar.xml persistence-manager subentries that you can configure when EclipseLink is the persistence manager." width="100%" border="1" frame="hsides" rules="rows" cellpadding="3" frame="hsides" rules="rows" |
|- align="left" valign="top" | |- align="left" valign="top" | ||
! id="r1c1-t20" align="left" valign="bottom" | '''Entry''' | ! id="r1c1-t20" align="left" valign="bottom" | '''Entry''' | ||
Line 2,260: | Line 2,265: | ||
<tt>name</tt> | <tt>name</tt> | ||
| headers="r2c1-t20 r1c2-t20" align="left" | | | headers="r2c1-t20 r1c2-t20" align="left" | | ||
− | The name of the persistence manager to use. Set this value to <tt> | + | The name of the persistence manager to use. Set this value to <tt>eclipselink</tt>.If you set the <tt>name</tt> property to <tt>eclipselink</tt>, you may also configure <tt>pm-properties</tt> (see [[#Configuring pm-properties]]). |
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r3c1-t20" headers="r1c1-t20" align="left" | | | id="r3c1-t20" headers="r1c1-t20" align="left" | | ||
<tt>class-name</tt> | <tt>class-name</tt> | ||
| headers="r3c1-t20 r1c2-t20" align="left" | | | headers="r3c1-t20 r1c2-t20" align="left" | | ||
− | Do not configure this attribute. If <tt>name</tt> is set to <tt> | + | Do not configure this attribute. If <tt>name</tt> is set to <tt>eclipselink</tt>, then <tt>class-name</tt> is set correctly by default. |
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r4c1-t20" headers="r1c1-t20" align="left" | | | id="r4c1-t20" headers="r1c1-t20" align="left" | | ||
<tt>descriptor</tt> | <tt>descriptor</tt> | ||
| headers="r4c1-t20 r1c2-t20" align="left" | | | headers="r4c1-t20 r1c2-t20" align="left" | | ||
− | This property applies only when <tt>name</tt> is set to <tt> | + | This property applies only when <tt>name</tt> is set to <tt>eclipselink</tt>.If you export your EclipseLink mapping metadata to a deployment XML file, set this property to the name of the deployment XML file (default: <tt>toplink-ejb-jar.xml</tt>).Do not set this property if you are using a EclipseLink project class instead of a mapping metadata file (see <tt>project-class</tt> in [[#Table 8-15|orion-ejb-jar.xml File persistence-manager Subentries for pm-properties]]). |
|} | |} | ||
− | |||
− | |||
− | When you select EclipseLink as the persistence manager (see <tt>name</tt> in [[#Table 8-14]]), use the <tt>persistence-manager</tt> subentries for <tt>pm-properties</tt> (see [[#Table 8-15|orion-ejb-jar.xml File persistence-manager Subentries for pm-properties]]) to configure the EclipseLink session that the EclipseLink run time creates and uses internally. | + | |
+ | |||
+ | ====Configuring pm-properties==== | ||
+ | When you select EclipseLink as the persistence manager (see <tt>name</tt> in [[#Table 8-14|orion-ejb-jar.xml File persistence-manager Entries]]), use the <tt>persistence-manager</tt> subentries for <tt>pm-properties</tt> (see [[#Table 8-15|orion-ejb-jar.xml File persistence-manager Subentries for pm-properties]]) to configure the EclipseLink session that the EclipseLink run time creates and uses internally. | ||
Line 2,290: | Line 2,296: | ||
'''''orion-ejb-jar.xml File persistence-manager Subentries for pm-properties''''' | '''''orion-ejb-jar.xml File persistence-manager Subentries for pm-properties''''' | ||
− | {| class="HRuleFormalMax" dir="ltr" title="orion-ejb-jar.xml File persistence-manager Subentries for pm-properties" summary="This table lists the orion-ejb-jar.xml persistence-manager subentries for pm-properties that you can configure when | + | {| class="HRuleFormalMax" dir="ltr" title="orion-ejb-jar.xml File persistence-manager Subentries for pm-properties" summary="This table lists the orion-ejb-jar.xml persistence-manager subentries for pm-properties that you can configure when eclipselink is the persistence manager." width="100%" border="1" frame="hsides" rules="rows" cellpadding="3" frame="hsides" rules="rows" |
|- align="left" valign="top" | |- align="left" valign="top" | ||
! id="r1c1-t22" align="left" valign="bottom" | '''Entry''' | ! id="r1c1-t22" align="left" valign="bottom" | '''Entry''' | ||
Line 2,303: | Line 2,309: | ||
<tt>project-class</tt> | <tt>project-class</tt> | ||
| headers="r3c1-t22 r1c2-t22" align="left" | | | headers="r3c1-t22 r1c2-t22" align="left" | | ||
− | If you export your EclipseLink mapping metadata to a Java class (that extends <tt>org.eclipse.persistence.sessions.Project</tt>), set this property to the name of the class, fully qualified by its package name. Be sure to include the class file in the deployable JAR file.Do not set this property if you are using a mapping metadata file (see <tt>descriptor</tt> in [[#Table 8-14]]). | + | If you export your EclipseLink mapping metadata to a Java class (that extends <tt>org.eclipse.persistence.sessions.Project</tt>), set this property to the name of the class, fully qualified by its package name. Be sure to include the class file in the deployable JAR file.Do not set this property if you are using a mapping metadata file (see <tt>descriptor</tt> in [[#Table 8-14|orion-ejb-jar.xml File persistence-manager Entries]]). |
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r4c1-t22" headers="r1c1-t22" align="left" | | | id="r4c1-t22" headers="r1c1-t22" align="left" | | ||
<tt>customization-class</tt> | <tt>customization-class</tt> | ||
| headers="r4c1-t22 r1c2-t22" align="left" | | | headers="r4c1-t22 r1c2-t22" align="left" | | ||
− | Optional Java class (that implements <tt>org.eclipse.persistence.ejb.cmp.DeploymentCustomization</tt>) used to allow deployment customization of EclipseLink mapping and run-time configuration. At deployment time, the EclipseLink run time creates a new instance of this class and invokes its methods <tt>beforeLoginCustomization</tt> (before the EclipseLink run time logs into the session) and <tt>afterLoginCustomization</tt> (after the EclipseLink runtime logs into the session), passing in the EclipseLink session as a parameter.Use your implementation of the <tt>beforeLoginCustomization</tt> method to configure session attributes not supported by the <tt>pm-properties</tt> including: cache coordination (see also [[#Configuring cache-synchronization Properties]), parameterized SQL, native SQL, batch writing/batch size, byte-array/string binding, EIS login, event listeners, table qualifier, and sequencing. For more information about session configuration, see [[Configuring%20a%20Session%20(ELUG)#BCGBDEFJ|Configuring a Session]].The class must be fully qualified by its package name and included in the deployment JAR file. | + | Optional Java class (that implements <tt>org.eclipse.persistence.ejb.cmp.DeploymentCustomization</tt>) used to allow deployment customization of EclipseLink mapping and run-time configuration. At deployment time, the EclipseLink run time creates a new instance of this class and invokes its methods <tt>beforeLoginCustomization</tt> (before the EclipseLink run time logs into the session) and <tt>afterLoginCustomization</tt> (after the EclipseLink runtime logs into the session), passing in the EclipseLink session as a parameter.Use your implementation of the <tt>beforeLoginCustomization</tt> method to configure session attributes not supported by the <tt>pm-properties</tt> including: cache coordination (see also [[#Configuring cache-synchronization Properties|Configuring cache-synchronization Properties]]), parameterized SQL, native SQL, batch writing/batch size, byte-array/string binding, EIS login, event listeners, table qualifier, and sequencing. For more information about session configuration, see [[Configuring%20a%20Session%20(ELUG)#BCGBDEFJ|Configuring a Session]].The class must be fully qualified by its package name and included in the deployment JAR file. |
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r5c1-t22" headers="r1c1-t22" align="left" | | | id="r5c1-t22" headers="r1c1-t22" align="left" | | ||
Line 2,325: | Line 2,331: | ||
<tt>cache-synchronization</tt> | <tt>cache-synchronization</tt> | ||
| headers="r7c1-t22 r1c2-t22" align="left" | | | headers="r7c1-t22 r1c2-t22" align="left" | | ||
− | See [[#Configuring cache-synchronization Properties]]. | + | See [[#Configuring cache-synchronization Properties|Configuring cache-synchronization Properties]]. |
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r8c1-t22" headers="r1c1-t22" align="left" | | | id="r8c1-t22" headers="r1c1-t22" align="left" | | ||
<tt>default-mapping</tt> | <tt>default-mapping</tt> | ||
| headers="r8c1-t22 r1c2-t22" align="left" | | | headers="r8c1-t22 r1c2-t22" align="left" | | ||
− | See [[#Configuring default-mapping Properties]]. | + | See [[#Configuring default-mapping Properties|Configuring default-mapping Properties]]. |
|} | |} | ||
Line 2,336: | Line 2,342: | ||
====Configuring cache-synchronization Properties==== | ====Configuring cache-synchronization Properties==== | ||
− | When you select EclipseLink as the persistence manager (see <tt>name</tt> in [[#Table 8-14]]), use the <tt>pm-properties</tt> subentry for <tt>cache-synchronization</tt> (see [[#Table 8-16]]) to configure EclipseLink cache coordination features of the session that the EclipseLink run time uses internally for CMP projects. For more information about EclipseLink cache coordination, see [[Introduction%20to%20Cache%20(ELUG)|Cache Coordination]]. | + | When you select EclipseLink as the persistence manager (see <tt>name</tt> in [[#Table 8-14|orion-ejb-jar.xml File persistence-manager Entries]]), use the <tt>pm-properties</tt> subentry for <tt>cache-synchronization</tt> (see [[#Table 8-16]]) to configure EclipseLink cache coordination features of the session that the EclipseLink run time uses internally for CMP projects. For more information about EclipseLink cache coordination, see [[Introduction%20to%20Cache%20(ELUG)#Cache Coordination|Cache Coordination]]. |
When this subentry is present, you must use a customization class (see <tt>customization-class</tt> in [[#Table 8-15|orion-ejb-jar.xml File persistence-manager Subentries for pm-properties]]) to complete cache coordination configuration. For more information about EclipseLink cache coordination configuration, see [[Configuring%20a%20Coordinated%20Cache%20(ELUG)|Configuring a Coordinated Cache]]. | When this subentry is present, you must use a customization class (see <tt>customization-class</tt> in [[#Table 8-15|orion-ejb-jar.xml File persistence-manager Subentries for pm-properties]]) to complete cache coordination configuration. For more information about EclipseLink cache coordination configuration, see [[Configuring%20a%20Coordinated%20Cache%20(ELUG)|Configuring a Coordinated Cache]]. | ||
Line 2,343: | Line 2,349: | ||
'''''Table 8-16 orion-ejb-jar.xml File pm-properties Subentries for cache-synchronization''''' | '''''Table 8-16 orion-ejb-jar.xml File pm-properties Subentries for cache-synchronization''''' | ||
− | {| class="HRuleFormalMax" dir="ltr" title="orion-ejb-jar.xml File pm-properties Subentries for cache-synchronization" summary="This table lists the orion-ejb-jar.xml persistence-manager subentries for pm-properties subentry cache-synchronization that you can configure when | + | {| class="HRuleFormalMax" dir="ltr" title="orion-ejb-jar.xml File pm-properties Subentries for cache-synchronization" summary="This table lists the orion-ejb-jar.xml persistence-manager subentries for pm-properties subentry cache-synchronization that you can configure when eclipselink is the persistence manager." width="100%" border="1" frame="hsides" rules="rows" cellpadding="3" frame="hsides" rules="rows" |
|- align="left" valign="top" | |- align="left" valign="top" | ||
! id="r1c1-t23" align="left" valign="bottom" | '''Entry''' | ! id="r1c1-t23" align="left" valign="bottom" | '''Entry''' | ||
Line 2,370: | Line 2,376: | ||
|} | |} | ||
− | + | ||
+ | |||
+ | |||
====Configuring default-mapping Properties==== | ====Configuring default-mapping Properties==== | ||
− | When you select EclipseLink as the persistence manager (see <tt>name</tt> in [[#Table 8-14]]), use the <tt>pm-properties</tt> subentry for <tt>default-mapping</tt> (see [[#table_8_17|the following table]]) to configure the EclipseLink default mapping and automatic table generation feature. | + | When you select EclipseLink as the persistence manager (see <tt>name</tt> in [[#Table 8-14|orion-ejb-jar.xml File persistence-manager Entries]]), use the <tt>pm-properties</tt> subentry for <tt>default-mapping</tt> (see [[#table_8_17|the following table]]) to configure the EclipseLink default mapping and automatic table generation feature. |
− | For more information about EclipseLink automatic table generation, see [[Using%20the%20Schema%20Manager%20(ELUG)|Creating Database Tables Automatically]]. | + | For more information about EclipseLink automatic table generation, see [[Using%20the%20Schema%20Manager%20(ELUG)#Creating Database Tables Automatically|Creating Database Tables Automatically]]. |
Line 2,382: | Line 2,390: | ||
'''''orion-ejb-jar.xml File pm-properties Subentries for default-mapping''''' | '''''orion-ejb-jar.xml File pm-properties Subentries for default-mapping''''' | ||
− | {| class="HRuleFormalMax" dir="ltr" title="orion-ejb-jar.xml File pm-properties Subentries for default-mapping" summary="This table lists the orion-ejb-jar.xml persistence-manager subentries for pm-properties subentry default-mapping that you can configure when | + | {| class="HRuleFormalMax" dir="ltr" title="orion-ejb-jar.xml File pm-properties Subentries for default-mapping" summary="This table lists the orion-ejb-jar.xml persistence-manager subentries for pm-properties subentry default-mapping that you can configure when eclipselink is the persistence manager." width="100%" border="1" frame="hsides" rules="rows" cellpadding="3" frame="hsides" rules="rows" |
|- align="left" valign="top" | |- align="left" valign="top" | ||
! id="r1c1-t24" align="left" valign="bottom" | '''Entry''' | ! id="r1c1-t24" align="left" valign="bottom" | '''Entry''' | ||
Line 2,393: | Line 2,401: | ||
* <tt>Create</tt> (default): This value tells EclipseLink to create the mapped tables during the deployment. If the tables already exist, EclipseLink will log an appropriate warning messages (such as "''Table already existed...''") and keeps processing the deployment. | * <tt>Create</tt> (default): This value tells EclipseLink to create the mapped tables during the deployment. If the tables already exist, EclipseLink will log an appropriate warning messages (such as "''Table already existed...''") and keeps processing the deployment. | ||
* <tt>DropAndCreate</tt><nowiki>: This value tells EclipseLink to drop tables before creating them during deployment. If a table does not initially exist, the drop operation will cause anSQLException to be thrown through the driver. However, EclipseLink handles the exception (logs and ignores it) and moves on to process the table creation operation. The deployment fails only if both drop and create operations fail.</nowiki> | * <tt>DropAndCreate</tt><nowiki>: This value tells EclipseLink to drop tables before creating them during deployment. If a table does not initially exist, the drop operation will cause anSQLException to be thrown through the driver. However, EclipseLink handles the exception (logs and ignores it) and moves on to process the table creation operation. The deployment fails only if both drop and create operations fail.</nowiki> | ||
− | * <tt>UseExisting</tt><nowiki>: This value tells EclipseLink to perform no table manipulation. If the tables do not exist, deployment still goes through without error.</nowiki>If no <tt>orion-ejb-jar.xml</tt> file is defined in your EAR file, the OC4J container generates one during deployment. In this case, to specify a value for <tt>db-table-gen</tt>, use the EclipseLink system property <tt> | + | * <tt>UseExisting</tt><nowiki>: This value tells EclipseLink to perform no table manipulation. If the tables do not exist, deployment still goes through without error.</nowiki>If no <tt>orion-ejb-jar.xml</tt> file is defined in your EAR file, the OC4J container generates one during deployment. In this case, to specify a value for <tt>db-table-gen</tt>, use the EclipseLink system property <tt>eclipselink.defaultmapping.dbTableGenSetting</tt>. For example: <tt>-Declipselink.defaultmapping.dbTableGenSetting="DropAndCreate"</tt>.<br>The <tt>orion-ejb-jar.xml</tt> property overrides the system property. If both the <tt>orion-ejb-jar.xml</tt> property and the system property are present, EclipseLink retrieves the setting from the <tt>orion-ejb-jar.xml</tt> file.This setting overrides <tt>autocreate-tables</tt> and <tt>autodelete-tables</tt> configuration at the application (EAR) or system level. For more information, see [[Using%20the%20Schema%20Manager%20(ELUG)#Creating Database Tables Automatically|Creating Database Tables Automatically]]. |
|- align="left" valign="top" | |- align="left" valign="top" | ||
| id="r3c1-t24" headers="r1c1-t24" align="left" | | | id="r3c1-t24" headers="r1c1-t24" align="left" | | ||
<tt>extended-table-names</tt> | <tt>extended-table-names</tt> | ||
| headers="r3c1-t24 r1c2-t24" align="left" | | | headers="r3c1-t24 r1c2-t24" align="left" | | ||
− | An element used if the generated table names are not long enough to be unique. Values are restricted to <tt>true</tt> or <tt>false</tt> (default). When set to <tt>true</tt>, the EclipseLink run time will ensure that generated tables names are unique.In default mapping, each entity is mapped to one table. The only exception is in many-to-many mappings where there is one extra relation table involved in the source and target entities.When <tt>extended-table-names</tt> is set to <tt>false</tt> (the default), a simple table naming algorithm is used as follows: table names are defined as <tt>TL_<bean_name></tt>. For example, if the bean name is <tt>Employee</tt>, the associated table name would be <tt>TL_EaMPLOYEE</tt>.However, if the same entity is defined in multiple JAR files in an application, or across multiple applications, table-naming collision is inevitable.To address this problem, set <tt>extended-table-names</tt> to <tt>true</tt>. When set to <tt>true</tt>, EclipseLink uses an alternative table-naming algorithm as follows: table names are defined as ''<tt><bean_name>_<jar_name>_<app_name></tt>''. This algorithm uses the combination of bean, JAR, and EAR names to form a table name unique across the application. For example, given a bean named <tt>Employee</tt>, which is in <tt>Test.jar</tt>, which is in <tt>Demo.ear</tt> (and the application name is "<tt>Demo</tt>"), then the corresponding table name will be <tt>EMPLOYEE_TEST_DEMO</tt>.If there is no <tt>orion-ejb-jar.xml</tt> file defined in the EAR file, the OC4J container generates one during deployment. In this case, to specify a value for <tt>extended-table-names</tt>, use the EclipseLink system property <tt> | + | An element used if the generated table names are not long enough to be unique. Values are restricted to <tt>true</tt> or <tt>false</tt> (default). When set to <tt>true</tt>, the EclipseLink run time will ensure that generated tables names are unique.In default mapping, each entity is mapped to one table. The only exception is in many-to-many mappings where there is one extra relation table involved in the source and target entities.When <tt>extended-table-names</tt> is set to <tt>false</tt> (the default), a simple table naming algorithm is used as follows: table names are defined as <tt>TL_<bean_name></tt>. For example, if the bean name is <tt>Employee</tt>, the associated table name would be <tt>TL_EaMPLOYEE</tt>.However, if the same entity is defined in multiple JAR files in an application, or across multiple applications, table-naming collision is inevitable.To address this problem, set <tt>extended-table-names</tt> to <tt>true</tt>. When set to <tt>true</tt>, EclipseLink uses an alternative table-naming algorithm as follows: table names are defined as ''<tt><bean_name>_<jar_name>_<app_name></tt>''. This algorithm uses the combination of bean, JAR, and EAR names to form a table name unique across the application. For example, given a bean named <tt>Employee</tt>, which is in <tt>Test.jar</tt>, which is in <tt>Demo.ear</tt> (and the application name is "<tt>Demo</tt>"), then the corresponding table name will be <tt>EMPLOYEE_TEST_DEMO</tt>.If there is no <tt>orion-ejb-jar.xml</tt> file defined in the EAR file, the OC4J container generates one during deployment. In this case, to specify a value for <tt>extended-table-names</tt>, use the EclipseLink system property <tt>eclipselink.defaultmapping.useExtendedTableNames</tt>. For example: <tt>-Declipselink.defaultmapping.useExtendedTableNames="true"</tt>.The <tt>orion-ejb-jar.xml</tt> property overrides the system property. If both the <tt>orion-ejb-jar.xml</tt> property and the system property are present, EclipseLink retrieves the setting from the <tt>orion-ejb-jar.xml</tt> file. |
|} | |} | ||
− | + | ||
+ | |||
+ | |||
==Configuring the weblogic-ejb-jar.xml File for BEA WebLogic Server== | ==Configuring the weblogic-ejb-jar.xml File for BEA WebLogic Server== | ||
Before you deploy a EclipseLink application to a BEA WebLogic Server, you must modify the <tt>weblogic-ejb-jar.xml</tt> file. | Before you deploy a EclipseLink application to a BEA WebLogic Server, you must modify the <tt>weblogic-ejb-jar.xml</tt> file. | ||
− | Avoid the <tt>weblogic-ejb-jar.xml</tt> tags that EclipseLink either does not support or does not require (see [[#What You May Need to Know About Unsupported weblogic-ejb-jar.xml File Tags]]). | + | Avoid the <tt>weblogic-ejb-jar.xml</tt> tags that EclipseLink either does not support or does not require (see [[#What You May Need to Know About Unsupported weblogic-ejb-jar.xml File Tags|What You May Need to Know About Unsupported weblogic-ejb-jar.xml File Tags]]). |
Line 2,412: | Line 2,422: | ||
===What You May Need to Know About Unsupported weblogic-ejb-jar.xml File Tags=== | ===What You May Need to Know About Unsupported weblogic-ejb-jar.xml File Tags=== | ||
The <tt>weblogic-ejb-jar.xml</tt> file includes the following tags that EclipseLink either does not support or does not require: | The <tt>weblogic-ejb-jar.xml</tt> file includes the following tags that EclipseLink either does not support or does not require: | ||
− | * <tt>concurrency-strategy</tt><nowiki>: This tag specifies how WebLogic manages concurrent users for a given bean. Because EclipseLink manages concurrent access internally, it does not require this tag.</nowiki>For more information about the EclipseLink concurrency strategy, see [[Configuring%20a%20Descriptor%20(ELUG)|Configuring Locking Policy]]. | + | * <tt>concurrency-strategy</tt><nowiki>: This tag specifies how WebLogic manages concurrent users for a given bean. Because EclipseLink manages concurrent access internally, it does not require this tag.</nowiki>For more information about the EclipseLink concurrency strategy, see [[Configuring%20a%20Descriptor%20(ELUG)#Configuring Locking Policy|Configuring Locking Policy]]. |
* <tt>db-is-shared</tt><nowiki>: Because EclipseLink does not make any assumptions about the exclusivity of database access, EclipseLink does not require this tag. EclipseLink addresses multiuser access issues through various locking and refreshing policies.</nowiki> | * <tt>db-is-shared</tt><nowiki>: Because EclipseLink does not make any assumptions about the exclusivity of database access, EclipseLink does not require this tag. EclipseLink addresses multiuser access issues through various locking and refreshing policies.</nowiki> | ||
* <tt>delay-updates-until-end-of-tx</tt><nowiki>: EclipseLink always delays updates until the end of a transaction, and does not require this tag.</nowiki> | * <tt>delay-updates-until-end-of-tx</tt><nowiki>: EclipseLink always delays updates until the end of a transaction, and does not require this tag.</nowiki> |
Revision as of 10:52, 5 December 2007
Contents
- 1 Introduction to the EclipseLink Deployment File Creation
- 2 Creating Deployment Files for Java Applications
- 3 Creating Deployment Files for JavaServer Pages and Servlet Applications
- 4 Creating Deployment Files for Session Bean Applications
- 5 Creating Deployment Files for JPA Applications
- 6 Creating Deployment Files for EclipseLink Database Web Services
- 6.1 How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table
- 6.2 How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL
- 6.3 How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure
- 6.4 How to Customize a EclipseLink Database Web Service Using Java: Session Customization
- 6.5 How to Customize a EclipseLink Database Web Service Using project.xml and sessions.xml
- 6.6 How to Configure Ant to Use EclipseLink Database Web Services Tasks
- 6.7 What You May Need to Know About Creating Deployment Files for a EclipseLink Database Web Service
- 6.8 Binding
- 6.9 BuildDBWSWar
- 6.10 GenerateFromSQL
- 6.11 GenerateFromStoredProcedures
- 6.12 GenerateFromTables
- 6.13 Operations
- 6.14 Procedure
- 6.15 SQLOperation
- 6.16 Table
- 7 Configuring the orion-ejb-jar.xml File for OC4J
- 8 Configuring the weblogic-ejb-jar.xml File for BEA WebLogic Server
This section includes EclipseLink information that you need when creating deployment files for various types of applications.
For more information on packaging and deployment, see the following:
- Introduction to the EclipseLink Deployment File Creation
- Integrating EclipseLink with an Application Server
- Packaging a EclipseLink Application
- Deploying a EclipseLink Application
- Packaging and Deploying EclipseLink JPA Applications
Introduction to the EclipseLink Deployment File Creation
Depending on the type of application you are deploying, you may need to create any of the following deployment files:
Workbench provides the ability to create deployment files from a Workbench project (see Exporting Project Information). After you build a project, you have two options to create the deployment files:
- Create XML deployment files that require no compiling.
- Create Java source files, which you compile and deploy outside of Workbench.
We recommend XML deployment because XML files are easier to deploy and troubleshoot than compiled Java files. This approach gives you a very flexible configuration that enables you to make changes safely and easily. XML deployment files do not require third-party applications or compilers to deploy successfully.
Note:If you are using JPA, you can use annotations to specify most of what you formerly specified in deployment descriptors. Use deployment descriptors to override annotations or specify options not supported by annotations. |
project.xml File
The project.xml file is the core of your application. It contains the descriptors and mappings you define and also includes any named queries or finders associated with your project.
XSD File Format
The project.xml file XSD is eclispelink-object-persistence_11_1_1.xsd and it is located in the <ECLIPSELINK_HOME>\config\xsds directory.
POJO Applications and Project Metadata
For a POJO application, you define your project metadata in a project.xml file.
The project.xml file provides a simple and flexible way to configure, modify, and troubleshoot the project metadata. Because of these attributes, the project.xml file is the preferred way to configure a EclipseLink project.Workbench provides a graphical tool to build and edit the project.xml file. For information on creating projects with Workbench, see Creating the project.xml File with Workbench.
JPA Applications and Project Metadata
For a JPA application, you can express project metadata using JPA annotations, persistence.xml, orm.xml, and EclipseLink JPA annotation and persistence.xml property extensions. The EclipseLink JPA persistence provider interprets all these sources of metadata to create an in-memory EclipseLink session and project at run time.
Using EclipseLink JPA, you also have the option of specifying your metadata using EclipseLink sessions.xml and project.xml while accessing your persistent classes using JPA and an EntityManger. For more information, see What You May Need to Know About EclipseLink JPA Overriding Mechanisms.
Creating the project.xml File with Workbench
Because you must synchronize the project.xml file with the classes and data source associated with your application, we recommend that you not modify this file manually. Workbench ensures proper synchronization, and is the best way to make changes to the project. Simply modify the project in Workbench and redeploy the project.xml file. Using this option reduces development time by eliminating the need to regenerate and recompile Java code each time the project changes.
See Exporting Project Information for detailed information on exporting the deployment XML information.
Note: You can name this file with a name other than project.xml; however, for clarity, this discussion assumes that the file has not been renamed. |
Creating project.xml Programatically
Optionally, you can use the DeploymentXMLGenerator API to programatically generate the project.xml file in either of the following ways:
- From an application, instantiate the DeploymentXMLGenerator and your java source. Call the following method:generate (<MW_Project.mwp>, <output file.xml>)
- From the command line, use the following:
java -classpath eclipselink.jar;eclispelinkmw.jar;xmlparserv2.jar;ejb.jar;org.eclipse.persistence.tools.workbench.mappings.DeploymentXMLGenerator <MW_Project.mwp> <output file.xml>
Before you use either method, ensure that your classpath includes the <ECLIPSELINK_HOME>\config directory.
Note:If you are using EJB 3.0, you can use annotations to specify most of what you formerly specified in the project.xml file. To override annotations or specify options not supported by annotations, you can still provide a project.xml file in your EJB 3.0 application. For more information on what annotations are currently supported, see Oracle Fusion Middleware Enterprise JavaBeans Developer's Guide for Oracle Containers for Java EE |
sessions.xml File
Each EclipseLink project belongs to a EclipseLink session. A session is the facade through which an application accesses EclipseLink functionality (for more information on sessions, see EclipseLink Sessions).
XSD File Format
The sessions.xml file XSD is eclipse_persistence_sessions_1_0.xsd and it is located in the <ECLISPELINK_HOME>\config\xsds directory as well as on the web at http://www.eclipse.org/eclipselink/xsds/eclipse_persistence_sessions_1_0.xsd.
When you use the XSD formatted sessions.xml file, the EclipseLink run time separates sessions.xml file validation from session instantiation. Separating XML file formatting problems from Session Manager session instantiation problems simplifies troubleshooting. Exceptions thrown during validation clearly indicate that the failure is due to an invalid sessions.xml file, as the following illustrates.
Enhanced Validation Exceptions
Exception [ECLIPSELINK-9010] (EclipseLink): org.eclipselink.exceptions.SessionLoaderException Exception Description: A End tag does not match start tag 'session'. was thrown while parsing the XML file against the XML schema. Internal Exception: oracle.xml.parser.v2.XMLParseException: End tag does not match start tag 'session'.
POJO Applications and Session Metadata
For a POJO application, you define your sessions in a sessions.xml file.
The sessions.xml file provides a simple and flexible way to configure, modify, and troubleshoot the application sessions. Because of these attributes, the sessions.xml file is the preferred way to configure a EclipseLink session.EclipseLink provides graphical toosl to build and edit the sessions.xml file. For information see Creating a Session.
JPA Applications and Session Metadata
For a JPA application, you can express session metadata using JPA annotations, persistence.xml, orm.xml, and EclipseLink JPA annotation and persistence.xml property extensions. The EclipseLink JPA persistence provider interprets all these sources of metadata to create an in-memory EclipseLink session and project at run time.
Using EclipseLink JPA, you also have the option of specifying your metadata using EclipseLink sessions.xml and project.xml while accessing your persistent classes using JPA and an EntityManger. For more information, see What You May Need to Know About EclipseLink JPA Overriding Mechanisms.
eclispelink-dbws.xml File
The eclispelink-dbws.xml file is used only with EclipseLink database Web services. The EclipseLink runtime uses the properties (see the following table set in this file to determine such things as service name, generated sessions.xml file name, and query definitions for a EclipseLink database Web service, as the following example shows.
eclispelink-dbws.xml File Properties
Property | Description | Required | Default |
---|---|---|---|
name |
The name of the EclipseLink database Web service. |
No-can be overridden by the BuildDBWSWar attribute projectName |
None |
query |
One or more named query definitions. |
No |
None |
eclispelink-dbws.xml File
<?xml version="1.0" encoding="UTF-8"?> <dbws xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <name>emp</name> <delete> <name>delete.xr_mep_table</name> <parameter> <name>theInstance</name> <type>xr_emp_tableType</type> </parameter> </delete> <insert> <name>create.xr_emp_table</name> <parameter> <name>theInstance</name> <type>xr_emp_tableType</type> </parameter> </insert> <query> <name>findByName</name> <result isCollection="true"> <type>xr_emp_tableType</type> </result> <sql> <![CDATA[select * from XR_emp_TABLE where NAME LIKE 'emp%']]> </sql> </query> <update> <name>update.xr_emp_table</name> <parameter> <name>theInstance</name> <type>xr_emp_tableType</type> </parameter> </update> </dbws>
For more information, see the following:
XSD File Format
The eclipselink-dbws-service.xml file XSD is eclipselink-dbws_1.xsd and it is located in the <ECLIPSELINK_HOME>\config\xsds directory.
eclispelink-dbws-schema.xsd
The eclipselink-dbws-schema.xsd file is used only with EclipseLink database Web services. The EclipseLink database Web service automatically generates this file from your database table metadata and uses it to derive element-tag names and types.
Typical Database Metadata shows metadata from a typical database and Corresponding eclispelink-dbws-schema.xsd shows the corresponding eclipselink-dbws-schema.xsd file that the EclipseLink database Web service generates from it.
Typical Database Metadata
OWNER | TABLE_NAME | COLUMN_NAME | DATA_TYPE | DATA_LENGTH | DATA_PRECISION | DATA_SCALE | NULLABLE |
---|---|---|---|---|---|---|---|
SCOTT |
EMP |
EMPNO |
NUMBER |
22 |
4 |
N | |
SCOTT |
EMP |
ENAME |
VARCHAR2 |
10 |
(null) |
(null) |
Y |
SCOTT |
EMP |
JOB |
VARCHAR2 |
9 |
(null) |
(null) |
Y |
SCOTT |
EMP |
MGR |
NUMBER |
22 |
4 |
Y | |
SCOTT |
EMP |
HIREDATE |
DATE |
7 |
(null) |
(null) |
Y |
SCOTT |
EMP |
SAL |
NUMBER |
22 |
7 |
2 |
Y |
SCOTT |
EMP |
COMM |
NUMBER |
22 |
7 |
2 |
Y |
SCOTT |
EMP |
DEPTNO |
NUMBER |
22 |
2 |
Y |
Corresponding eclispelink-dbws-schema.xsd
<?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:element name="emp" type="empType"/> </xsd:schema>
For more information, see Deployment Files for EclipseLink Database Web Services
Creating Deployment Files for Java Applications
In a Java application, EclipseLink does not use a Java EE container for deployment. Instead, it relies on EclipseLink mechanisms to provide functionality and persistence. The key elements of this type of application are the lack of a Java EE container and the fact that you deploy the application by placing the application JAR file on the classpath.
Java applications require the following deployment files:
Creating Deployment Files for JavaServer Pages and Servlet Applications
Many designers build EclipseLink applications that use JavaServer Pages (JSP) and Java servlets. This type of design generally supports Web-based applications.
JSP and servlet applications require the following deployment files:
Creating Deployment Files for Session Bean Applications
Session beans generally model a process, operation, or service and as such, are not persistent. You can build EclipseLink applications that wrap interaction with EclipseLink in session beans. Session beans execute all EclipseLink-related operations on behalf of the client.
This type of design uses JTS and externally managed transactions, but does not incur the overhead associated with persistence applications. Session bean applications also scale and deploy easily.
This section describes the following:
How to Create Deployment Files for EJB 3.0 Session Bean Applications
We recommend using JPA annotations and persistence unit properties, or a special-case eclipselink.session-xml persistence unit property (see EclipseLink JPA Persistence Unit Properties for Database, Session, and Application Server) in your EJB 3.0 session bean application.
You may also choose to use the project.xml File and sessions.xml File.
For more information, see the following:
- Java Persistence API Overview
- EclipseLink JPA Overview
- Application Development with EclipseLink JPA)
Creating Deployment Files for JPA Applications
See Packaging and Deploying EclipseLink JPA Applications for information on how to create deployment files for your JPA application.
Creating Deployment Files for EclipseLink Database Web Services
This section describes how to automatically generate a WAR file containing the WSDL and all deployment files a EclipseLink database Web service requires, including the following:
- How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table
- How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL
- How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure
- How to Customize a EclipseLink Database Web Service Using Java: Session Customization
- How to Customize a EclipseLink Database Web Service Using project.xml and sessions.xml
- ow to Configure Ant to Use EclipseLink Database Web Services Tasks
- What You May Need to Know About Creating Deployment Files for a EclipseLink Database Web Service
How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table
You can generate a EclipseLink database Web service from an existing relational database table using Ant.
To Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table
- Create the table in your relational database and ensure that the relational database management system is online.
- Execute the GenerateFromTables Ant task, as Generating a EclipseLink Database Web Service from a Table shows.
Generating a EclipseLink Database Web Service from a Table<BuildDBWSWar destfile="emp.war" projectName="emp" sessionsFileName="emp-sessions.xml" platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" classpathref="eclispelink.dbws.path" > <GenerateFromTables driver="${login.driverClass}" userid="${login.username}" password="${login.password}" url="${login.databaseURL}" > <Table <!-- Generates CRUD operations --> catalogPattern="%" schemaPattern="SCOTT" tableNamePattern="XR_EMP" > <Operations> <!-- Additional operations --> <SQLOperation name="findXREmpByName" returnType="xr_empType" > select * from XR_EMP where ENAME like ? <Binding name="ENAME" type="xsd:string" /> </SQLOperation> <SQLOperation name="xr-employeeInfo" isCollection="false" simpleXMLFormatTag="xr-employee-info" xmlTag="aggregate-counts" > select count(*) as "COUNT", max(SAL) as "MAX-Salary" from XR_EMP </SQLOperation> <Procedure catalogPattern="SOME_PKG" schemaPattern="SCOTT" procedurePattern="GetEmployeeByEMPNO_DEPTNO" returnType="xr_empType" /> </Operations> </Table> </GenerateFromTables> </BuildDBWSWar>
Optionally, specify a SessionCustomizer class name using the BuildDBWSWar attribute sessionCustomizerClassName.For more information, see the following: - Package and deploy the EclipseLink database Web service. For more information, see the following:
How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL
You can generate a EclipseLink database Web service from one or more SQL statements written with respect to an existing relational database schema using Ant.
To Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL
- Create your relational database schema and ensure that the relational database management system is online.
- Execute the GenerateFromSQL Ant task, as the following example shows:
- Create an SQLOperation for each SQL statement you want to expose.
- If the SQL statement takes arguments, add a Binding task for each argument.The order in which you define Binding tasks must match the order of the arguments in your SQL statement.
Generating a EclipseLink Databases Service from SQL<BuildDBWSWar destfile="emp.war" projectName="emp" sessionsFileName="emp-sessions.xml" platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" classpathref="eclispelink.dbws.path" > <GenerateFromSQL driver = "oracle.jdbc.OracleDriver" url = "jdbc:oracle:thin:@localhost:1251:orcl" password = "tiger" userid = "scott" > <SQLOperation name="findXREmpByName" returnType="xr_empType" > select * from XR_EMP where ENAME like ? <Binding name="ENAME" type="xsd:string" /> </SQLOperation> <GenerateFromSQL> </BuildDBWSWar>
Optionally, specify a SessionCustomizer class name using the BuildDBWSWar attribute sessionCustomizerClassName.For more information, see the following:
- Package and deploy the EclipseLink database Web service.For more information, see the following:
How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure
You can generate a EclipseLink database Web service from one or more stored procedures, stored functions, and triggers defined in an existing relational database schema using Ant.
To Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure
- Create your relational database schema and ensure that the relational database management system is online.
- Execute the GenerateFromStoredProcedure Ant task, as the following example shows. Create an Operation for each stored procedure, stored function, or trigger you want to expose.
Generating a EclipseLink Databases Service from a Stored Procedure<BuildDBWSWar destfile="emp.war" projectName="emp" sessionsFileName="emp-sessions.xml" platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" classpathref="eclispelink.dbws.path" > <GenerateFromStoredProcedures driver="${login.driverClass}" userid="${login.username}" password="${login.password}" url="${login.databaseURL}" > <Procedure catalogPattern="SOME_PKG" schemaPattern="SCOTT" procedurePattern="GetEmployeeByEMPNO_DEPTNO" returnType="xr_empType" /> </GenerateFromStoredProcedures> </BuildDBWSWar>
Optionally, specify a SessionCustomizer class name using the BuildDBWSWar attribute sessionCustomizerClassName.For more information, see the following:
- Package and deploy the EclipseLink database Web service.For more information, see the following:
How to Customize a EclipseLink Database Web Service Using Java: Session Customization
You can customize a EclipseLink database Web service with a EclipseLink SessionCustomizer.
To Customize a EclipseLink Database Web Service Using Java: Session Customization
- Implement a org.eclipse.persistence.tools.sessionconfiguration.SessionCustomizer, as Implementing a SessionCustomizer shows.
Implementing a SessionCustomizerimport org.eclipse.persistence.tools.sessionconfiguration.SessionCustomizer; import org.eclipse.persistence.sessions.Session; import org.eclipse.persistence.sessions.DatabaseLogin; public class MySessionCustomizer implements SessionCustomizer { public void customize(Sesssion session) { DatabaseLogin login = (DatabaseLogin)session.getDatasourceLogin(); login.setTransactionIsolation(DatabaseLogin.TRANSACTION_READ_UNCOMMITTED); } }
For more information, see Customizing EclipseLink Database Web Services. - Add the SessionCustomizer to the Ant classpath.
- Execute the BuildDBWSWar Ant task, as this example shows.When you execute the BuildDBWSWar Ant task, specify the SessionCustomizer class name using the BuildDBWSWar attribute sessionCustomizerClassName.
Building the EclipseLink Database Web Service WAR File With a Session Customizer<BuildDBWSWar destfile="emp.war" projectName="emp" sessionsFileName="emp-sessions.xml" platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" classpathref="eclispelink.dbws.path" sessionCustomizerClassName = "MySessionCustomizer.class" > <GenerateFromTables> ... </GenerateFromTables> </BuildDBWSWar>
For more information, see the following:- How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table
- How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL
- How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure
- BuildDBWSWar
- EclipseLink Database Web Services WAR File
- Package and deploy the EclipseLink database Web service.For more information, see the following:
How to Customize a EclipseLink Database Web Service Using project.xml and sessions.xml
You can customize a EclipseLink database Web service by creating your own project.xml and sessions.xml files.
To Customize a Oracle Sensor Edge Server Database Web Service Using project.xml and sessions.xml
- Execute the BuildDBWSWar Ant task with a generator, as the following example shows.
Creating the Initial EclipseLink Database Web Services Files<BuildDBWSWar destfile="emp.war" projectName="emp" sessionsFileName="emp-sessions.xml" platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" classpathref="eclispelink.dbws.path" sessionCustomizerClassName = "MySessionCustomizer.class" > <GenerateFromTables> ... </GenerateFromTables> </BuildDBWSWar>
Executing the BuildDBWSWar Ant task with a generator creates the necessary EclipseLink database Web service files and subdirectories.For more information, see the following:
- How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table
- How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL
- How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure
- BuildDBWSWar
- Manually create your project.xml files and sessions.xml file using the Workbench:
- Map your objects to your relational database in a EclipseLink relational project (see Introduction to Relational Projects).
- Map your objects to your XML schema in a EclipseLink XML project (see Introduction to XML Projects).
- Add both projects to your session (see Configuring Multiple Mapping Projects).
Note: Your custom project.xml files must use the same names as specified by BuildDBWSWar attributes ormProjectFilename and oxmProjectFilename. Your custom sessions.xml file must use the same name as specified by BuildDBWSWar attribute sessionsFileName.
For more information, see the following: - Replace the generated project.xml files and sessions.xml file in your EclipseLink database Web services directory hierarchy with your custom project.xml files and sessions.xml files.
- Execute the BuildDBWSWar Ant task without a generator, as the following example shows.
Building the EclipseLink Database Web Service WAR File<xr:BuildDBWSWarclasspathref = "${myApplication.classpath}" contextRoot = "/servlet/MyWebService" destFile = "${stage.dir}/${project.name}.war" ormProjectFilename = "C:/projects/myOrmProject.xml" oxmProjectFilename = "C:/projects/myOxmProject.xml" platformClassName = "org.eclipse.persistence.platform.database.oracle.Oracle11Platform" projectName = "MyWebService" schemaFileName = "C:/projects/myWebService.xsd" sessionsXMLFileName = "C:/projects/mySessions.xml" wsdlFileName = "C:/projects/myWebService.wsdl" wsdlLocationURI =, "http://productionServer:8888/MyWebService"> </xr:BuildDBWSWar>
Executing the BuildDBWSWar Ant task without a generator assembles the EclipseLink database Web service files in the subdirectory of the current working directory named according to the EclipseLinkProjectName attribute.For more information, see the following:
- Package and deploy the EclipseLink database Web service.For more information, see the following:
How to Configure Ant to Use EclipseLink Database Web Services Tasks
Before you can generate a EclipseLink database Web service using Ant within your application's build, you must configure Ant to use EclipseLink database Web service Ant tasks.
To Configure Ant to Use EclipseLink Database Web Services Tasks
- Consider the Ant library dependencies.For more information, see http://ant.apache.org/manual/installl#librarydependencies
- Ensure that the EclipseLink database Web service-specific JAR files that EclipseLink Ant Task Library Dependencies lists are on the Ant classpath.
EclipseLink Ant Task Library DependenciesJAR Name Needed For... Available At... eclipselink-dbws-tools.jar
EclipseLink database Web services Ant tasks and type definitions.
<ECLIPSELINK_HOME>/lib/java/shared/org.eclipse.persistence.dbws/11.1.1.0.0
- Declare EclipseLink database Web service tasks in a eclipselinkant-lib.xml file, as this example shows.
eclipselink-ant-lib.xml File for EclipseLink Database Web Service Ant Tasks<?xml version="1.0"?> <antlib> <taskdef name="GenerateFromTables" classname="org.eclipse.persistence.tools.dbws.GenerateFromTables" /> <taskdef name="GenerateFromSQL" classname="org.eclipse.persistence.tools.dbws.GenerateFromSQL" /> <taskdef name="GenerateFromStoredProcedure" classname="org.eclipse.persistence.tools.dbws.GenerateFromStoredProcedure" /> <taskdef name="GenerateFromPackage" classname="org.eclipse.persistence.tools.dbws.GenerateFromPackage" /> <taskdef name="BuildDBWSWar" classname="org.eclipse.persistence.tools.dbws.BuildDBWSWar" /> <taskdef name="Operation" classname="org.eclipse.persistence.tools.dbws.Op" /> <taskdef name="SQLOperation" classname="org.eclipse.persistence.tools.dbws.SQLOp" /> <taskdef name="Binding" classname="org.eclipse.persistence.tools.dbws.Binding" /> </antlib>
- Include the eclipselink-ant-lib.xml file in your Ant build.xml file, as Specifying the eclipselink-ant-lib.xml File in a build.xml File shows.
Specifying the eclipselink-ant-lib.xml File in a build.xml File<project name="MyBuild" default="validate.session" basedir="." xmlns:eclispelink="eclispelinklib"> <typedef file = "eclipselink-ant-lib.xml" classpathref = "xr.classpath" uri = "eclispelinklib" /> ... </project>
What You May Need to Know About Creating Deployment Files for a EclipseLink Database Web Service
This figure illustrates the process for creating EclipseLink database Web service deployment files.
Creating EclipseLink Database Web Service Deployment Files
This section describes the following:
- EclipseLink Database Web Services Ant Tasks
- EclipseLink Database Web Services WAR File
- Unstructured Data
- Customizing EclipseLink Database Web Services
For more information, see the following:
- Considering EclipseLink Database Web Service Architecture
- eclipselink-dbws.xml File.
- Packaging a EclipseLink Database Web Service
- Deploying a EclipseLink Database Web Service
EclipseLink Database Web Services Ant Tasks
This table lists the Ant tasks that you can use to generate EclipseLink database Web services.
EclipseLink Database Web Services Ant Tasks
Task | EclipseLink Class |
---|---|
org.eclipse.persistence.tools.dbws.Binding | |
org.eclipse.persistence.tools.dbws.BuildDBWSWar | |
org.eclipse.persistence.tools.dbws.GenerateFromSQL | |
org.eclipse.persistence.tools.dbws.GenerateFromStoredProcedure | |
org.eclipse.persistence.tools.dbws.GenerateFromTables | |
org.eclipse.persistence.tools.dbws.Operations | |
org.eclipse.persistence.tools.dbws.Procedure | |
org.eclipse.persistence.tools.dbws.SQLOperation | |
org.eclipse.persistence.tools.dbws.Table |
You can invoke these Ant tasks directly on the command line or within your application's build system. For more information, see How to Configure Ant to Use EclipseLink Database Web Services Tasks.
EclipseLink Database Web Services WAR File
When you generate a EclipseLink database Web service, all generated files are packaged into a WAR file, as the following example shows. EclipseLink Database Web Service WAR File Contents lists the files in these WAR files.
For more information, see EclipseLink Database Web Services Ant Tasks.
EclipseLink Database Web Services WAR File
eclipselink-dbws.war indexl swaref.xsd eclispelink-dbws-schema.xsd META-INF/ MANIFEST.MF web-inf/ oracle-webservices.xml web.xml classes/ META-INF/ eclispelink-dbws.xml eclispelink-dbws-sessions.xml // override eclispelink-dbws.xml sessions-file eclispelink-dbws-or.xml eclispelink-dbws-ox.xml com/ // optional domain classes acme/ Address.class Employee.class PhoneNumber.class wsdl/ eclispelink-dbws.wsdl
EclipseLink Database Web Service WAR File Contents
File | Description |
---|---|
indexl |
Default EclipseLink database Web service landing page.The name and content of this file is determined by its role in Web deployment and cannot be changed.Applicable to all WAR files. |
swaref.xsd |
Contains XML type definitions for attachments.The name and content of this file is determined by its role in Web deployment and cannot be changed. |
topink-dbws-schema.xsd |
Contains XML type definitions for operation arguments and return types. The EclipseLink database Web service automatically generates this file from your database table metadata and uses it to derive element-tag names and types. For more information, see eclispelink-dbws-schema.xsd. |
MANIFEST.MF |
The manifest file for the WAR file. |
oracle-webservices.xml |
The deployment descriptor that the OC4J Web services stack requires.The name and content of this file is determined by its role in Web deployment and cannot be changed. |
web.xml |
The Web application deployment file that binds the EclipseLink database Web service to an OC4J Web services stack servlet. |
eclispelink-dbws.xml |
The EclipseLink database Web services configuration file.For more information, see eclispelink-dbws.xml File. |
eclispelink-dbws-sessions.xml |
The EclipseLink sessions.xml file for this EclipseLink database Web service. It contains references to the EclipseLink relational and object-XML project.xml files.For more information, see Introduction to EclipseLink Sessions. |
eclispelink-dbws-or.xml |
The EclipseLink relational project.xml file.For more information, see Introduction to Relational Projects. |
eclispelink-dbws-ox.xml |
The EclipseLink object-XML project.xml file.For more information, see Introduction to XML Projects. |
eclispelink-dbws.wsdl |
Contains equivalent entries for each operation for the specified EclipseLink database Web service. Required for deployment as a Web service. |
Before you can deploy the EclipseLink database Web service, you must package the WAR in the appropriate Java EE archive for your application, such as an EAR.
For more information, see the following:
Unstructured Data
In some circumstances, a EclipseLink database Web services operation may return unstructured data rather than a persistent entity. For example:
- a resultSet from a custom SQL SELECT statement;
- information returned by a program-unit;
- scalar results such as from a stored function or a count of updated-rows from an update operation.
The OC4J Web services provider will return such unstructured data as documents that conform to the Simple XML Format (SXF) schema shown in this example.
Simple XML Format XSD for Unstructured Data
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:complexType name="sxfType"> <xsd:sequence> <xsd:any minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:element name="simple-xml-format" type="sxfType"/> </xsd:schema>
Example Unstructured Data Document shows a typical unstructured data document. Note the following:
- Element tag names are direct copies of table column names.
- The default root-element tag name is simple-xml-format and each row uses the tag name simple-xml. You can customize these element tag names using attributes simpleXMLFormatTag and xmlTag in Ant tasks and.
- Columnar data uses tag names taken either from the database schema (the actual database column name) or from the stored procedure, stored function, or trigger.
- If a column is a primary key, the EclipseLink database Web service adds a isPrimaryKey attribute to the column tag and sets it to true, as shown for EMPNO in this example.
Example Unstructured Data Document
<?xml version = '1.0' encoding = 'UTF-8'?> <simple-xml-format> <simple-xml> <EMPNO isPrimaryKey="true">7788</EMPNO> <ENAME>SCOTT</ENAME> <JOB>ANALYST</JOB> <MGR>7566</MGR> <HIREDATE>1987-04-19T00:00:00.000-0400</HIREDATE> <SAL>3000</SAL> <DEPTNO>20</DEPTNO> </simple-xml> <simple-xml> <EMPNO isPrimaryKey="true">7369</EMPNO> <ENAME>SMITH</ENAME> <JOB>CLERK</JOB> <MGR>7902</MGR> <HIREDATE>1980-12-17T00:00:00.000-0400</HIREDATE> <SAL>800</SAL> <DEPTNO>20</DEPTNO> </simple-xml> </simple-xml-format>
For more information, see the following:
Customizing EclipseLink Database Web Services
To customize a EclipseLink database Web service, you can do the following:
- Implement a EclipseLink SessionCustomizer class.A SessionCustomizer is a Java class that implements the org.eclipse.persistence.sessionconfiguration.SessionCustomizer interface and provides a default (zero-argument) constructor.Use this class's customize method, which takes an oracle.toplink.essentials.sessions.Session, to programmatically access advanced EclipseLink session API. Using this API you can get object relational and XML descriptors and from descriptors, you can get object relational and XML mappings.
In this way, you can access all session, descriptor, and mapping API to customize any part of the EclipseLink runtime that the EclipseLink database Web service generates. For example, to turn off the session cache. This approach is best when you just want to customize a few details.You specify the SessionCustomizer when you execute the BuildDBWSWar Ant task.By default, the session names are defined based on the eclipselink-dbws.xml file name attribute as follows:- relational session name: name-dbws-or-session
- object-xml session name: name-dbws-ox-session
- Manually generate project.xml files and sessions.xml file.Using your preferred tool, Oracle JDeveloper or Workbench, you can map your objects to your relational database in a EclipseLink relational project, map your objects to your XML schema in a EclipseLink XMl project, and create a EclipseLink sessions.xml file that references both projects.In this way, you can control all aspects of the relational and XML mapping. This approach is best when you want to customize most or all details.
For more information, see the following:
- How to Customize a EclipseLink Database Web Service Using Java: Session Customization
- How to Customize a EclipseLink Database Web Service Using project.xml and sessions.xml
- BuildDBWSWar
- EclipseLink API Reference
Binding
The Binding Ant task is a EclipseLink database Web services task you use to bind an argument in an SQL statement to an XSD data type.
The order in which you define Binding tasks must match the order of the arguments in your SQL statement, as SQLOperation Task: With Binding Elements for Arguments shows.
Using Parameters
Binding Task Parameters
Attribute | Description | Required |
---|---|---|
name |
The name of the stored procedure, stored function, or trigger to execute. The parent task that owns the Operation specifies the database that provides the stored procedure, stored function, or trigger.For more information, see GenerateFromSQL. |
Yes |
type |
The XSD data type to bind to the argument name. |
Yes |
Examples
The following example shows a typical SQLOperation task that specifies arguments using nested Binding tasks. The order in which you define Binding tasks must match the order of the arguments in your SQL statement.
For example, the SQLOperation named FindAnEmployee takes one int argument (EMPNO), one string argument (LAST_NAME), and returns all fields in a RowSet using a rowsetTag of employee-rowset and a rowTag of employee
SQLOperation Task: With Binding Elements for Arguments
<xr:GenerateFromSQL driver = "oracle.jdbc.OracleDriver" user = "scott" password = "tiger" url = "jdbc:oracle:thin:@localhost:1251:orcl" rdbms = "org.eclipse.persistence.platform.database.oracle.Oracle9Platform" tablename = "EMP" EclipseLinkProjectName = "employeeService" logLevel = "CONFIG" classpathref = "${myApplication.classpath}"> <xr:SQLOperation name="CountEmployees" rowTag="employee-info"> select count(*) from EMP </xr:SQLOperation> <xr:SQLOperation name="FindAnEmployee" rowsetTag="employee-rowset" rowTag="employee"> select * from EMP where EMPNO = ? and LAST_NAME = ? <xr:Binding name="EMPNO" type="xsd:int"/> <xr:Binding name="LAST_NAME" type="xsd:string"/> </xr:SQLOperation </xr:GenerateFromSQL>
For more information, see SQLOperation.
BuildDBWSWar
The BuildDBWSWar Ant task (see BuildDBWSWar Task) is a EclipseLink database Web services task you use either with a EclipseLink database Web services generator task or without.
When you execute the BuildDBWSWar task with a generator, the BuildDBWSWar task generates EclipseLink database Web services files and assemble them into a Web Archive (WAR) file. The BuildDBWSWar task supports the following generators:
When you execute the BuildDBWSWar task without a generator, the BuildDBWSWar task assembles EclipseLink database Web services files in a subdirectory of the current working directory named according to the EclipseLinkProjectName attribute into a Web Archive (WAR) file.
This allows you to customize the generated EclipseLink database Web services files and then execute the BuildDBWSWar task again to re-package the WAR file to include your changes.
This task extends the Ant Jar task and inherits its attributes and nested elements.
Using Parameters
BuildDBWSWar Task Parameters
Attribute | Description | Required | Default |
---|---|---|---|
classpathref |
Reference to a path defined elsewhere.The EclipseLink database Web services classpath must includes references to:
|
Yes |
None |
contextRoot |
The value of the web.xml file servlet-mapping element's url-pattern sub-element.Example: <servlet-mapping> ... <url-pattern> /servlet/MyWebService </url-pattern> </servlet-mapping> |
Yes |
None |
destfile |
The fully qualified path to the WAR file. |
Yes |
None |
dataSource |
JNDI datasource location to be inserted into the EclipseLink database Web service sessions.xml file (see sessionsFileName).The JNDI name you use here is as defined in ORACLE_INSTANCE/config/oc4j/OC4J_INSTANCE/data-sources.xml file element managed-data-source attribute jndi-name or element native-data-source attribute jndi-name.You must configure this datasource in OC4J before deploying your EclipseLink database Web service.Use this attribute as an alternative to generator attributes:
<data-sources ... > <connection-pool name="MyPool"> ... </connection-pool> <managed-data-source name="OracleManagedDS" jndi-name="jdbc/OracleDS" connection-pool-name="MyPool" ... /> </data-sources ... > |
No |
None |
logLevel |
Control the amount and detail of log output by configuring the log level (in ascending order of information) to one of the following java.util.logging.Level values:
|
No |
INFO |
platformClassName |
The fully qualified name of the EclipseLink database platform class to use to connect to the relational database. This class must be in the task classpath.Example: org.eclipse.persistence.platform.database.oracle.Oracle11Platform |
Yes–when you execute this task with a generator to generate a new service.No–when you execute this task without a generator to assemble pre-existing metadata files. |
None |
projectName |
The name of this EclipseLink database Web service.By default, the EclipseLink project names are defined based on this attribute:
|
Yes–when you execute this task with a generator to generate a new service.No–when you execute this task without a generator to assemble pre-existing metadata files. |
eclipselink-dbws.xml file element name. For more information, see eclipselink-dbws.xml File. |
sessionCustomizerClassName |
The name of the org.eclipse.persistence.sessions.SessionCustomizer class you use to customize the EclipseLink database Web service.For more information, see [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization]. |
Yes–when you execute this task with a generator to generate a new service.No–when you execute this task without a generator to assemble pre-existing metadata files. |
None |
sessionsFileName |
The name of the EclipseLink sessions.xml file that references the relational and XML projects.By default, the EclipseLink session names are defined based on the projectName attribute:
|
Yes–when you execute this task with a generator to generate a new service.No–when you execute this task without a generator to assemble pre-existing metadata files. |
eclipselink-dbws-sessions.xml |
targetNameSpace |
The URI of the target namespace that the EclipseLink database Web service inserts into the eclipselink-dbws-schema.xsd file. For more information, see #eclipselink-dbws-schema.xsd. |
No |
"urn:" + projectName |
wsdlLocationURI |
URI of this EclipseLink DBWS service's WSDL (used by Web Service tools to generate client code). |
No |
Specifying Parameters as Nested Elements
You can specify the following as nested elements of this task:
- Ant classpath element
- GenerateFromSQL;
- GenerateFromStoredProcedures;
- GenerateFromTables.
Examples
This example shows a typical BuildDBWSWar task.
BuildDBWSWar Task
<BuildDBWSWar destfile="emp.war" projectName="emp" sessionsFileName="emp-sessions.xml" platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" classpathref="eclipselink.dbws.path" > <GenerateFromTables driver="${login.driverClass}" userid="${login.username}" password="${login.password}" url="${login.databaseURL}" > <Table <!-- Generates CRUD operations --> catalogPattern="%" schemaPattern="SCOTT" tableNamePattern="XR_EMP" > <Operations> <!-- Additional operations --> <SQLOperation name="findXREmpByName" returnType="xr_empType" > select * from XR_EMP where ENAME like ? <Binding name="ENAME" type="xsd:string" /> </SQLOperation> <SQLOperation name="xr-employeeInfo" isCollection="false" simpleXMLFormatTag="xr-employee-info" xmlTag="aggregate-counts" > select count(*) as "COUNT", max(SAL) as "MAX-Salary" from XR_EMP </SQLOperation> <Procedure catalogPattern="SOME_PKG" schemaPattern="SCOTT" procedurePattern="GetEmployeeByEMPNO_DEPTNO" returnType="xr_empType" /> </Operations> </Table> </GenerateFromTables> </BuildDBWSWar>
For more information, see the following:
- How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table
- How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL
- How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure
GenerateFromSQL
The GenerateFromSQL task is a EclipseLink database Web services task you use to generate a Web service based on one or more SQL statements you specify with SQLOperation nested elements. You specify SQL statements with respect to the existing relational database schema that the SQLOperation element's parent identifies.
This task generates an operation for each SQLOperation nested element you specify.
This task generates EclipseLink database Web service files in a subdirectory of the current working directory named according to the EclipseLinkProjectName attribute.
Using Parameters
GenerateFromSQL Task Parameters
Attribute | Description | Required | Default |
---|---|---|---|
driver |
The fully qualified name of the JDBC driver class to use to connect to the relational database. This class must be in the task classpath.This attribute is inherited from the Ant Sql task.Example: oracle.jdbc.OracleDriver |
No–Can be overridden by BuildDBWSWar attribute dataSource. |
None |
password |
The password to use when connecting to the relational database.This attribute is inherited from the Ant Sql task. |
No–Can be overridden by BuildDBWSWar attribute dataSource. |
None |
url |
The connection URL to use when connecting the relational database.This attribute is inherited from the Ant Sql task.Example: jdbc:oracle:thin:@HOST_NAME:PORT:SID |
No–Can be overridden by BuildDBWSWar attribute dataSource. |
None |
userid |
The user name to use when connecting to the relational database.This attribute is inherited from the Ant Sql task. |
No–Can be overridden by BuildDBWSWar attribute dataSource. |
None |
Specifying Parameters as Nested Elements
You can specify the following parameters as nested elements of this task:
Examples
GenerateFromSQL Task shows a typical GenerateFromSQL task that specifies an SQLOperation.
The EclipseLink database Web service named emp will contain an operation findXREmpByName that takes one string argument (ENAME) and returns all records from the XR_EMP table whose ENAME column is like the argument. Results are returned as a Collection of xr_emptType instances.
EGenerateFromSQL Task
<BuildDBWSWar destfile="emp.war" projectName="emp" sessionsFileName="emp-sessions.xml" platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" classpathref="eclipselink.dbws.path" > <GenerateFromSQL driver = "oracle.jdbc.OracleDriver" url = "jdbc:oracle:thin:@localhost:1251:orcl" password = "tiger" userid = "scott" > <SQLOperation name="findXREmpByName" returnType="xr_empType" > select * from XR_EMP where ENAME like ? <Binding name="ENAME" type="xsd:string" /> </SQLOperation> <GenerateFromSQL> </BuildDBWSWar
For more information, see How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL.
GenerateFromStoredProcedures
The GenerateFromStoredProcedures task is a EclipseLink database Web services task you use to generate a Web service based on one or more stored procedures, stored functions, or triggers you specify with Procedure nested elements. You specify stored procedures, stored functions, or triggers with respect to the existing relational database schema that the Procedure element's parent identifies.
This task generates an operation for each Procedure nested element you specify.
This task generates EclipseLink database Web service files in a subdirectory of the current working directory named according to the EclipseLinkProjectName attribute.
Using Parameters
GenerateFromStoredProcedures Task Parameters
Attribute | Description | Required | Default |
---|---|---|---|
driver |
The fully qualified name of the JDBC driver class to use to connect to the relational database. This class must be in the task classpath.This attribute is inherited from the Ant Sql task.Example: oracle.jdbc.OracleDriver |
No–Can be overridden by BuildDBWSWar attribute dataSource. |
None |
password |
The password to use when connecting to the relational database.This attribute is inherited from the Ant Sql task. |
No–Can be overridden by BuildDBWSWar attribute dataSource. |
None |
url |
The connection URL to use when connecting the relational database.This attribute is inherited from the Ant Sql task.Example: jdbc:oracle:thin:@HOST_NAME:PORT:SID |
No–Can be overridden by BuildDBWSWar attribute dataSource. |
None |
userid |
The user name to use when connecting to the relational database.This attribute is inherited from the Ant Sql task. |
No–Can be overridden by BuildDBWSWar attribute dataSource. |
None |
Specifying Parameters as Nested Elements
You can specify the following parameters as nested elements of this task:
Examples
GenerateFromStoredProcedures Task shows a typical GenerateFromStoredProcedures task that specifies a Procedure for each of two stored procedures.
The EclipseLink database Web service named emp will contain one operation GetEmployeeByEMPNO_DEPTNO that invokes a stored procedure such as this:
GetEmployeeByEMPNO_DEPTNO(I_EMPNO IN NUMBER,I_DEPTNO IN NUMBER, Y OUT SYS_REFCURSOR); OPEN y FOR SELECT * FROM XR_EMP where EMPNO = I_EMPNO and DEPTNO = I_DEPTNO;
Note that if procedurePattern matches more than one stored procedure, stored function, or trigger, then the EclipseLink database Web service will contain a procedure for each match. For more information, see Procedure.
GenerateFromStoredProcedures Task
<BuildDBWSWar destfile="emp.war" projectName="emp" sessionsFileName="emp-sessions.xml" platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" classpathref="eclipselink.dbws.path" > <GenerateFromStoredProcedures driver="${login.driverClass}" userid="${login.username}" password="${login.password}" url="${login.databaseURL}" > <Procedure catalogPattern="SOME_PKG" schemaPattern="SCOTT" procedurePattern="GetEmployeeByEMPNO_DEPTNO" returnType="xr_empType" /> </GenerateFromStoredProcedures> </BuildDBWSWar>
For more information, see How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure.
GenerateFromTables
The GenerateFromTables task is a EclipseLink database Web services task you use to generate a Web service based on one or more relational database tables.
This task generates the following operations for each table you specify using one or more Table nested elements:
- create
- findAll
- findByPrimaryKey
- update
- delete
These operations apply to a single table only: they do not traverse relationships to other tables. For example, the read operation returns the key value of a foreign key column, not the row it references in a related table.
This task generates EclipseLink database Web service files in a subdirectory of the current working directory named according to the EclipseLinkProjectName attribute.
Using Parameters
GenerateFromTables Task Parameters
Attribute | Description | Required | Default |
---|---|---|---|
driver |
The fully qualified name of the JDBC driver class to use to connect to the relational database. This class must be in the task classpath.This attribute is inherited from the Ant Sql task. Example: oracle.jdbc.OracleDriver |
No–Can be overridden by BuildDBWSWar attribute dataSource. |
None |
password |
The password to use when connecting to the relational database.This attribute is inherited from the Ant Sql task. |
No–Can be overridden by BuildDBWSWar attribute dataSource. |
None |
url |
The connection URL to use when connecting the relational database.This attribute is inherited from the Ant Sql task. Example: jdbc:oracle:thin:@HOST_NAME:PORT:SID |
No–Can be overridden by BuildDBWSWar attribute dataSource. |
None |
userid |
The user name to use when connecting to the relational database.This attribute is inherited from the Ant Sql task. |
No–Can be overridden by BuildDBWSWar attribute dataSource. |
None |
Specifying Parameters as Nested Elements
You can specify the following parameters as nested elements of this task:
- Table–this is a mandatory element. The GenerateFromTables task requires at least one Table element.
Examples
GenerateFromTables Task shows a typical GenerateFromTables task.
The EclipseLink database Web service named emp will contain create, read, read-all, update, and delete operations for table XR_EMP.
Note that if tableNamePattern matches more than one table name, then the EclipseLink database Web service will contain create, read, read-all, update, and delete operations for each match. For more information, see Table.
GenerateFromTables Task
<BuildDBWSWar destfile="emp.war" projectName="emp" sessionsFileName="emp-sessions.xml" platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" classpathref="eclipselink.dbws.path" > <GenerateFromTables driver="${login.driverClass}" userid="${login.username}" password="${login.password}" url="${login.databaseURL}" > <Table <!-- Generates CRUD operations --> catalogPattern="%" schemaPattern="SCOTT" tableNamePattern="XR_EMP" > </Table> </GenerateFromTables> </BuildDBWSWar>
For more information, see How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table.
Operations
The Operations task is a EclipseLink database Web services task you use to specify one or more stored procedure or SQL operations.
This task is applicable only in Table tasks. For more information, see Table.
Using Parameters
This task has no parameters (only nested elements).
Specifying Parameters as Nested Elements
You can specify the following parameters as nested elements of this task:
Examples
This example shows a typical Operations task.
Operations Task
<BuildDBWSWar destfile="emp.war" projectName="emp" sessionsFileName="emp-sessions.xml" platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" classpathref="eclipselink.dbws.path" > <GenerateFromTables driver="${login.driverClass}" userid="${login.username}" password="${login.password}" url="${login.databaseURL}" > <Table <!-- Generates CRUD operations --> catalogPattern="%" schemaPattern="SCOTT" tableNamePattern="XR_EMP" > <Operations> <!-- Additional operations --> <SQLOperation name="findXREmpByName" returnType="xr_empType" > select * from XR_EMP where ENAME like ? <Binding name="ENAME" type="xsd:string" /> </SQLOperation> <SQLOperation name="xr-employeeInfo" isCollection="false" simpleXMLFormatTag="xr-employee-info" xmlTag="aggregate-counts" > select count(*) as "COUNT", max(SAL) as "MAX-Salary" from XR_EMP </SQLOperation> <Procedure catalogPattern="SOME_PKG" schemaPattern="SCOTT" procedurePattern="GetEmployeeByEMPNO_DEPTNO" returnType="xr_empType" /> </Operations> </Table> </GenerateFromTables> </BuildDBWSWar>
For more information, see How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table.
Procedure
The Procedure task is a EclipseLink database Web services task you use to specify a stored procedure.
You can invoke this task from the following parent tasks:
Using Parameters
Procedure Task Parameters
Attribute | Description | Required | Default |
---|---|---|---|
catalogPattern |
A pattern that matches one or more catalog names in the database identified by the parent task (supports SQL-92 % wild-card). |
No |
% |
schemaPattern |
A pattern that matches one or more schema names in the database identified by the parent task (supports SQL-92 % wild-card). |
No |
% |
procedurePattern |
A pattern that matches one or more stored procedure, stored function, or stored trigger names in the database identified by the parent task (supports SQL-92 % wild-card). |
Yes |
None |
isCollection |
Specifies whether or not the procedure returns multiple results. Valid values are:
|
No |
true |
isSimpleXMLFormat |
Specifies whether or not the procedure returns information in the Simple XML Format (SXF). Valid values are:
|
Yes |
false |
simpleXMLFormatTag |
The name of the root-level Simple XML Format element-tag.For more information, see Unstructured Data. |
No |
simple-xml-format |
xmlTag |
The name of the grouping XML element-tag for rows.For more information, see Unstructured Data. |
No |
simple-xml |
binaryAttachment |
Specifies whether or not the operation returns binary data as a SOAP attachment. Valid values are:
|
No |
false |
returnType |
Specifies a return type when the operation's return type cannot be deduced from database metadata. Valid values are any type that the eclipselink-dbws-schema.xsd file defines. For more information, see [[#eclipselink-dbws-schema.xsd]. |
No |
Deduced from database metadata |
Examples
This example shows a Procedure task.
Procedure Task
<BuildDBWSWar destfile="emp.war" projectName="emp" sessionsFileName="emp-sessions.xml" platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" classpathref="eclipselink.dbws.path" > <GenerateFromStoredProcedures driver="${login.driverClass}" userid="${login.username}" password="${login.password}" url="${login.databaseURL}" > <Procedure catalogPattern="SOME_PKG" schemaPattern="SCOTT" procedurePattern="GetEmployeeByEMPNO_DEPTNO" isSimpleXMLFormat = "true" simpleXMLFormatTag = "EmployeesByEmpNoDeptNo" xmlTag = "Employee" /> </GenerateFromStoredProcedures> </BuildDBWSWar>
The EclipseLink database Web service named emp will contain one operation GetEmployeeByEMPNO_DEPTNO that invokes a stored procedure of the same name (defined in the database table that the parent task specifies) like this:
GetEmployeeByEMPNO_DEPTNO(I_EMPNO IN NUMBER,I_DEPTNO IN NUMBER, Y OUT SYS_REFCURSOR); OPEN y FOR SELECT * FROM XR_EMP where EMPNO = I_EMPNO and DEPTNO = I_DEPTNO;
Note that if procedurePattern matches more than one stored procedure, stored function, or trigger, then the EclipseLink database Web service will contain a procedure for each match.
This procedure returns unstructured data in the Simple XML Format, as Unstructured Data Result shows. Column tags (like EMPNO, DEPTNO, and SAL) are determined by the database schema.
Unstructured Data Result
<?xml version = '1.0' encoding = 'UTF-8'?> <EmployeesByEmpNoDeptNo> <Employee> <EMPNO isPrimaryKey="true">12345</EMPNO> <DEPTNO>50</DEPTNO> <SAL>125000</SAL> ... </Employee> <Employee> <EMPNO isPrimaryKey="true">67890</EMPNO> <DEPTNO>40</DEPTNO> <SAL>75000</SAL> ... </Employee> ... </EmployeesByEmpNoDeptNo>
For more information, see How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL.
SQLOperation
The SQLOperation task is a EclipseLink database Web services task you use to specify an SQL statement.
You can invoke this task from the following parent tasks:
Using Parameters
SQLOperation Task Parameters
Attribute | Description | Required | Default |
---|---|---|---|
name |
The name of the SQL operation. The parent task that owns the SQLOperation specifies the database on which to perform the SQL operation. |
Yes |
|
isCollection |
Specifies whether or not the procedure returns multiple results. Valid values are:
|
No |
true |
isSimpleXMLFormat |
Specifies whether or not the procedure returns information in the Simple XML Format (SXF). Valid values are:
|
Yes |
false |
simpleXMLFormatTag |
The name of the root-level Simple XML Format element-tag.For more information, see Unstructured Data. |
No |
simple-xml-format |
xmlTag |
The name of the grouping XML element-tag for rows.For more information, see Unstructured Data. |
No |
simple-xml |
binaryAttachment |
Specifies whether or not the operation returns binary data as a SOAP attachment. Valid values are:
|
No |
false |
returnType |
Specifies a return type when the operation's return type cannot be deduced from database metadata. Valid values are any type that the eclipselink-dbws-schema.xsd file defines. For more information, see [[#eclipselink-dbws-schema.xsd]. |
No |
Deduced from database metadata |
Specifying Parameters as Nested Elements
You can specify the following parameter as nested element of this task:
Examples
This example shows two SQLOperation tasks.
SQLOperation Task
<BuildDBWSWar destfile="emp.war" projectName="emp" sessionsFileName="emp-sessions.xml" platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" classpathref="eclipselink.dbws.path" > <GenerateFromSQL driver = "oracle.jdbc.OracleDriver" url = "jdbc:oracle:thin:@localhost:1251:orcl" password = "tiger" userid = "scott" > <SQLOperation name="findXREmpByName" returnType="xr_empType" > select * from XR_EMP where ENAME like ? <Binding name="ENAME" type="xsd:string" /> </SQLOperation> <SQLOperation name="xr-employeeInfo" isCollection="false" simpleXMLFormatTag="xr-employee-info" xmlTag="aggregate-counts" > select count(*) as "COUNT", max(SAL) as "MAX-Salary" from XR_EMP </SQLOperation> <GenerateFromSQL> </BuildDBWSWar
The EclipseLink database Web service named emp will contain two operations:
- findXREmpByName that takes one string argument (ENAME) and returns all records from the XR_EMP table whose ENAME column is like the argument. Results are returned as a Collection of xr_emptType instances.
- xr-employeeInfo that returns unstructured data in the Simple XML Format as Unstructured Data Result shows. In this output, COUNT is the number of records in table XR_EMP and MAX-Salary is the largest number in the SAL column. The tag names COUNT and MAX-Salary are as specified in the SQL statement.
Unstructured Data Result
<?xml version = '1.0' encoding = 'UTF-8'?> <xr-employee-info> <aggregate-counts> <COUNT>60000</COUNT> <MAX-Salary>125000</MAX-Salary> </aggregate-counts> </xr-employee-info>
For more information, see How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL.
Table
The Table task is a EclipseLink database Web services task you use to specify a database table.
This task is applicable only in GenerateFromTables tasks. For more information, see GenerateFromTables.
Using Parameters
Table Task Parameters
Attribute | Description | Required | Default |
---|---|---|---|
catalogPattern |
A pattern that matches one or more catalog names in the database identified by the parent task (supports SQL-92 % wild-card). |
No |
% |
schemaPattern |
A pattern that matches one or more schema names in the database identified by the parent task (supports SQL-92 % wild-card). |
No |
% |
tableNamePattern |
A pattern that matches one or more table names in the database identified by the parent task (supports SQL-92 % wild-card). |
Yes |
None |
Specifying Parameters as Nested Elements
You can specify the following parameters as nested elements of this task:
Examples
The following example shows a typical Table task.
The EclipseLink database Web service named emp will contain create, read, read-all, update, and delete operations for table XR_EMP.
Note that if tableNamePattern matches more than one table name, then the EclipseLink database Web service will contain create, read, read-all, update, and delete operations for each match.
Table Task
<BuildDBWSWar destfile="emp.war" projectName="emp" sessionsFileName="emp-sessions.xml" platformClassName="org.eclipse.persistence.platform.database.oracle.Oracle10Platform" classpathref="eclipselink.dbws.path" > <GenerateFromTables driver="${login.driverClass}" userid="${login.username}" password="${login.password}" url="${login.databaseURL}" >
</GenerateFromTables> </BuildDBWSWar>
For more information, see How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table.
Configuring the orion-ejb-jar.xml File for OC4J
To deploy a EclipseLink application to OC4J Release R1 or later, modify the orion-ejb-jar.xml file. For more information, see How to Configure persistence-manager Entries.
How to Configure persistence-manager Entries
If you are using EclipseLink as your OC4J persistence manager, the default persistence manager in Release R1, you can configure the persistence-manager subentry (see orion-ejb-jar.xml File persistence-manager Entries) in the orion-ejb-jar.xml file.
If you are not using EclipseLink as your OC4J persistence manager, do not modify the persistence-manager subentries.
OC4J does not support entity-deployment attribute pm-name. Use persistence-manager attribute name instead (see orion-ejb-jar.xml File persistence-manager Entries). When OC4J parses the orion-ejb.jar.xml file, if it finds a pm-name attribute, OC4J ignores its value and logs the following warning message:
WARNING: Use of pm-name is unsupported and will be removed in a future release. Specify pm usage using <persistence-manager> 'name' instead. |
orion-ejb-jar.xml File persistence-manager Entries
Entry | Description |
---|---|
name |
The name of the persistence manager to use. Set this value to eclipselink.If you set the name property to eclipselink, you may also configure pm-properties (see #Configuring pm-properties). |
class-name |
Do not configure this attribute. If name is set to eclipselink, then class-name is set correctly by default. |
descriptor |
This property applies only when name is set to eclipselink.If you export your EclipseLink mapping metadata to a deployment XML file, set this property to the name of the deployment XML file (default: toplink-ejb-jar.xml).Do not set this property if you are using a EclipseLink project class instead of a mapping metadata file (see project-class in orion-ejb-jar.xml File persistence-manager Subentries for pm-properties). |
Configuring pm-properties
When you select EclipseLink as the persistence manager (see name in orion-ejb-jar.xml File persistence-manager Entries), use the persistence-manager subentries for pm-properties (see orion-ejb-jar.xml File persistence-manager Subentries for pm-properties) to configure the EclipseLink session that the EclipseLink run time creates and uses internally.
Note: You can only configure a subset of session features using these properties and in most cases, default configuration applies. To configure all session features and to override defaults, you must use a customization class (see customization-class in orion-ejb-jar.xml File persistence-manager Subentries for pm-properties). |
orion-ejb-jar.xml File persistence-manager Subentries for pm-properties
Entry | Description |
---|---|
session-name |
Unique name for this EclipseLink-persisted EJB deployment JAR file. Must be unique among all EclipseLink-persisted deployed JAR files in this application server instance.When the EclipseLink run time internally creates a EclipseLink session for this EclipseLink-persisted deployed JAR file, the EclipseLink session manager stores the session instance under this session-name. For more information about the session manager, see Acquiring and Using Sessions at Run Time).If you do not specify a name, the EclipseLink runtime will generate a unique name. |
project-class |
If you export your EclipseLink mapping metadata to a Java class (that extends org.eclipse.persistence.sessions.Project), set this property to the name of the class, fully qualified by its package name. Be sure to include the class file in the deployable JAR file.Do not set this property if you are using a mapping metadata file (see descriptor in orion-ejb-jar.xml File persistence-manager Entries). |
customization-class |
Optional Java class (that implements org.eclipse.persistence.ejb.cmp.DeploymentCustomization) used to allow deployment customization of EclipseLink mapping and run-time configuration. At deployment time, the EclipseLink run time creates a new instance of this class and invokes its methods beforeLoginCustomization (before the EclipseLink run time logs into the session) and afterLoginCustomization (after the EclipseLink runtime logs into the session), passing in the EclipseLink session as a parameter.Use your implementation of the beforeLoginCustomization method to configure session attributes not supported by the pm-properties including: cache coordination (see also Configuring cache-synchronization Properties), parameterized SQL, native SQL, batch writing/batch size, byte-array/string binding, EIS login, event listeners, table qualifier, and sequencing. For more information about session configuration, see Configuring a Session.The class must be fully qualified by its package name and included in the deployment JAR file. |
db-platform-class |
Optional EclipseLink database platform class (instance of org.eclipse.persistence.platform.database or org.eclipse.persistence.platform.database.oracle) containing EclipseLink support specific to a particular database.Set this value to the database platform class that corresponds to the database that your application uses. The class must be fully qualified by its package name. |
remote-relationships |
Optional flag to allow relationships between remote objects. Valid values are:
|
cache-synchronization |
|
default-mapping |
Configuring cache-synchronization Properties
When you select EclipseLink as the persistence manager (see name in orion-ejb-jar.xml File persistence-manager Entries), use the pm-properties subentry for cache-synchronization (see #Table 8-16) to configure EclipseLink cache coordination features of the session that the EclipseLink run time uses internally for CMP projects. For more information about EclipseLink cache coordination, see Cache Coordination.
When this subentry is present, you must use a customization class (see customization-class in orion-ejb-jar.xml File persistence-manager Subentries for pm-properties) to complete cache coordination configuration. For more information about EclipseLink cache coordination configuration, see Configuring a Coordinated Cache.
Table 8-16 orion-ejb-jar.xml File pm-properties Subentries for cache-synchronization
Entry | Description |
---|---|
mode |
An indicator of whether or not cache coordination updates should be propagated to other servers synchronously or asynchronously. Valid values are as follows:
|
server-url |
For a JMS coordinated cache: assuming that you are using the Oracle Containers for J2EE (OC4J) JNDI naming service and that all the hosts in your coordinated cache can communicate using OC4J proprietary RMI protocol ORMI, use a URL like: ormi://<JMS-host-IP>:<JMS-host-port> where JMS-host-IP is the IP address of the host on which the JMS service provider is running and JMS-host-port is the port on which the JMS service provider is listening for JMS requests.For an RMI or CORBA coordinated cache: assuming that you are using the OC4J JNDI naming service and that all the hosts in your coordinated cache can communicate using OC4J proprietary RMI protocol ORMI on OC4J default port 23791, use a URL like: ormi://<session-host-IP>:23791 where session-host-IP is the IP address of the host on which this session is deployed. |
server-user |
Optional username required to log in to the JNDI naming service. |
Configuring default-mapping Properties
When you select EclipseLink as the persistence manager (see name in orion-ejb-jar.xml File persistence-manager Entries), use the pm-properties subentry for default-mapping (see the following table) to configure the EclipseLink default mapping and automatic table generation feature.
For more information about EclipseLink automatic table generation, see Creating Database Tables Automatically.
orion-ejb-jar.xml File pm-properties Subentries for default-mapping
Entry | Description |
---|---|
db-table-gen |
Optional element that determines what EclipseLink will do to prepare the database tables that are being mapped to. Valid values are:
|
extended-table-names |
An element used if the generated table names are not long enough to be unique. Values are restricted to true or false (default). When set to true, the EclipseLink run time will ensure that generated tables names are unique.In default mapping, each entity is mapped to one table. The only exception is in many-to-many mappings where there is one extra relation table involved in the source and target entities.When extended-table-names is set to false (the default), a simple table naming algorithm is used as follows: table names are defined as TL_<bean_name>. For example, if the bean name is Employee, the associated table name would be TL_EaMPLOYEE.However, if the same entity is defined in multiple JAR files in an application, or across multiple applications, table-naming collision is inevitable.To address this problem, set extended-table-names to true. When set to true, EclipseLink uses an alternative table-naming algorithm as follows: table names are defined as <bean_name>_<jar_name>_<app_name>. This algorithm uses the combination of bean, JAR, and EAR names to form a table name unique across the application. For example, given a bean named Employee, which is in Test.jar, which is in Demo.ear (and the application name is "Demo"), then the corresponding table name will be EMPLOYEE_TEST_DEMO.If there is no orion-ejb-jar.xml file defined in the EAR file, the OC4J container generates one during deployment. In this case, to specify a value for extended-table-names, use the EclipseLink system property eclipselink.defaultmapping.useExtendedTableNames. For example: -Declipselink.defaultmapping.useExtendedTableNames="true".The orion-ejb-jar.xml property overrides the system property. If both the orion-ejb-jar.xml property and the system property are present, EclipseLink retrieves the setting from the orion-ejb-jar.xml file. |
Configuring the weblogic-ejb-jar.xml File for BEA WebLogic Server
Before you deploy a EclipseLink application to a BEA WebLogic Server, you must modify the weblogic-ejb-jar.xml file.
Avoid the weblogic-ejb-jar.xml tags that EclipseLink either does not support or does not require (see What You May Need to Know About Unsupported weblogic-ejb-jar.xml File Tags).
What You May Need to Know About Unsupported weblogic-ejb-jar.xml File Tags
The weblogic-ejb-jar.xml file includes the following tags that EclipseLink either does not support or does not require:
- concurrency-strategy: This tag specifies how WebLogic manages concurrent users for a given bean. Because EclipseLink manages concurrent access internally, it does not require this tag.For more information about the EclipseLink concurrency strategy, see Configuring Locking Policy.
- db-is-shared: Because EclipseLink does not make any assumptions about the exclusivity of database access, EclipseLink does not require this tag. EclipseLink addresses multiuser access issues through various locking and refreshing policies.
- delay-updates-until-end-of-tx: EclipseLink always delays updates until the end of a transaction, and does not require this tag.
- finders-load-bean: EclipseLink always loads the bean upon execution of the finder, and does not require this tag.
- pool: EclipseLink does not use a pooling strategy for entity beans. This avoids object-identity problems that can occur due to pooling.
- lifecycle: This element manages beans that follow a pooling strategy. Because EclipseLink does not use a pooling strategy, EclipseLink ignores this tag.
- is-modified-method-name: EclipseLink does not require a bean developer-defined method to detect changes in the object state.
- isolation-level: Because isolation level settings for the cache or database transactions are specified in the EclipseLink project, EclipseLink ignores this tag.
- cache: Because you define EclipseLink cache properties in Workbench, this tag is unnecessary.