public class XRServiceFactory
extends java.lang.Object
INTERNAL: helper class that knows how to build a XRServiceAdapter
(a.k.a DBWS). An
XRService
requires the following resources:
eclipselink-dbws.xml
descriptor file.
Project
(either deployment XML or Java classes).
A typical XRService
requires two projects: one to represent the O-R side, the other to
represent the O-X side.
The O-R and O-X Projects
metadata must have:
i) identical case-sensitive Project
names:
<?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 for
Descriptors
that 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>
<?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>
Modifier and Type | Class and Description |
---|---|
static class |
XRServiceFactory.JPAMetadataSource
INTERNAL:
Implementation of MetadataSource to allow passing JPA metadata to the
MetadataProcessor.
|
static class |
XRServiceFactory.OXMMetadataSource
INTERNAL:
Implementation of MetadataSource to allow passing XmlBindings
to the DynamicJAXBContextFactory
|
static class |
XRServiceFactory.XRPersistenceUnitInfo
INTERNAL:
PersistenceUnitInfo implementation to allow creation of a MetadataProcessor
instance.
|
Modifier and Type | Field and Description |
---|---|
java.lang.ClassLoader |
parentClassLoader |
java.io.InputStream |
xrSchemaStream |
XRServiceAdapter |
xrService |
Constructor and Description |
---|
XRServiceFactory() |
Modifier and Type | Method and Description |
---|---|
void |
buildDescriptorIndex()
INTERNAL:
|
XRServiceAdapter |
buildService() |
XRServiceAdapter |
buildService(XRServiceModel xrServiceModel) |
void |
buildSessions()
INTERNAL:
|
void |
customizeSession(Session orSession,
Session oxSession) |
static javax.xml.parsers.DocumentBuilder |
getDocumentBuilder() |
static javax.xml.transform.Transformer |
getTransformer() |
void |
initializeOperations()
INTERNAL:
|
void |
initializeService(java.lang.ClassLoader parentClassLoader,
java.io.InputStream xrSchemaStream)
INTERNAL: Initialize the various components (of the
XRService }
(O-R Project, O-X Project, Schema definitions, auto-generated classes, etc.) |
void |
loadXMLSchema(java.io.InputStream xrSchemaStream)
INTERNAL:
Read and unmarshal
XRService 's .xsd file. |
void |
loginSessions()
INTERNAL:
|
void |
validateOperations()
INTERNAL:
|
public XRServiceAdapter xrService
public java.lang.ClassLoader parentClassLoader
public java.io.InputStream xrSchemaStream
public XRServiceAdapter buildService()
public XRServiceAdapter buildService(XRServiceModel xrServiceModel)
public void initializeService(java.lang.ClassLoader parentClassLoader, java.io.InputStream xrSchemaStream)
INTERNAL: Initialize the various components (of the XRService
}
(O-R Project, O-X Project, Schema definitions, auto-generated classes, etc.)
parentClassLoader
- the parent ClassLoader
for the auto-generated classes.xrSchemaStream
- stream resource for the XRService
's .xsd file.public void loadXMLSchema(java.io.InputStream xrSchemaStream)
INTERNAL:
Read and unmarshal XRService
's .xsd file.
xrSchemaStream
- Stream resource for the XRService
's .xsd file.public void buildSessions()
INTERNAL:
public void loginSessions()
INTERNAL:
public void buildDescriptorIndex()
INTERNAL:
public void validateOperations()
INTERNAL:
public void initializeOperations()
INTERNAL:
public static javax.xml.parsers.DocumentBuilder getDocumentBuilder()
public static javax.xml.transform.Transformer getTransformer()
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference