Package org.eclipse.persistence.dbws
Class DBWSModel
java.lang.Object
org.eclipse.persistence.internal.xr.XRServiceModel
org.eclipse.persistence.dbws.DBWSModel
public class DBWSModel
extends org.eclipse.persistence.internal.xr.XRServiceModel
PUBLIC: model object for eclipselink-dbws.xml descriptor file. A DBWS (also known as
an XRServiceAdapter) requires the following resources:
- metadata in the form of a descriptor file called
eclipselink-dbws.xmlin theMETA-INF/directory
(inside a.jarfile, as an external 'exploded' directory on the classpath
or in the WEB-INF/classes/META-INF/ directory inside a.warfile).
- an XML Schema Definition (
.xsd) file calledeclipselink-dbws-schema.xsd
located at the root directory of a.jarfile, at the root of the first directory on the
classpath or in theWEB-INF/wsdl/directory of a.warfile - an EclipseLink
sessions.xmlfile calledeclipselink-dbws-sessions.xml(in theMETA-INF/directory)
the naming convention for thesessions.xmlfiles can be overridden by the
optional<sessions-file>entry in theeclipselink-dbws.xmldescriptor file. - EclipseLink metadata in the form of a EclipseLink
Project(either deployment XML located
in theMETA-INF/directory or Java classes on the classpath or in the
WEB-INF/classesdirectory inside a.warfile).
A typical
DBWSrequires two projects: one to represent the O-R side, the other to represent the O-X side.
The O-R and O-XProjectsmetadata must have:
i) identical case-sensitiveProjectnames:<?xml version="1.0" encoding="UTF-8"?> <eclipselink:object-persistence version="Eclipse Persistence Services ..." xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:eclipselink="http://xmlns.oracle.com/ias/xsds/eclipselink" > <eclipselink:name>example</eclipselink:name> or ... import org.eclipse.persistence.sessions.Project; public class SomeORProject extends Project { public SomeORProject () { setName("Example"); ... } public class SomeOXProject extends Project { public SomeOXProject () { setName("Example"); ... }ii) identical case-sensitive aliases forDescriptorsthat are common between the projects:<eclipselink:class-mapping-descriptor xsi:type="eclipselink:relational-class-mapping-descriptor"> <eclipselink:class>some.package.SomeClass</eclipselink:class> <eclipselink:alias>SomeAlias</eclipselink:alias> ... <eclipselink:class-mapping-descriptor xsi:type="eclipselink:xml-class-mapping-descriptor"> <eclipselink:class>some.package.SomeClass</eclipselink:class> <eclipselink:alias>SomeAlias</eclipselink:alias>
eclipselink-dbws.xml descriptor 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>example</name>
<sessions-file>example-dbws-sessions.xml</sessions-file>
<query>
<name>countEmployees</name>
<result>
<type>xsd:int</type>
<simple-xml-format>
<simple-xml-format-tag>employee-info</simple-xml-format-tag>
<simple-xml-tag>aggregate-info</simple-xml-tag>
</simple-xml-format>
</result>
<sql><![CDATA[select count(*) from EMP]]></sql>
</query>
<query>
<name>findAllEmployees</name>
<result isCollection="true">
<type>empType</type>
</result>
<sql><![CDATA[select * from EMP]]></sql>
</query>
</dbws>
- Author:
- Mike Norman - michael.norman@oracle.com
-
Field Summary
Fields inherited from class org.eclipse.persistence.internal.xr.XRServiceModel
name, operations, sessionsFile -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.eclipse.persistence.internal.xr.XRServiceModel
getName, getOperation, getOperations, getOperationsList, getSessionsFile, setName, setOperations, setSessionsFile
-
Constructor Details
-
DBWSModel
public DBWSModel()
-