Jump to: navigation, search

Difference between revisions of "Creating EclipseLink Files for Deployment (ELUG)"

m
m
 
(36 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 +
[[Image:Elug draft icon.png]] '''For the latest EclipseLink documentation, please see http://www.eclipse.org/eclipselink/documentation/ '''
 +
 +
----
 +
 
<div style="float:right;border:1px solid #000000;padding:5px">__TOC__
 
<div style="float:right;border:1px solid #000000;padding:5px">__TOC__
 
[[Special:Whatlinkshere/Creating EclipseLink Files for Deployment (ELUG)|Related Topics]]</div>
 
[[Special:Whatlinkshere/Creating EclipseLink Files for Deployment (ELUG)|Related Topics]]</div>
Line 9: Line 13:
 
* [[Deploying%20a%20EclipseLink%20Application%20(ELUG)|Deploying a EclipseLink Application]]
 
* [[Deploying%20a%20EclipseLink%20Application%20(ELUG)|Deploying a EclipseLink Application]]
 
* [[Packaging and Deploying EclipseLink JPA Applications (ELUG)|Packaging and Deploying EclipseLink JPA Applications]]
 
* [[Packaging and Deploying EclipseLink JPA Applications (ELUG)|Packaging and Deploying EclipseLink JPA Applications]]
 
+
*[[EclipseLink/UserGuide/Creating_Deployment_Files_for_EclipseLink_Database_Web_Services_%28ELUG%29|Creating Deployment Files for EclipseLink Web Services]]
  
  
Line 17: Line 21:
 
* [[#project.xml File|project.xml File]]
 
* [[#project.xml File|project.xml File]]
 
* [[#sessions.xml File|sessions.xml File]]
 
* [[#sessions.xml File|sessions.xml File]]
* [[#eclispelink-dbws-schema.xsd|eclispelink-dbws-schema.xsd]]
 
  
 
Workbench provides the ability to [[Creating%20a%20Project%20(ELUG)#Exporting Project Information)|create deployment files from a Workbench project]]. After you build a project, you have two options to create the deployment files:
 
Workbench provides the ability to [[Creating%20a%20Project%20(ELUG)#Exporting Project Information)|create deployment files from a Workbench project]]. After you build a project, you have two options to create the deployment files:
Line 33: Line 36:
  
 
===project.xml File===
 
===project.xml File===
 
 
The <tt>project.xml</tt> 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.
 
The <tt>project.xml</tt> 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.
  
Line 39: Line 41:
  
 
====XSD File Format====
 
====XSD File Format====
 +
The <tt>project.xml</tt> file XSD is <tt>persistence_1_0.xsd</tt> and it is located in the ''<tt><ECLIPSELINK_HOME></tt>''<tt>\xsds</tt> directory.
  
The <tt>project.xml</tt> file XSD is <tt>eclispelink-object-persistence_11_1_1.xsd</tt> and it is located in the ''<tt><ECLIPSELINK_HOME></tt>''<tt>\config\xsds</tt> directory.
+
See [[EclipseLink/XSDs]] for more information.
 
+
 
+
  
 
====POJO Applications and Project Metadata====
 
====POJO Applications and Project Metadata====
 
 
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 an 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]].
 
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 an 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)#What You May Need to Know About EclipseLink JPA Overriding Mechanisms|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>EntityManager</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.
  
Line 72: Line 67:
 
'''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====
 
 
Optionally, you can use the <tt>DeploymentXMLGenerator</tt> API to programatically generate the <tt>project.xml</tt> file in either of the following ways:
 
Optionally, you can use the <tt>DeploymentXMLGenerator</tt> API to programatically generate the <tt>project.xml</tt> file in either of the following ways:
 
* From an application, instantiate the <tt>DeploymentXMLGenerator</tt> and your java source. Call the following method:<tt>generate (</tt>''<tt><MW_Project.mwp></tt>''<tt>,</tt> ''<tt><output file.xml></tt>''<tt>)</tt>
 
* From an application, instantiate the <tt>DeploymentXMLGenerator</tt> and your java source. Call the following method:<tt>generate (</tt>''<tt><MW_Project.mwp></tt>''<tt>,</tt> ''<tt><output file.xml></tt>''<tt>)</tt>
 
* From the command line, use the following:  
 
* From the command line, use the following:  
  java -classpath eclipselink.jar;eclispelinkmw.jar;xmlparserv2.jar;ejb.jar;<br>org.eclipse.persistence.tools.workbench.mappings.DeploymentXMLGenerator ''<MW_Project.mwp>'' ''<output file.xml>''
+
  java -classpath eclipselink.jar;eclispelinkmw.jar;<br>org.eclipse.persistence.tools.workbench.mappings.DeploymentXMLGenerator ''<MW_Project.mwp>'' ''<output file.xml>''
  
Before you use either method, ensure that your classpath includes the ''<tt><ECLIPSELINK_HOME></tt>''<tt>\config</tt> directory.
+
Before you use either method, ensure that your classpath includes the ''<tt><ECLIPSELINK_HOME></tt>''<tt>\jlib\eclipselink.jar</tt> and ''<tt><ECLIPSELINK_HOME></tt>''<tt>\utils\workbench\jlib\eclipselinkmw.jar</tt> files.
  
  
 
{| class="Note oac_no_warn" width="80%" border="1" frame="hsides" rules="groups" cellpadding="3" frame="hsides" rules="groups"
 
{| class="Note oac_no_warn" width="80%" border="1" frame="hsides" rules="groups" cellpadding="3" frame="hsides" rules="groups"
 
| align="left" |
 
| align="left" |
'''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 ''[http://www.oracle.com/technology/documentation/index.html 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.  
 
|}
 
|}
  
Line 93: Line 86:
  
 
===sessions.xml File===
 
===sessions.xml File===
 
 
Each EclipseLink project belongs to an EclipseLink ''session''. A session is the facade through which an application accesses EclipseLink functionality (for more information on sessions, see [[EclipseLink/UserGuide/Using EclipseLink Sessions (ELUG)|EclipseLink Sessions]]).
 
Each EclipseLink project belongs to an EclipseLink ''session''. A session is the facade through which an application accesses EclipseLink functionality (for more information on sessions, see [[EclipseLink/UserGuide/Using EclipseLink Sessions (ELUG)|EclipseLink Sessions]]).
 
  
  
 
====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><ECLIPSELINK_HOME></tt>''<tt>\xsds</tt> directory as well as on the web at http://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 110: Line 100:
 
  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====
 
 
For a POJO application, you define your sessions in a <tt>sessions.xml</tt> file.
 
For a POJO application, you define your sessions in a <tt>sessions.xml</tt> file.
  
 
The <tt>sessions.xml</tt> file provides a simple and flexible way to configure, modify, and troubleshoot the application sessions. Because of these attributes, the <tt>sessions.xml</tt> file is the preferred way to configure an EclipseLink session.EclipseLink provides graphical toosl to build and edit the <tt>sessions.xml</tt> file. For information see [[Creating%20a%20Session%20(ELUG)|Creating a Session]].
 
The <tt>sessions.xml</tt> file provides a simple and flexible way to configure, modify, and troubleshoot the application sessions. Because of these attributes, the <tt>sessions.xml</tt> file is the preferred way to configure an EclipseLink session.EclipseLink provides graphical toosl to build and edit the <tt>sessions.xml</tt> file. For information see [[Creating%20a%20Session%20(ELUG)|Creating a Session]].
 
  
  
Line 125: 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|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>EntityManager</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]].
  
  
 
===eclispelink-dbws.xml File===
 
 
The <tt>eclispelink-dbws.xml</tt> 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 <tt>sessions.xml</tt> file name, and query definitions for an EclipseLink database Web service, as the following example shows.
 
 
 
<span id="Table 8-1"></span>
 
''''' eclispelink-dbws.xml File Properties'''''
 
 
{| class="RuleFormalMax" dir="ltr" title="eclispelink-dbws.xml File Properties" summary="This table lists the elements of the eclispelink-dbws.xml file." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all"
 
|- align="left" valign="top"
 
! id="r1c1-t5" align="left" valign="bottom" | '''Property'''
 
! id="r1c2-t5" align="left" valign="bottom" | '''Description'''
 
! id="r1c3-t5" align="left" valign="bottom" | '''Required'''
 
! id="r1c4-t5" align="left" valign="bottom" | '''Default'''
 
|- align="left" valign="top"
 
| id="r2c1-t5" headers="r1c1-t5" align="left" |
 
<tt>name</tt>
 
| headers="r2c1-t5 r1c2-t5" align="left" |
 
The name of the EclipseLink database Web service.
 
| headers="r2c1-t5 r1c3-t5" align="left" |
 
No - can be overridden by the <tt>BuildDBWSWar</tt> attribute <tt>projectName</tt>
 
| headers="r2c1-t5 r1c4-t5" align="left" |
 
None
 
|- align="left" valign="top"
 
| id="r3c1-t5" headers="r1c1-t5" align="left" |
 
<tt>query</tt>
 
| headers="r3c1-t5 r1c2-t5" align="left" |
 
One or more named query definitions.
 
| headers="r3c1-t5 r1c3-t5" align="left" |
 
No
 
| headers="r3c1-t5 r1c4-t5" align="left" |
 
None
 
|}
 
 
<br>
 
<span id="Example 8-2"></span>
 
''''' 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:
 
* [[#Deployment Files for EclipseLink Database Web Services|Deployment Files for EclipseLink Database Web Services]]
 
* [[#BuildDBWSWar|BuildDBWSWar]]
 
 
 
 
====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.
 
 
 
===eclispelink-dbws-schema.xsd===
 
 
The <tt>eclipselink-dbws-schema.xsd</tt> 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.
 
 
The [[#Table 8-2|Typical Database Metadata]] table shows metadata from a typical database and the [[#Example 8-3| Corresponding eclispelink-dbws-schema.xsd]] example shows the corresponding <tt>eclipselink-dbws-schema.xsd</tt> file that the EclipseLink database Web service generates from it.
 
 
 
<span id="Table 8-2"></span>
 
''''' 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"
 
|- align="left" valign="top"
 
! id="r1c1-t6" align="left" valign="bottom" | '''OWNER'''
 
! id="r1c2-t6" align="left" valign="bottom" | '''TABLE_NAME'''
 
! id="r1c3-t6" align="left" valign="bottom" | '''COLUMN_NAME'''
 
! id="r1c4-t6" align="left" valign="bottom" | '''DATA_TYPE'''
 
! id="r1c5-t6" align="left" valign="bottom" | '''DATA_LENGTH'''
 
! id="r1c6-t6" align="left" valign="bottom" | '''DATA_PRECISION'''
 
! id="r1c7-t6" align="left" valign="bottom" | '''DATA_SCALE'''
 
! id="r1c8-t6" align="left" valign="bottom" | '''NULLABLE'''
 
|- align="left" valign="top"
 
| id="r2c1-t6" headers="r1c1-t6" align="left" |
 
SCOTT
 
| headers="r2c1-t6 r1c2-t6" align="left" |
 
EMP
 
| headers="r2c1-t6 r1c3-t6" align="left" |
 
EMPNO
 
| headers="r2c1-t6 r1c4-t6" align="left" |
 
NUMBER
 
| headers="r2c1-t6 r1c5-t6" align="left" |
 
22
 
| headers="r2c1-t6 r1c6-t6" align="left" |
 
4
 
| headers="r2c1-t6 r1c8-t6" align="left" |
 
N
 
|- align="left" valign="top"
 
| id="r3c1-t6" headers="r1c1-t6" align="left" |
 
SCOTT
 
| headers="r3c1-t6 r1c2-t6" align="left" |
 
EMP
 
| headers="r3c1-t6 r1c3-t6" align="left" |
 
ENAME
 
| headers="r3c1-t6 r1c4-t6" align="left" |
 
VARCHAR2
 
| headers="r3c1-t6 r1c5-t6" align="left" |
 
10
 
| headers="r3c1-t6 r1c6-t6" align="left" |
 
(null)
 
| headers="r3c1-t6 r1c7-t6" align="left" |
 
(null)
 
| headers="r3c1-t6 r1c8-t6" align="left" |
 
Y
 
|- align="left" valign="top"
 
| id="r4c1-t6" headers="r1c1-t6" align="left" |
 
SCOTT
 
| headers="r4c1-t6 r1c2-t6" align="left" |
 
EMP
 
| headers="r4c1-t6 r1c3-t6" align="left" |
 
JOB
 
| headers="r4c1-t6 r1c4-t6" align="left" |
 
VARCHAR2
 
| headers="r4c1-t6 r1c5-t6" align="left" |
 
9
 
| headers="r4c1-t6 r1c6-t6" align="left" |
 
(null)
 
| headers="r4c1-t6 r1c7-t6" align="left" |
 
(null)
 
| headers="r4c1-t6 r1c8-t6" align="left" |
 
Y
 
|- align="left" valign="top"
 
| id="r5c1-t6" headers="r1c1-t6" align="left" |
 
SCOTT
 
| headers="r5c1-t6 r1c2-t6" align="left" |
 
EMP
 
| headers="r5c1-t6 r1c3-t6" align="left" |
 
MGR
 
| headers="r5c1-t6 r1c4-t6" align="left" |
 
NUMBER
 
| headers="r5c1-t6 r1c5-t6" align="left" |
 
22
 
| headers="r5c1-t6 r1c6-t6" align="left" |
 
4
 
| headers="r5c1-t6 r1c8-t6" align="left" |
 
Y
 
|- align="left" valign="top"
 
| id="r6c1-t6" headers="r1c1-t6" align="left" |
 
SCOTT
 
| headers="r6c1-t6 r1c2-t6" align="left" |
 
EMP
 
| headers="r6c1-t6 r1c3-t6" align="left" |
 
HIREDATE
 
| headers="r6c1-t6 r1c4-t6" align="left" |
 
DATE
 
| headers="r6c1-t6 r1c5-t6" align="left" |
 
7
 
| headers="r6c1-t6 r1c6-t6" align="left" |
 
(null)
 
| headers="r6c1-t6 r1c7-t6" align="left" |
 
(null)
 
| headers="r6c1-t6 r1c8-t6" align="left" |
 
Y
 
|- align="left" valign="top"
 
| id="r7c1-t6" headers="r1c1-t6" align="left" |
 
SCOTT
 
| headers="r7c1-t6 r1c2-t6" align="left" |
 
EMP
 
| headers="r7c1-t6 r1c3-t6" align="left" |
 
SAL
 
| headers="r7c1-t6 r1c4-t6" align="left" |
 
NUMBER
 
| headers="r7c1-t6 r1c5-t6" align="left" |
 
22
 
| headers="r7c1-t6 r1c6-t6" align="left" |
 
7
 
| headers="r7c1-t6 r1c7-t6" align="left" |
 
2
 
| headers="r7c1-t6 r1c8-t6" align="left" |
 
Y
 
|- align="left" valign="top"
 
| id="r8c1-t6" headers="r1c1-t6" align="left" |
 
SCOTT
 
| headers="r8c1-t6 r1c2-t6" align="left" |
 
EMP
 
| headers="r8c1-t6 r1c3-t6" align="left" |
 
COMM
 
| headers="r8c1-t6 r1c4-t6" align="left" |
 
NUMBER
 
| headers="r8c1-t6 r1c5-t6" align="left" |
 
22
 
| headers="r8c1-t6 r1c6-t6" align="left" |
 
7
 
| headers="r8c1-t6 r1c7-t6" align="left" |
 
2
 
| headers="r8c1-t6 r1c8-t6" align="left" |
 
Y
 
|- align="left" valign="top"
 
| id="r9c1-t6" headers="r1c1-t6" align="left" |
 
SCOTT
 
| headers="r9c1-t6 r1c2-t6" align="left" |
 
EMP
 
| headers="r9c1-t6 r1c3-t6" align="left" |
 
DEPTNO
 
| headers="r9c1-t6 r1c4-t6" align="left" |
 
NUMBER
 
| headers="r9c1-t6 r1c5-t6" align="left" |
 
22
 
| headers="r9c1-t6 r1c6-t6" align="left" |
 
2
 
| headers="r9c1-t6 r1c8-t6" align="left" |
 
Y
 
|}
 
 
<br>
 
<span id="Example 8-3"></span>
 
''''' 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|Deployment Files for EclipseLink Database Web Services]]
 
  
  
 
==Creating Deployment Files for Java Applications==
 
==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.
 
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.
  
Line 407: Line 126:
  
  
==Creating Deployment Files for JavaServer Pages and Servlet Applications==
 
  
 +
==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.
 
Many designers build EclipseLink applications that use JavaServer Pages (JSP) and Java servlets. This type of design generally supports Web-based applications.
  
Line 417: Line 136:
  
  
==Creating Deployment Files for Session Bean Applications==
 
  
 +
==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.
 
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.
  
Line 429: Line 148:
  
 
===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.sessions-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.
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 438: Line 156:
 
* [[Introduction to EclipseLink JPA (ELUG)#EclipseLink JPA Overview|EclipseLink JPA Overview]]
 
* [[Introduction to EclipseLink JPA (ELUG)#EclipseLink JPA Overview|EclipseLink JPA Overview]]
 
* [[Developing Applications Using EclipseLink JPA (ELUG)#Application Development with EclipseLink JPA|Application Development with EclipseLink JPA)]]
 
* [[Developing Applications Using EclipseLink JPA (ELUG)#Application Development with EclipseLink JPA|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==
+
 
+
This section describes how to automatically generate a WAR file containing the WSDL and all deployment files an 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 an Database Table]]
+
* [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL|How to Create Deployment Files for an 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 an 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 an 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 an 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]]
+
* [[#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 an EclipseLink Database Web Service]]
+
 
+
 
+
 
+
===How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table===
+
 
+
You can generate an 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====
+
 
+
<ol>
+
<li> Create the table in your relational database and ensure that the relational database management system is online.</li>
+
<li> Execute the <tt>GenerateFromTables</tt> Ant task, as the following example shows.<br><span id="Example 8-4"></span>'''''Generating an EclipseLink Database Web Service from a Table''''' <div class="pre">
+
<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}"
+
        >
+
+
        &lt;Table                &lt;!-- Generates CRUD operations -->
+
            catalogPattern="%"
+
            schemaPattern="SCOTT"
+
            tableNamePattern="XR_EMP"
+
            >
+
            <Operations>      &lt;!-- 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>
+
</div><br>Optionally, specify a <tt>SessionCustomizer</tt> class name using the <tt>BuildDBWSWar</tt> attribute <tt>sessionCustomizerClassName</tt>.<br>For more information, see the following:
+
* [[#BuildDBWSWar|BuildDBWSWar]]
+
* [[#GenerateFromTables|GenerateFromTables]]
+
* [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization|How to Customize an EclipseLink Database Web Service Using Java: Session Customization]]
+
* [[#EclipseLink Database Web Services WAR File|EclipseLink Database Web Services WAR File]]</li>
+
<li> Package and deploy the EclipseLink database Web service.<br> For more information, see the following:
+
* [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#Packaging a EclipseLink Database Web Service|Packaging an EclipseLink Database Web Service]]
+
* [[Deploying%20a%20EclipseLink%20Application%20(ELUG)#Deploying a EclipseLink Database Web Service|Deploying an EclipseLink Database Web Service]]</li></ol>
+
 
+
 
+
 
+
===How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL===
+
 
+
You can generate an 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====
+
 
+
<ol>
+
<li> Create your relational database schema and ensure that the relational database management system is online.</li>
+
<li> Execute the <tt>GenerateFromSQL</tt> Ant task, as the following example shows:
+
<ol>
+
<li> Create an <tt>SQLOperation</tt> for each SQL statement you want to expose.</li>
+
<li> If the SQL statement takes arguments, add a <tt>Binding</tt> task for each argument. The order in which you define <tt>Binding</tt> tasks must match the order of the arguments in your SQL statement.<br><span id="Example 8-5"></span>''''' Generating an EclipseLink Databases Service from SQL'''''
+
<div class="pre">
+
<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>
+
</div>
+
Optionally, specify a <tt>SessionCustomizer</tt> class name using the <tt>BuildDBWSWar</tt> attribute <tt>sessionCustomizerClassName</tt>.<br>For more information, see the following:
+
* [[#BuildDBWSWar|BuildDBWSWar]]
+
* [[#GenerateFromSQL|GenerateFromSQL]]
+
* [[#SQLOperation|SQLOperation]]
+
* [[#Binding|Binding]]
+
* [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization|How to Customize an EclipseLink Database Web Service Using Java: Session Customization]]
+
* [[#EclipseLink Database Web Services WAR File|EclipseLink Database Web Services WAR File]]</li></ol>
+
<li> Package and deploy the EclipseLink database Web service.<br>For more information, see the following:
+
* [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#Packaging a EclipseLink Database Web Service|Packaging an EclipseLink Database Web Service]]
+
* [[Deploying%20a%20EclipseLink%20Application%20(ELUG)#Deploying a EclipseLink Database Web Service|Deploying an EclipseLink Database Web Service]]</li>
+
</ol>
+
 
+
 
+
 
+
===How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure===
+
 
+
You can generate an 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====
+
 
+
<ol>
+
<li> Create your relational database schema and ensure that the relational database management system is online.</li>
+
<li> Execute the <tt>GenerateFromStoredProcedure</tt> Ant task, as the following example shows. Create an <tt>Operation</tt> for each stored procedure, stored function, or trigger you want to expose.<br><span id="Example 8-6"></span>''''' Generating an EclipseLink Databases Service from a Stored Procedure'''''
+
<div class="pre">
+
<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>
+
</div>
+
Optionally, specify a <tt>SessionCustomizer</tt> class name using the <tt>BuildDBWSWar</tt> attribute <tt>sessionCustomizerClassName</tt>.<br>For more information, see the following:
+
* [[#BuildDBWSWar|BuildDBWSWar]]
+
* [[#GenerateFromStoredProcedures|GenerateFromStoredProcedures]]
+
* [[#Operations|Operations]]
+
* [[#How to Customize a EclipseLink Database Web Service Using Java: Session Customization|How to Customize an EclipseLink Database Web Service Using Java: Session Customization]]
+
* [[#EclipseLink Database Web Services WAR File|EclipseLink Database Web Services WAR File]]</li>
+
<li> Package and deploy the EclipseLink database Web service.<br>For more information, see the following:
+
* [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#Packaging a EclipseLink Database Web Service|Packaging an EclipseLink Database Web Service]]
+
* [[Deploying%20a%20EclipseLink%20Application%20(ELUG)#Deploying a EclipseLink Database Web Service|Deploying an EclipseLink Database Web Service]]</li>
+
</ol>
+
 
+
 
+
 
+
===How to Customize a EclipseLink Database Web Service Using Java: Session Customization===
+
 
+
You can customize an EclipseLink database Web service with an EclipseLink <tt>SessionCustomizer</tt>.
+
 
+
 
+
====To Customize a EclipseLink Database Web Service Using Java: Session Customization====
+
 
+
<ol>
+
<li>Implement a <tt>org.eclipse.persistence.tools.sessionconfiguration.SessionCustomizer</tt>, as the following example shows.<br><span id="Example 8-7"></span>''''' Implementing a SessionCustomizer''''' <div class="pre">
+
import 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);
+
    }
+
}
+
</div>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> 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
+
    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>
+
 
+
</div>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 an 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 an 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 an EclipseLink Database Web Service Using Ant: from a Stored Procedure]]
+
* [[#BuildDBWSWar|BuildDBWSWar]]
+
* [[#EclipseLink Database Web Services WAR File|EclipseLink Database Web Services WAR File]]</li>
+
<li> Package and deploy the EclipseLink database Web service.<br>For more information, see the following:
+
* [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#Packaging a EclipseLink Database Web Service|Packaging an EclipseLink Database Web Service]]
+
* [[Deploying%20a%20EclipseLink%20Application%20(ELUG)#Deploying a EclipseLink Database Web Service|Deploying an EclipseLink Database Web Service]]</li></ol>
+
 
+
 
+
 
+
===How to Customize a EclipseLink Database Web Service Using project.xml and sessions.xml===
+
 
+
You can customize an EclipseLink database Web service by creating your own <tt>project.xml</tt> and <tt>sessions.xml</tt> files.
+
 
+
 
+
====To Customize a Oracle Sensor Edge Server Database Web Service Using project.xml and sessions.xml====
+
 
+
<ol>
+
<li> Execute the <tt>BuildDBWSWar</tt> Ant task with a generator, as the following example shows.<br><span id="Example 8-9"></span>''''' Creating the Initial EclipseLink Database Web Services Files''''' <div class="pre">
+
<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>
+
</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:
+
* [[#How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table|How to Create Deployment Files for an 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 an 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 an EclipseLink Database Web Service Using Ant: from a Stored Procedure]]
+
* [[#BuildDBWSWar|BuildDBWSWar]]</li>
+
<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 [[Introduction%20to%20Relational%20Projects%20(ELUG)#BABECJJD|an EclipseLink relational project]].
+
* Map your objects to your XML schema in [[Introduction%20to%20XML%20Projects%20(ELUG)#BABEGHHD|an EclipseLink XML project]].
+
* Add both projects to your session (see [[Configuring%20a%20Session%20(ELUG)#Configuring Multiple Mapping Projects|Configuring Multiple Mapping Projects]]).<br>
+
{| class="Note oac_no_warn" width="80%" border="1" frame="hsides" rules="groups" cellpadding="3" frame="hsides" rules="groups"
+
| align="left" |
+
'''Note:''' Your custom <tt>project.xml</tt> files must use the same names as specified by <tt>BuildDBWSWar</tt> attributes <tt>ormProjectFilename</tt> and <tt>oxmProjectFilename</tt>. Your custom <tt>sessions.xml</tt> file must use the same name as specified by <tt>BuildDBWSWar</tt> attribute <tt>sessionsFileName</tt>.
+
|}<br>For more information, see:
+
* [[Introduction%20to%20Projects (ELUG)|Introduction to Projects]]
+
* [[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|What You May Need to Know About Creating Deployment Files for an 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> Execute the <tt>BuildDBWSWar</tt> Ant task without a generator, as the following example shows.<br><span id="Example 8-10"></span><br>''''' Building the EclipseLink Database Web Service WAR File''''' <br>
+
<div class="pre">
+
<xr:BuildDBWSWar
+
    classpathref = "${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>
+
</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.<br>For more information, see:
+
* [[#BuildDBWSWar|BuildDBWSWar]]
+
* [[#EclipseLink Database Web Services WAR File|EclipseLink Database Web Services WAR File]]</li>
+
 
+
<li> Package and deploy the EclipseLink database Web service.<br>For more information, see:
+
* [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#Packaging a EclipseLink Database Web Service|Packaging an EclipseLink Database Web Service]]
+
* [[Deploying%20a%20EclipseLink%20Application%20(ELUG)#Deploying a EclipseLink Database Web Service|Deploying an EclipseLink Database Web Service]]</li>
+
</ol>
+
 
+
 
+
 
+
===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====
+
 
+
<ol>
+
<li> Consider the Ant library dependencies.<br>For more information, see <tt>http://ant.apache.org/manual/installl#librarydependencies</tt></li>
+
<li> Ensure that the EclipseLink database Web service-specific JAR files that the [[#Table 8-3|EclipseLink Ant Task Library Dependencies]] table lists are on the Ant classpath.<br><span id="Table 8-3"></span>''''' EclipseLink Ant Task Library Dependencies'''''
+
{| class="RuleFormalMax" dir="ltr" title="EclipseLink Ant Task Library Dependencies" summary="This table lists the EclipseLink database Web services Ant task library dependencies." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all"
+
|- align="left" valign="top"
+
! id="r1c1-t8" align="left" valign="bottom" | '''JAR Name'''
+
! id="r1c2-t8" align="left" valign="bottom" | '''Needed For...'''
+
! id="r1c3-t8" align="left" valign="bottom" | '''Available At...'''
+
|- align="left" valign="top"
+
| id="r2c1-t8" headers="r1c1-t8" align="left" |
+
<tt>eclipselink-dbws-tools.jar</tt>
+
| headers="r2c1-t8 r1c2-t8" align="left" |
+
EclipseLink database Web services Ant tasks and type definitions.
+
| headers="r2c1-t8 r1c3-t8" align="left" |
+
<tt><</tt>''<tt>ECLIPSELINK_HOME</tt>''<tt>>/lib/java/shared/org.eclipse.persistence.dbws/11.1.1.0.0</tt>
+
|}<br></li>
+
<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">
+
<?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>
+
</div></li>
+
<li> Include the <tt>eclipselink-ant-lib.xml</tt> file in your Ant <tt>build.xml</tt> file, as the following example shows.<br><span id="Example 8-12"></span>''''' Specifying the eclipselink-ant-lib.xml File in a build.xml File'''''
+
<div class="pre">
+
<project name="MyBuild" default="validate.session" basedir="." xmlns:eclispelink="eclispelinklib">
+
    <typedef file = "eclipselink-ant-lib.xml" classpathref = "xr.classpath" uri = "eclispelinklib" />
+
...
+
</project>
+
</div>
+
</li>
+
</ol>
+
 
+
 
+
 
+
===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.
+
 
+
 
+
<span id="Figure 8-1"></span>
+
''''' Creating EclipseLink Database Web Service Deployment Files'''''
+
 
+
[[Image:websarchtldbdev.gif|Creating EclipseLink Database Web Service Deployment Files]]<br><br>
+
 
+
This section describes the following:
+
* [[#EclipseLink Database Web Services Ant Tasks|EclipseLink Database Web Services Ant Tasks]]
+
* [[#EclipseLink Database Web Services WAR File|EclipseLink Database Web Services WAR File]]
+
* [[#Unstructured Data|Unstructured Data]]
+
* [[#Customizing EclipseLink Database Web Services|Customizing EclipseLink Database Web Services]]
+
 
+
For more information, see the following:
+
 
+
* [[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 an EclipseLink Database Web Service]]
+
* [[Deploying%20a%20EclipseLink%20Application%20(ELUG)#Deploying a EclipseLink Database Web Service|Deploying an 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.
+
 
+
 
+
<span id="Table 8-4"></span>
+
''''' EclipseLink Database Web Services Ant Tasks'''''
+
 
+
{| class="RuleFormalMax" dir="ltr" title="EclipseLink Database Web Services Ant Tasks" summary="This table lists the EclipseLink database 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"
+
! id="r1c1-t9" align="left" valign="bottom" | '''Task'''
+
! id="r1c2-t9" align="left" valign="bottom" | '''EclipseLink Class'''
+
|- align="left" valign="top"
+
| id="r2c1-t9" headers="r1c1-t9" align="left" |
+
[[#Binding|Binding]]<br>
+
| headers="r2c1-t9 r1c2-t9" align="left" |
+
<tt>org.eclipse.persistence.tools.dbws.Binding</tt>
+
|- align="left" valign="top"
+
| id="r3c1-t9" headers="r1c1-t9" align="left" |
+
[[#BuildDBWSWar|BuildDBWSWar]]<br>
+
| headers="r3c1-t9 r1c2-t9" align="left" |
+
<tt>org.eclipse.persistence.tools.dbws.BuildDBWSWar</tt>
+
|- align="left" valign="top"
+
| id="r4c1-t9" headers="r1c1-t9" align="left" |
+
[[#GenerateFromSQL|GenerateFromSQL]]<br>
+
| headers="r4c1-t9 r1c2-t9" align="left" |
+
<tt>org.eclipse.persistence.tools.dbws.GenerateFromSQL</tt>
+
|- align="left" valign="top"
+
| id="r5c1-t9" headers="r1c1-t9" align="left" |
+
[[#GenerateFromStoredProcedures|GenerateFromStoredProcedures]]<br>
+
| headers="r5c1-t9 r1c2-t9" align="left" |
+
<tt>org.eclipse.persistence.tools.dbws.GenerateFromStoredProcedure</tt>
+
|- align="left" valign="top"
+
| id="r6c1-t9" headers="r1c1-t9" align="left" |
+
[[#GenerateFromTables|GenerateFromTables]]<br>
+
| headers="r6c1-t9 r1c2-t9" align="left" |
+
<tt>org.eclipse.persistence.tools.dbws.GenerateFromTables</tt>
+
|- align="left" valign="top"
+
| id="r7c1-t9" headers="r1c1-t9" align="left" |
+
[[#Operations|Operations]]<br>
+
| headers="r7c1-t9 r1c2-t9" align="left" |
+
<tt>org.eclipse.persistence.tools.dbws.Operations</tt>
+
|- align="left" valign="top"
+
| id="r8c1-t9" headers="r1c1-t9" align="left" |
+
[[#Procedure|Procedure]]<br>
+
| headers="r8c1-t9 r1c2-t9" align="left" |
+
<tt>org.eclipse.persistence.tools.dbws.Procedure</tt>
+
|- align="left" valign="top"
+
| id="r9c1-t9" headers="r1c1-t9" align="left" |
+
[[#SQLOperation|SQLOperation]]<br>
+
| headers="r9c1-t9 r1c2-t9" align="left" |
+
<tt>org.eclipse.persistence.tools.dbws.SQLOperation</tt>
+
|- align="left" valign="top"
+
| id="r10c1-t9" headers="r1c1-t9" align="left" |
+
[[#Table|Table]]<br>
+
| headers="r10c1-t9 r1c2-t9" align="left" |
+
<tt>org.eclipse.persistence.tools.dbws.Table</tt>
+
|}
+
 
+
<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|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. The [[#table_8_5|EclipseLink Database Web Service WAR File Contents]] table lists the files in these WAR files.
+
 
+
For more information, see [[#EclipseLink Database Web Services Ant Tasks|EclipseLink Database Web Services Ant Tasks]].
+
<span id="Example 8-13"></span>
+
 
+
''''' 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
+
 
+
 
+
<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 an EclipseLink database Web service WAR file." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all"
+
|- align="left" valign="top"
+
! id="r1c1-t10" align="left" valign="bottom" | '''File'''
+
! id="r1c2-t10" align="left" valign="bottom" | '''Description'''
+
|- align="left" valign="top"
+
| id="r2c1-t10" headers="r1c1-t10" align="left" |
+
<tt>indexl</tt>
+
| headers="r2c1-t10 r1c2-t10" align="left" |
+
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.
+
|- align="left" valign="top"
+
| id="r3c1-t10" headers="r1c1-t10" align="left" |
+
<tt>swaref.xsd</tt>
+
| headers="r3c1-t10 r1c2-t10" align="left" |
+
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.
+
|- align="left" valign="top"
+
| id="r4c1-t10" headers="r1c1-t10" align="left" |
+
<tt>topink-dbws-schema.xsd</tt>
+
| 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|eclispelink-dbws-schema.xsd]].
+
|- align="left" valign="top"
+
| id="r5c1-t10" headers="r1c1-t10" align="left" |
+
<tt>MANIFEST.MF</tt>
+
| headers="r5c1-t10 r1c2-t10" align="left" |
+
The manifest file for the WAR file.
+
|- align="left" valign="top"
+
| id="r6c1-t10" headers="r1c1-t10" align="left" |
+
<tt>oracle-webservices.xml</tt>
+
| headers="r6c1-t10 r1c2-t10" align="left" |
+
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.
+
|- align="left" valign="top"
+
| id="r7c1-t10" headers="r1c1-t10" align="left" |
+
<tt>web.xml</tt>
+
| headers="r7c1-t10 r1c2-t10" align="left" |
+
The Web application deployment file that binds the EclipseLink database Web service to an OC4J Web services stack servlet.
+
|- align="left" valign="top"
+
| id="r8c1-t10" headers="r1c1-t10" align="left" |
+
<tt>eclispelink-dbws.xml</tt>
+
| headers="r8c1-t10 r1c2-t10" align="left" |
+
The EclipseLink database Web services configuration file.<br>For more information, see [[#eclispelink-dbws.xml File|eclispelink-dbws.xml File]].
+
|- align="left" valign="top"
+
| id="r9c1-t10" headers="r1c1-t10" align="left" |
+
<tt>eclispelink-dbws-sessions.xml</tt>
+
| headers="r9c1-t10 r1c2-t10" align="left" |
+
The EclipseLink <tt>sessions.xml</tt> file for this EclipseLink database Web service. It contains references to the EclipseLink relational and object-XML <tt>project.xml</tt> files.<br>For more information, see [[Introduction%20to%20EclipseLink%20Sessions%20(ELUG)|Introduction to EclipseLink Sessions]].
+
|- align="left" valign="top"
+
| id="r10c1-t10" headers="r1c1-t10" align="left" |
+
<tt>eclispelink-dbws-or.xml</tt>
+
| headers="r10c1-t10 r1c2-t10" align="left" |
+
The EclipseLink relational <tt>project.xml</tt> file.<br>For more information, see [[Introduction%20to%20Relational%20Projects%20(ELUG)|Introduction to Relational Projects]].
+
|- align="left" valign="top"
+
| id="r11c1-t10" headers="r1c1-t10" align="left" |
+
<tt>eclispelink-dbws-ox.xml</tt>
+
| headers="r11c1-t10 r1c2-t10" align="left" |
+
The EclipseLink object-XML <tt>project.xml</tt> file.<br>For more information, see [[Introduction%20to%20XML%20Projects%20(ELUG)#BABEGHHD|Introduction to XML Projects]].
+
|- align="left" valign="top"
+
| id="r12c1-t10" headers="r1c1-t10" align="left" |
+
<tt>eclispelink-dbws.wsdl</tt>
+
| headers="r12c1-t10 r1c2-t10" align="left" |
+
Contains equivalent entries for each operation for the specified EclipseLink database Web service. Required for deployment as a Web service.
+
|}
+
 
+
<br>
+
 
+
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:
+
* [[Packaging%20a%20EclipseLink%20Application%20(ELUG)#Packaging a EclipseLink Database Web Service|Packaging an EclipseLink Database Web Service]]
+
* [[Deploying%20a%20EclipseLink%20Application%20(ELUG)#Deploying a EclipseLink Database Web Service|Deploying an EclipseLink Database Web Service]]
+
 
+
 
+
 
+
====Unstructured Data====
+
 
+
In some circumstances, an EclipseLink database Web services operation may return unstructured data rather than a persistent entity. For example:
+
* a <tt>resultSet</tt> from a custom SQL <tt>SELECT</tt> 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.
+
 
+
 
+
<span id="Example 8-14"></span>
+
'''''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>
+
 
+
 
+
The [[#Example 8-15|Example Unstructured Data Document]] example 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 <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.
+
* 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.
+
 
+
 
+
<span id="Example 8-15"></span>
+
'''''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:
+
* [[#GenerateFromSQL|GenerateFromSQL]]
+
* [[#GenerateFromStoredProcedures|GenerateFromStoredProcedures]]
+
* [[#Operations|Operations]]
+
 
+
 
+
 
+
====Customizing EclipseLink Database Web Services====
+
 
+
To customize an EclipseLink database Web service, you can do the following:
+
 
+
* Implement an 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>
+
** object-xml session name: ''<tt>name</tt>''<tt>-dbws-ox-session</tt>
+
* Manually generate <tt>project.xml</tt> files and <tt>sessions.xml</tt> file.Using your preferred tool, Oracle JDeveloper or Workbench, you can map your objects to your relational database in an EclipseLink relational project, map your objects to your XML schema in an EclipseLink XMl project, and create an EclipseLink <tt>sessions.xml</tt> 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 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]]
+
* [[#BuildDBWSWar|BuildDBWSWar]]
+
* ''EclipseLink API Reference''
+
 
+
 
+
===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 order in which you define <tt>Binding</tt> tasks must match the order of the arguments in your SQL statement, as the [[#Example 8-16|SQLOperation Task: With Binding Elements for Arguments]] example shows.
+
 
+
 
+
 
+
====Using Parameters====
+
 
+
<span id="Table 8-6"></span>
+
''''' Binding Task Parameters'''''
+
 
+
{| class="RuleFormalWideMax" dir="ltr" title="Binding 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"
+
|- align="left" valign="top"
+
! id="r1c1-t11" align="left" valign="bottom" | '''Attribute'''
+
! id="r1c2-t11" align="left" valign="bottom" | '''Description'''
+
! id="r1c3-t11" align="left" valign="bottom" | '''Required'''
+
|- align="left" valign="top"
+
| id="r2c1-t11" headers="r1c1-t11" align="left" |
+
<tt>name</tt>
+
| 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.<br>For more information, see [[#GenerateFromSQL|GenerateFromSQL]].
+
| headers="r2c1-t11 r1c3-t11" align="left" |
+
Yes
+
|- align="left" valign="top"
+
| id="r3c1-t11" headers="r1c1-t11" align="left" |
+
<tt>type</tt>
+
| headers="r3c1-t11 r1c2-t11" align="left" |
+
The XSD data type to bind to the argument <tt>name</tt>.
+
| headers="r3c1-t11 r1c3-t11" align="left" |
+
Yes
+
|}
+
 
+
 
+
====Examples====
+
 
+
The following example shows a typical <tt>SQLOperation</tt> task that specifies arguments using nested <tt>Binding</tt> tasks. The order in which you define <tt>Binding</tt> tasks must match the order of the arguments in your SQL statement.
+
 
+
For example, the <tt>SQLOperation</tt> named <tt>FindAnEmployee</tt> takes one <tt>int</tt> argument (<tt>EMPNO</tt>), one <tt>string</tt> argument (<tt>LAST_NAME</tt>), and returns all fields in a <tt>RowSet</tt> using a <tt>rowsetTag</tt> of <tt>employee-rowset</tt> and a <tt>rowTag</tt> of <tt>employee</tt>
+
 
+
 
+
<span id="Example 8-16"></span>
+
''''' 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|SQLOperation]].
+
 
+
 
+
 
+
===BuildDBWSWar===
+
 
+
The <tt>BuildDBWSWar</tt> Ant task (see the [[#Example 8-17|BuildDBWSWar Task]] example) is a EclipseLink database Web services task you use either with a EclipseLink database Web services generator task or without.
+
 
+
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.
+
 
+
This allows you to customize the generated EclipseLink database Web services files and then execute the <tt>BuildDBWSWar</tt> task again to re-package the WAR file to include your changes.
+
 
+
This task extends the Ant <tt>Jar</tt> task and inherits its attributes and nested elements.
+
 
+
 
+
 
+
====Using Parameters====
+
 
+
<span id="Table 8-7"></span>
+
''''' BuildDBWSWar Task Parameters'''''
+
 
+
{| class="RuleFormalWideMax" dir="ltr" title="BuildDBWSWar 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"
+
|- align="left" valign="top"
+
! id="r1c1-t12" align="left" valign="bottom" | '''Attribute'''
+
! id="r1c2-t12" align="left" valign="bottom" | '''Description'''
+
! id="r1c3-t12" align="left" valign="bottom" | '''Required'''
+
! id="r1c4-t12" align="left" valign="bottom" | '''Default'''
+
|- align="left" valign="top"
+
| id="r2c1-t12" headers="r1c1-t12" align="left" |
+
<tt>classpathref</tt>
+
| headers="r2c1-t12 r1c2-t12" align="left" |
+
Reference to a path defined elsewhere.
+
 
+
The EclipseLink database Web services classpath must includes references to:
+
* JDBC driver
+
* EclipseLink database platform (see [[#platformClassName|platformClassName]])
+
* EclipseLink session customizer class, if used (see <tt>[[#sessionCustomizerClassName|sessionCustomizerClassName]]</tt>)
+
* <tt>eclipselink-xr-tools.jar</tt> file that contains the EclipseLink database Web services Ant tasks.
+
 
+
Alternatively, you can use a nested Ant [http://ant.apache.org/manual/usingl#path <tt>classpath</tt>] element.
+
| headers="r2c1-t12 r1c3-t12" align="left" |
+
Yes
+
| headers="r2c1-t12 r1c4-t12" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r3c1-t12" headers="r1c1-t12" align="left" |
+
<tt>contextRoot</tt>
+
| headers="r3c1-t12 r1c2-t12" align="left" |
+
The value of the <tt>web.xml</tt> file <tt>servlet-mapping</tt> element's <tt>url-pattern</tt> sub-element.<br>'''Example:'''
+
<servlet-mapping>
+
    ...
+
    <url-pattern>
+
        /servlet/MyWebService
+
    </url-pattern>
+
</servlet-mapping>
+
| headers="r3c1-t12 r1c3-t12" align="left" |
+
Yes
+
| headers="r3c1-t12 r1c4-t12" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r4c1-t12" headers="r1c1-t12" align="left" |
+
<tt>destfile</tt>
+
| headers="r4c1-t12 r1c2-t12" align="left" |
+
The fully qualified path to the WAR file.
+
| headers="r4c1-t12 r1c3-t12" align="left" |
+
Yes
+
| headers="r4c1-t12 r1c4-t12" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r5c1-t12" headers="r1c1-t12" align="left" |
+
<tt>dataSource</tt>
+
| headers="r5c1-t12 r1c2-t12" align="left" |
+
JNDI datasource location to be inserted into the EclipseLink database Web service <tt>sessions.xml</tt> file (see <tt>sessionsFileName</tt>).
+
 
+
The JNDI name you use here is as defined in ''<tt>ORACLE_INSTANCE</tt>''<tt>/config/oc4j/</tt>''<tt>OC4J_INSTANCE</tt>''<tt>/data-sources.xml</tt> file element <tt>managed-data-source</tt> attribute <tt>jndi-name</tt> or element <tt>native-data-source</tt> attribute <tt>jndi-name</tt>.
+
 
+
You must configure this datasource in OC4J before deploying your EclipseLink database Web service.
+
 
+
Use this attribute as an alternative to generator attributes:
+
* <tt>driver</tt>
+
* <tt>password</tt>
+
* <tt>rdbms</tt>
+
* <tt>url</tt>
+
* <tt>userid</tt>
+
 
+
'''Example:'''
+
 
+
Given the following OC4J <tt>data-sources.xml</tt> configuration, you would set <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt> to <tt>jdbc/OracleDS</tt>.
+
<data-sources ... >
+
    <connection-pool name="MyPool">
+
    ...
+
    </connection-pool>
+
    <managed-data-source
+
        name="OracleManagedDS"
+
        jndi-name="jdbc/OracleDS"
+
        connection-pool-name="MyPool"
+
        ...
+
    />
+
</data-sources ... >
+
| headers="r5c1-t12 r1c3-t12" align="left" |
+
No
+
| headers="r5c1-t12 r1c4-t12" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r6c1-t12" headers="r1c1-t12" align="left" |
+
<tt>logLevel</tt>
+
| headers="r6c1-t12 r1c2-t12" align="left" |
+
Control the amount and detail of log output by configuring the log level (in ascending order of information) to one of the following <tt>java.util.logging.Level</tt> values:
+
* <tt>OFF</tt>  –  Disable logging.
+
* <tt>SEVERE</tt> – Logs exceptions indicating EclipseLink cannot continue, as well as any exceptions generated during login. This includes a stack trace.
+
* <tt>WARNING</tt> – Logs exceptions that do not force EclipseLink to stop, including all exceptions not logged with severe level. This does not include a stack trace.
+
* <tt>INFO</tt> – Logs the login/logout per sever session, including the user name. After acquiring the session, detailed information is logged.
+
* <tt>CONFIG</tt> – Logs only login, JDBC connection, and database information.
+
* <tt>FINE</tt> – Logs SQL.
+
* <tt>FINER</tt> – Similar to warning. Includes stack trace.
+
* <tt>FINEST</tt> – Includes additional low level information.
+
| headers="r6c1-t12 r1c3-t12" align="left" |
+
No
+
| headers="r6c1-t12 r1c4-t12" align="left" |
+
<tt>INFO</tt>
+
|- align="left" valign="top"
+
| id="r7c1-t12" headers="r1c1-t12" align="left" |
+
<tt>platformClassName</tt>
+
| headers="r7c1-t12 r1c2-t12" align="left" |
+
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.<br><br>'''Example:''' <tt>org.eclipse.persistence.platform.database.oracle.Oracle11Platform</tt>
+
| headers="r7c1-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.
+
| headers="r7c1-t12 r1c4-t12" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r8c1-t12" headers="r1c1-t12" align="left" |
+
<tt>projectName</tt>
+
| headers="r8c1-t12 r1c2-t12" align="left" |
+
The name of this EclipseLink database Web service.
+
 
+
By default, the EclipseLink project names are defined based on this attribute:
+
* 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:
+
* relational project file name: <tt>eclipselink-dbws-or.xml</tt>
+
* object-xml project file name: <tt>eclipselink-dbws-ox.xml</tt>
+
| 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.
+
| headers="r8c1-t12 r1c4-t12" align="left" |
+
<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"
+
| id="r9c1-t12" headers="r1c1-t12" align="left" |
+
<tt>sessionCustomizerClassName</tt>
+
| headers="r9c1-t12 r1c2-t12" align="left" |
+
The name of the <tt>org.eclipse.persistence.sessions.SessionCustomizer</tt> 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|How to Customize a EclipseLink Database Web Service Using Java: Session Customization]].
+
| headers="r9c1-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.
+
| headers="r9c1-t12 r1c4-t12" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r10c1-t12" headers="r1c1-t12" align="left" |
+
<tt>sessionsFileName</tt>
+
| headers="r10c1-t12 r1c2-t12" align="left" |
+
The name of the EclipseLink <tt>sessions.xml</tt> file that references the relational and XML projects.
+
 
+
By default, the EclipseLink session names are defined based on the <tt>projectName</tt> attribute:
+
* relational session name: ''<tt>projectName</tt>''<tt>-dbws-or-session</tt>
+
* object-xml session name: ''<tt>projectName</tt>''<tt>-dbws-ox-session</tt>
+
| headers="r10c1-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.
+
| headers="r10c1-t12 r1c4-t12" align="left" |
+
<tt>eclipselink-dbws-sessions.xml</tt>
+
|- align="left" valign="top"
+
| id="r11c1-t12" headers="r1c1-t12" align="left" |
+
<tt>targetNameSpace</tt>
+
| headers="r11c1-t12 r1c2-t12" align="left" |
+
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|eclipselink-dbws-schema.xsd]].
+
| headers="r11c1-t12 r1c3-t12" align="left" |
+
No
+
| headers="r11c1-t12 r1c4-t12" align="left" |
+
<tt>"urn:" + projectName</tt>
+
|- align="left" valign="top"
+
| id="r12c1-t12" headers="r1c1-t12" align="left" |
+
<tt>wsdlLocationURI</tt>
+
| headers="r12c1-t12 r1c2-t12" align="left" |
+
URI of this EclipseLink DBWS service's WSDL (used by Web Service tools to generate client code).
+
| headers="r12c1-t12 r1c3-t12" align="left" |
+
No
+
| headers="r12c1-t12 r1c4-t12" align="left" |
+
<tt>http://localhost:8888/</tt>
+
|}
+
 
+
 
+
====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
+
* [[#GenerateFromSQL|GenerateFromSQL]];
+
* [[#GenerateFromStoredProcedures|GenerateFromStoredProcedures]];
+
* [[#GenerateFromTables|GenerateFromTables]].
+
 
+
 
+
====Examples====
+
 
+
This example shows a typical <tt>BuildDBWSWar</tt> task.
+
 
+
 
+
<span id="Example 8-17"></span>
+
''''' 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}"
+
        >
+
        &lt;Table                &lt;!-- Generates CRUD operations -->
+
            catalogPattern="%"
+
            schemaPattern="SCOTT"
+
            tableNamePattern="XR_EMP"
+
            >
+
            <Operations>      &lt;!-- 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 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===
+
 
+
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.
+
 
+
This task generates an operation for each <tt>SQLOperation</tt> nested element you specify.
+
 
+
This task generates EclipseLink database Web service files in a subdirectory of the current working directory named according to the <tt>EclipseLinkProjectName</tt> attribute.
+
 
+
 
+
====Using Parameters====
+
 
+
<span id="Table 8-8"></span>
+
''''' GenerateFromSQL Task Parameters'''''
+
 
+
{| class="RuleFormalWideMax" dir="ltr" title="GenerateFromSQL 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"
+
|- align="left" valign="top"
+
! id="r1c1-t13" align="left" valign="bottom" | '''Attribute'''
+
! id="r1c2-t13" align="left" valign="bottom" | '''Description'''
+
! id="r1c3-t13" align="left" valign="bottom" | '''Required'''
+
! id="r1c4-t13" align="left" valign="bottom" | '''Default'''
+
|- align="left" valign="top"
+
| id="r2c1-t13" headers="r1c1-t13" align="left" |
+
<tt>driver</tt>
+
| headers="r2c1-t13 r1c2-t13" 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.<br><br>'''Example:''' <tt>oracle.jdbc.OracleDriver</tt>
+
| headers="r2c1-t13 r1c3-t13" align="left" |
+
No – Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>.
+
| headers="r2c1-t13 r1c4-t13" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r3c1-t13" headers="r1c1-t13" align="left" |
+
<tt>password</tt>
+
| headers="r3c1-t13 r1c2-t13" align="left" |
+
The password to use when connecting to the relational database.
+
 
+
This attribute is inherited from the Ant [http://ant.apache.org/manual/CoreTasks/sqll <tt>Sql</tt>] task.
+
| headers="r3c1-t13 r1c3-t13" align="left" |
+
No – Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>.
+
| headers="r3c1-t13 r1c4-t13" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r4c1-t13" headers="r1c1-t13" align="left" |
+
<tt>url</tt>
+
| headers="r4c1-t13 r1c2-t13" 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.<br><br>'''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-t13 r1c3-t13" align="left" |
+
No – Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>.
+
| headers="r4c1-t13 r1c4-t13" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r5c1-t13" headers="r1c1-t13" align="left" |
+
<tt>userid</tt>
+
| headers="r5c1-t13 r1c2-t13" align="left" |
+
The user name to use when connecting to the relational database.
+
 
+
This attribute is inherited from the Ant [http://ant.apache.org/manual/CoreTasks/sqll <tt>Sql</tt>] task.
+
| headers="r5c1-t13 r1c3-t13" align="left" |
+
No – Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>.
+
| headers="r5c1-t13 r1c4-t13" align="left" |
+
None
+
|}
+
 
+
 
+
====Specifying Parameters as Nested Elements====
+
 
+
You can specify the following parameters as nested elements of this task:
+
*[[#SQLOperation|SQLOperation]]
+
*[[#Binding|Binding]]
+
 
+
 
+
====Examples====
+
 
+
The [[#Example 8-18|GenerateFromSQL Task]] example shows a typical <tt>GenerateFromSQL</tt> task that specifies an <tt>SQLOperation</tt>.
+
 
+
The EclipseLink database Web service named <tt>emp</tt> will contain an operation <tt>findXREmpByName</tt> that takes one <tt>string</tt> argument (<tt>ENAME</tt>) and returns all records from the <tt>XR_EMP</tt> table whose <tt>ENAME</tt> column is like the argument. Results are returned as a <tt>Collection</tt> of <tt>xr_emptType</tt> instances.
+
 
+
 
+
<span id="Example 8-18"></span>
+
'''''GenerateFromSQL 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|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]].
+
 
+
 
+
===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.
+
 
+
This task generates an operation for each <tt>Procedure</tt> nested element you specify.
+
 
+
This task generates EclipseLink database Web service files in a subdirectory of the current working directory named according to the <tt>EclipseLinkProjectName</tt> attribute.
+
 
+
 
+
 
+
====Using Parameters====
+
 
+
<span id="Table 8-9"></span>
+
''''' GenerateFromStoredProcedures Task Parameters'''''
+
 
+
{| class="RuleFormalWideMax" dir="ltr" title="GenerateFromStoredProcedures 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"
+
|- align="left" valign="top"
+
! id="r1c1-t14" align="left" valign="bottom" | '''Attribute'''
+
! id="r1c2-t14" align="left" valign="bottom" | '''Description'''
+
! id="r1c3-t14" align="left" valign="bottom" | '''Required'''
+
! id="r1c4-t14" align="left" valign="bottom" | '''Default'''
+
|- align="left" valign="top"
+
| id="r2c1-t14" headers="r1c1-t14" align="left" |
+
<tt>driver</tt>
+
| headers="r2c1-t14 r1c2-t14" 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.<br><br>'''Example:''' <tt>oracle.jdbc.OracleDriver</tt>
+
| headers="r2c1-t14 r1c3-t14" align="left" |
+
No – Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>.
+
| headers="r2c1-t14 r1c4-t14" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r3c1-t14" headers="r1c1-t14" align="left" |
+
<tt>password</tt>
+
| headers="r3c1-t14 r1c2-t14" align="left" |
+
The password to use when connecting to the relational database.
+
 
+
This attribute is inherited from the Ant [http://ant.apache.org/manual/CoreTasks/sqll <tt>Sql</tt>] task.
+
| headers="r3c1-t14 r1c3-t14" align="left" |
+
No – Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>.
+
| headers="r3c1-t14 r1c4-t14" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r4c1-t14" headers="r1c1-t14" align="left" |
+
<tt>url</tt>
+
| headers="r4c1-t14 r1c2-t14" 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.<br><br>'''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-t14 r1c3-t14" align="left" |
+
No – Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>.
+
| headers="r4c1-t14 r1c4-t14" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r5c1-t14" headers="r1c1-t14" align="left" |
+
<tt>userid</tt>
+
| headers="r5c1-t14 r1c2-t14" align="left" |
+
The user name to use when connecting to the relational database.
+
 
+
This attribute is inherited from the Ant [http://ant.apache.org/manual/CoreTasks/sqll <tt>Sql</tt>] task.
+
| headers="r5c1-t14 r1c3-t14" align="left" |
+
No – Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>.
+
| headers="r5c1-t14 r1c4-t14" align="left" |
+
None
+
|}
+
 
+
 
+
====Specifying Parameters as Nested Elements====
+
 
+
You can specify the following parameters as nested elements of this task:
+
* [[#SQLOperation|SQLOperation]]
+
* [[#Binding|Binding]]
+
 
+
 
+
====Examples====
+
 
+
The [[#Example 8-19|GenerateFromStoredProcedures Task]] example shows a typical <tt>GenerateFromStoredProcedures</tt> task that specifies a <tt>Procedure</tt> for each of two stored procedures.
+
 
+
The EclipseLink database Web service named <tt>emp</tt> will contain one operation <tt>GetEmployeeByEMPNO_DEPTNO</tt> 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 <tt>procedurePattern</tt> 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|Procedure]].
+
 
+
 
+
<span id="Example 8-19"></span>
+
''''' 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|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Stored Procedure]].
+
 
+
 
+
 
+
===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.
+
 
+
This task generates the following operations for each table you specify using one or more <tt>Table</tt> nested elements:
+
* <tt>create</tt>
+
* <tt>findAll</tt>
+
* <tt>findByPrimaryKey</tt>
+
* <tt>update</tt>
+
* <tt>delete</tt>
+
 
+
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 <tt>EclipseLinkProjectName</tt> attribute.
+
 
+
 
+
 
+
====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"
+
|- align="left" valign="top"
+
! id="r1c1-t15" align="left" valign="bottom" | '''Attribute'''
+
! id="r1c2-t15" align="left" valign="bottom" | '''Description'''
+
! id="r1c3-t15" align="left" valign="bottom" | '''Required'''
+
! id="r1c4-t15" align="left" valign="bottom" | '''Default'''
+
|- align="left" valign="top"
+
| id="r2c1-t15" headers="r1c1-t15" align="left" |
+
<tt>driver</tt>
+
| 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>
+
| headers="r2c1-t15 r1c3-t15" align="left" |
+
No – Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>.
+
| headers="r2c1-t15 r1c4-t15" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r3c1-t15" headers="r1c1-t15" align="left" |
+
<tt>password</tt>
+
| headers="r3c1-t15 r1c2-t15" align="left" |
+
The password to use when connecting to the relational database.
+
 
+
This attribute is inherited from the Ant [http://ant.apache.org/manual/CoreTasks/sqll <tt>Sql</tt>] task.
+
| headers="r3c1-t15 r1c3-t15" align="left" |
+
No – Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>.
+
| headers="r3c1-t15 r1c4-t15" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r4c1-t15" headers="r1c1-t15" align="left" |
+
<tt>url</tt>
+
| 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>''
+
| headers="r4c1-t15 r1c3-t15" align="left" |
+
No – Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>.
+
| headers="r4c1-t15 r1c4-t15" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r5c1-t15" headers="r1c1-t15" align="left" |
+
<tt>userid</tt>
+
| headers="r5c1-t15 r1c2-t15" align="left" |
+
The user name to use when connecting to the relational database.
+
 
+
This attribute is inherited from the Ant [http://ant.apache.org/manual/CoreTasks/sqll <tt>Sql</tt>] task.
+
| headers="r5c1-t15 r1c3-t15" align="left" |
+
No – Can be overridden by <tt>BuildDBWSWar</tt> attribute <tt>dataSource</tt>.
+
| headers="r5c1-t15 r1c4-t15" align="left" |
+
None
+
|}
+
 
+
 
+
====Specifying Parameters as Nested Elements====
+
 
+
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.
+
 
+
 
+
====Examples====
+
 
+
The [[#Example 8-20|GenerateFromTables Task]] example shows a typical <tt>GenerateFromTables</tt> task.
+
 
+
The EclipseLink database Web service named <tt>emp</tt> will contain create, read, read-all, update, and delete operations for table <tt>XR_EMP</tt>.
+
 
+
Note that if <tt>tableNamePattern</tt> 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|Table]].
+
 
+
 
+
<span id="Example 8-20"></span>
+
''''' 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}"
+
        >
+
        &lt;Table                &lt;!-- Generates CRUD operations -->
+
+
            catalogPattern="%"
+
            schemaPattern="SCOTT"
+
            tableNamePattern="XR_EMP"
+
            >
+
        &lt;/Table>
+
    </GenerateFromTables>
+
</BuildDBWSWar>
+
 
+
 
+
 
+
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.
+
 
+
This task is applicable only in <tt>Table</tt> tasks. For more information, see [[#Table|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:
+
*[[#Procedure|Procedure]]
+
*[[#SQLOperation|SQLOperation]]
+
 
+
 
+
====Examples====
+
 
+
This example shows a typical <tt>Operations</tt> task.
+
 
+
 
+
<span id="Example 8-21"></span>
+
''''' 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}"
+
        >
+
        &lt;Table                &lt;!-- Generates CRUD operations -->
+
            catalogPattern="%"
+
            schemaPattern="SCOTT"
+
            tableNamePattern="XR_EMP"
+
            >
+
+
            <Operations>      &lt;!-- 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|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from a Database Table]].
+
 
+
 
+
 
+
===Procedure===
+
 
+
The <tt>Procedure</tt> 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:
+
* [[#GenerateFromStoredProcedures|GenerateFromStoredProcedures]]
+
* [[#Operations|Operations]]
+
 
+
 
+
 
+
====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"
+
|- align="left" valign="top"
+
! id="r1c1-t16" align="left" valign="bottom" | '''Attribute'''
+
! id="r1c2-t16" align="left" valign="bottom" | '''Description'''
+
! id="r1c3-t16" align="left" valign="bottom" | '''Required'''
+
! id="r1c4-t16" align="left" valign="bottom" | '''Default'''
+
|- align="left" valign="top"
+
| id="r2c1-t16" headers="r1c1-t16" align="left" |
+
<tt>catalogPattern</tt>
+
| headers="r2c1-t16 r1c2-t16" align="left" |
+
A pattern that matches one or more catalog names in the database identified by the parent task (supports SQL-92 <tt>%</tt> wild-card).
+
| headers="r2c1-t16 r1c3-t16" align="left" |
+
No
+
| headers="r2c1-t16 r1c4-t16" align="left" |
+
<tt>%</tt><br>
+
|- align="left" valign="top"
+
| id="r3c1-t16" headers="r1c1-t16" align="left" |
+
<tt>schemaPattern</tt>
+
| headers="r3c1-t16 r1c2-t16" align="left" |
+
A pattern that matches one or more schema names in the database identified by the parent task (supports SQL-92 <tt>%</tt> wild-card).
+
| headers="r3c1-t16 r1c3-t16" align="left" |
+
No
+
| headers="r3c1-t16 r1c4-t16" align="left" |
+
<tt>%</tt><br>
+
|- align="left" valign="top"
+
| id="r4c1-t16" headers="r1c1-t16" align="left" |
+
<tt>procedurePattern</tt>
+
| headers="r4c1-t16 r1c2-t16" align="left" |
+
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 <tt>%</tt> wild-card).
+
| headers="r4c1-t16 r1c3-t16" align="left" |
+
Yes
+
| headers="r4c1-t16 r1c4-t16" align="left" |
+
None
+
|- align="left" valign="top"
+
| id="r5c1-t16" headers="r1c1-t16" align="left" |
+
<tt>isCollection</tt>
+
| headers="r5c1-t16 r1c2-t16" align="left" |
+
Specifies whether or not the procedure returns multiple results. Valid values are:
+
* <tt>true</tt> - the operation returns more than a single row.
+
* <tt>false</tt> - the operation returns a single row.
+
| headers="r5c1-t16 r1c3-t16" align="left" |
+
No
+
| headers="r5c1-t16 r1c4-t16" align="left" |
+
<tt>true</tt>
+
|- align="left" valign="top"
+
| id="r6c1-t16" headers="r1c1-t16" align="left" |
+
<tt>isSimpleXMLFormat</tt>
+
| headers="r6c1-t16 r1c2-t16" align="left" |
+
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>false</tt> - the operation returns information in the Simple XML Format.<br>For more information, see [[#Unstructured Data|Unstructured Data]].
+
| headers="r6c1-t16 r1c3-t16" align="left" |
+
Yes
+
| headers="r6c1-t16 r1c4-t16" align="left" |
+
<tt>false</tt>
+
|- align="left" valign="top"
+
| id="r7c1-t16" headers="r1c1-t16" align="left" |
+
<tt>simpleXMLFormatTag</tt>
+
| headers="r7c1-t16 r1c2-t16" align="left" |
+
The name of the root-level Simple XML Format element-tag.<br>For more information, see [[#Unstructured Data|Unstructured Data]].
+
| headers="r7c1-t16 r1c3-t16" align="left" |
+
No
+
| headers="r7c1-t16 r1c4-t16" align="left" |
+
<tt>simple-xml-format</tt>
+
|- align="left" valign="top"
+
| id="r8c1-t16" headers="r1c1-t16" align="left" |
+
<tt>xmlTag</tt>
+
| headers="r8c1-t16 r1c2-t16" align="left" |
+
The name of the grouping XML element-tag for rows.<br>For more information, see [[#Unstructured Data|Unstructured Data]].
+
| headers="r8c1-t16 r1c3-t16" align="left" |
+
No
+
| headers="r8c1-t16 r1c4-t16" align="left" |
+
<tt>simple-xml</tt>
+
|- align="left" valign="top"
+
| id="r9c1-t16" headers="r1c1-t16" align="left" |
+
<tt>binaryAttachment</tt>
+
| headers="r9c1-t16 r1c2-t16" align="left" |
+
Specifies whether or not the operation returns binary data as a SOAP attachment. Valid values are:
+
* <tt>true</tt> - the operation returns binary data as a SOAP attachment.
+
* <tt>false</tt> - the operation does not return binary data as a SOAP attachment.
+
| headers="r9c1-t16 r1c3-t16" align="left" |
+
No
+
| headers="r9c1-t16 r1c4-t16" align="left" |
+
<tt>false</tt>
+
|- align="left" valign="top"
+
| id="r10c1-t16" headers="r1c1-t16" align="left" |
+
<tt>returnType</tt>
+
| 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>eclipselink-dbws-schema.xsd</tt> file defines. For more information, see [[#eclipselink-dbws-schema.xsd|eclipselink-dbws-schema.xsd]].
+
| headers="r10c1-t16 r1c3-t16" align="left" |
+
No
+
| headers="r10c1-t16 r1c4-t16" align="left" |
+
Deduced from database metadata
+
|}
+
 
+
 
+
====Examples====
+
 
+
This example shows a <tt>Procedure</tt> task.
+
 
+
 
+
<span id="Example 8-22"></span>
+
''''' 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 <tt>emp</tt> will contain one operation <tt>GetEmployeeByEMPNO_DEPTNO</tt> 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 <tt>procedurePattern</tt> 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 the [[#Example 8-23|Unstructured Data Result]] example shows. Column tags (like <tt>EMPNO</tt>, <tt>DEPTNO</tt>, and <tt>SAL</tt>) are determined by the database schema.
+
 
+
 
+
<span id="Example 8-23"></span>
+
''''' 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|How to Create Deployment Files for a EclipseLink Database Web Service Using Ant: from SQL]].
+
 
+
 
+
 
+
===SQLOperation===
+
 
+
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:
+
* [[#GenerateFromSQL|GenerateFromSQL]]
+
* [[#Operations|Operations]]
+
 
+
 
+
 
+
====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"
+
|- align="left" valign="top"
+
! id="r1c1-t17" align="left" valign="bottom" | '''Attribute'''
+
! id="r1c2-t17" align="left" valign="bottom" | '''Description'''
+
! id="r1c3-t17" align="left" valign="bottom" | '''Required'''
+
! id="r1c4-t17" align="left" valign="bottom" | '''Default'''
+
|- align="left" valign="top"
+
| id="r2c1-t17" headers="r1c1-t17" align="left" |
+
<tt>name</tt>
+
| headers="r2c1-t17 r1c2-t17" align="left" |
+
The name of the SQL operation. The parent task that owns the <tt>SQLOperation</tt> specifies the database on which to perform the SQL operation.
+
| headers="r2c1-t17 r1c3-t17" align="left" |
+
Yes
+
| headers="r2c1-t17 r1c4-t17" align="left" | <br>
+
|- align="left" valign="top"
+
| id="r3c1-t17" headers="r1c1-t17" align="left" |
+
<tt>isCollection</tt>
+
| headers="r3c1-t17 r1c2-t17" align="left" |
+
Specifies whether or not the procedure returns multiple results. Valid values are:
+
* <tt>true</tt> - the operation returns more than a single row.
+
* <tt>false</tt> - the operation returns a single row.
+
| headers="r3c1-t17 r1c3-t17" align="left" |
+
No
+
| headers="r3c1-t17 r1c4-t17" align="left" |
+
<tt>true</tt>
+
|- align="left" valign="top"
+
| id="r4c1-t17" headers="r1c1-t17" align="left" |
+
<tt>isSimpleXMLFormat</tt>
+
| headers="r4c1-t17 r1c2-t17" align="left" |
+
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>false</tt> - the operation returns information in the Simple XML Format.<br>For more information, see [[#Unstructured Data|Unstructured Data]].
+
| headers="r4c1-t17 r1c3-t17" align="left" |
+
Yes
+
| headers="r4c1-t17 r1c4-t17" align="left" |
+
<tt>false</tt>
+
|- align="left" valign="top"
+
| id="r5c1-t17" headers="r1c1-t17" align="left" |
+
<tt>simpleXMLFormatTag</tt>
+
| headers="r5c1-t17 r1c2-t17" align="left" |
+
The name of the root-level Simple XML Format element-tag.<br>For more information, see [[#Unstructured Data|Unstructured Data]].
+
| headers="r5c1-t17 r1c3-t17" align="left" |
+
No
+
| headers="r5c1-t17 r1c4-t17" align="left" |
+
<tt>simple-xml-format</tt>
+
|- align="left" valign="top"
+
| id="r6c1-t17" headers="r1c1-t17" align="left" |
+
<tt>xmlTag</tt>
+
| headers="r6c1-t17 r1c2-t17" align="left" |
+
The name of the grouping XML element-tag for rows.<br>For more information, see [[#Unstructured Data|Unstructured Data]].
+
| headers="r6c1-t17 r1c3-t17" align="left" |
+
No
+
| headers="r6c1-t17 r1c4-t17" align="left" |
+
<tt>simple-xml</tt>
+
|- align="left" valign="top"
+
| id="r7c1-t17" headers="r1c1-t17" align="left" |
+
<tt>binaryAttachment</tt>
+
| headers="r7c1-t17 r1c2-t17" align="left" |
+
Specifies whether or not the operation returns binary data as a SOAP attachment. Valid values are:
+
* <tt>true</tt> - the operation returns binary data as a SOAP attachment.
+
* <tt>false</tt> - the operation does not return binary data as a SOAP attachment.
+
| headers="r7c1-t17 r1c3-t17" align="left" |
+
No
+
| headers="r7c1-t17 r1c4-t17" align="left" |
+
<tt>false</tt>
+
|- align="left" valign="top"
+
| id="r8c1-t17" headers="r1c1-t17" align="left" |
+
<tt>returnType</tt>
+
| 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>eclipselink-dbws-schema.xsd</tt> file defines. For more information, see [[#eclipselink-dbws-schema.xsd|eclipselink-dbws-schema.xsd]].
+
| headers="r8c1-t17 r1c3-t17" align="left" |
+
No
+
| headers="r8c1-t17 r1c4-t17" align="left" |
+
Deduced from database metadata
+
|}
+
 
+
 
+
 
+
====Specifying Parameters as Nested Elements====
+
 
+
You can specify the following parameter as nested element of this task:
+
* [[#Binding|Binding]]
+
 
+
 
+
====Examples====
+
This example shows two <tt>SQLOperation</tt> tasks.
+
 
+
 
+
<span id="Example 8-24"></span>
+
''''' 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 <tt>emp</tt> will contain two operations:
+
* <tt>findXREmpByName</tt> that takes one <tt>string</tt> argument (<tt>ENAME</tt>) and returns all records from the <tt>XR_EMP</tt> table whose <tt>ENAME</tt> column is like the argument. Results are returned as a <tt>Collection</tt> of <tt>xr_emptType</tt> instances.
+
* <tt>xr-employeeInfo</tt> that returns unstructured data in the Simple XML Format as the [[#Example 8-25|Unstructured Data Result]] example shows. In this output, <tt>COUNT</tt> is the number of records in table <tt>XR_EMP</tt> and <tt>MAX-Salary</tt> is the largest number in the <tt>SAL</tt> column. The tag names <tt>COUNT</tt> and <tt>MAX-Salary</tt> are as specified in the SQL statement.
+
 
+
 
+
<span id="Example 8-25"></span>
+
''''' 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|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.
+
 
+
This task is applicable only in <tt>GenerateFromTables</tt> tasks. For more information, see [[#GenerateFromTables|GenerateFromTables]].
+
 
+
 
+
 
+
====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"
+
|- align="left" valign="top"
+
! id="r1c1-t18" align="left" valign="bottom" | '''Attribute'''
+
! id="r1c2-t18" align="left" valign="bottom" | '''Description'''
+
! id="r1c3-t18" align="left" valign="bottom" | '''Required'''
+
! id="r1c4-t18" align="left" valign="bottom" | '''Default'''
+
|- align="left" valign="top"
+
| id="r2c1-t18" headers="r1c1-t18" align="left" |
+
<tt>catalogPattern</tt>
+
| headers="r2c1-t18 r1c2-t18" align="left" |
+
A pattern that matches one or more catalog names in the database identified by the parent task (supports SQL-92 <tt>%</tt> wild-card).
+
| headers="r2c1-t18 r1c3-t18" align="left" |
+
No
+
| headers="r2c1-t18 r1c4-t18" align="left" |
+
<tt>%</tt><br>
+
|- align="left" valign="top"
+
| id="r3c1-t18" headers="r1c1-t18" align="left" |
+
<tt>schemaPattern</tt>
+
| headers="r3c1-t18 r1c2-t18" align="left" |
+
A pattern that matches one or more schema names in the database identified by the parent task (supports SQL-92 <tt>%</tt> wild-card).
+
| headers="r3c1-t18 r1c3-t18" align="left" |
+
No
+
| headers="r3c1-t18 r1c4-t18" align="left" |
+
<tt>%</tt><br>
+
|- align="left" valign="top"
+
| id="r4c1-t18" headers="r1c1-t18" align="left" |
+
<tt>tableNamePattern</tt>
+
| headers="r4c1-t18 r1c2-t18" align="left" |
+
A pattern that matches one or more table names in the database identified by the parent task (supports SQL-92 <tt>%</tt> wild-card).
+
| headers="r4c1-t18 r1c3-t18" align="left" |
+
Yes
+
| headers="r4c1-t18 r1c4-t18" align="left" |
+
None
+
|}
+
 
+
 
+
 
+
====Specifying Parameters as Nested Elements====
+
 
+
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 EclipseLink database Web service named <tt>emp</tt> will contain create, read, read-all, update, and delete operations for table <tt>XR_EMP</tt>.
+
 
+
Note that if <tt>tableNamePattern</tt> 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.
+
 
+
 
+
<span id="Example 8-26"></span>
+
''''' 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}"
+
        >
+
        &lt;Table                &lt;!-- Generates CRUD operations -->
+
            catalogPattern="%"
+
            schemaPattern="SCOTT"
+
            tableNamePattern="XR_EMP"
+
            >
+
        &lt;/Table>
+
      </GenerateFromTables>
+
</BuildDBWSWar>
+
 
+
 
+
 
+
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==
 
==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]].
+
To deploy a EclipseLink application to OC4J, 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]].
  
  
Line 2,322: Line 173:
 
===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 the [[#Table 8-14|orion-ejb-jar.xml File persistence-manager Entries]] table) in the <tt>orion-ejb-jar.xml</tt> file.
+
If you are using EclipseLink as your OC4J persistence manager, you can configure the <tt>persistence-manager</tt> subentry (see the [[#Table 8-14|orion-ejb-jar.xml File persistence-manager Entries]] table) in the <tt>orion-ejb-jar.xml</tt> file.
  
 
If you are not using EclipseLink as your OC4J persistence manager, do not modify the <tt>persistence-manager</tt> subentries.
 
If you are not using EclipseLink as your OC4J persistence manager, do not modify the <tt>persistence-manager</tt> subentries.
Line 2,524: Line 375:
 
|}
 
|}
  
 +
-->
  
  
==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.
+
==Configuring the weblogic-ejb-jar.xml File for WebLogic Server==
 +
Before you deploy a EclipseLink application to Oracle 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|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,535: Line 387:
  
 
===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><br>For more information about the EclipseLink concurrency strategy, see [[Configuring%20a%20Descriptor%20(ELUG)#Configuring Locking Policy|Configuring Locking Policy]].
+
* <tt>concurrency-strategy</tt><nowiki>: This tag specifies how Oracle WebLogic Server manages concurrent users for a given bean. Because EclipseLink manages concurrent access internally, it does not require this tag.</nowiki><br>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>
Line 2,554: Line 405:
  
 
[[Category: EclipseLink User's Guide]]
 
[[Category: EclipseLink User's Guide]]
[[Category: Draft]]
+
[[Category: Release 1]]
 
[[Category: Concept]]
 
[[Category: Concept]]

Latest revision as of 11:21, 18 July 2012

Elug draft icon.png For the latest EclipseLink documentation, please see http://www.eclipse.org/eclipselink/documentation/


Related Topics

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

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. 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 persistence_1_0.xsd and it is located in the <ECLIPSELINK_HOME>\xsds directory.

See EclipseLink/XSDs for more information.

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 an 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 EntityManager. 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;
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>\jlib\eclipselink.jar and <ECLIPSELINK_HOME>\utils\workbench\jlib\eclipselinkmw.jar files.


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.


sessions.xml File

Each EclipseLink project belongs to an 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 <ECLIPSELINK_HOME>\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 an 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 EntityManager. For more information, see What You May Need to Know About EclipseLink JPA Overriding Mechanisms.



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.sessions-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:



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.



Configuring the weblogic-ejb-jar.xml File for WebLogic Server

Before you deploy a EclipseLink application to Oracle 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 Oracle WebLogic Server 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.



Copyright Statement