Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/Examples/DBWS/ExistingMappingFiles"

(New page: == Use of pre-existing EclipseLink ORM and MOXy mappings== A DBWS service may be constructed using pre-existing EclipseLink ORM and OXM maps (both Project classes and Project deployment X...)
 
m (Use of pre-existing EclipseLink ORM and OXM mappings)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
== Use of pre-existing EclipseLink ORM and MOXy mappings==
+
<css>
 +
  .source-java5 {padding:4px;border:1px solid black; background-color: white;}
 +
  .source-xml {padding:4px;border:1px solid black; background-color: white;}
 +
  .source-text {padding:4px;border:1px solid black; background-color: white;}
 +
</css>
 +
__NOTOC__
  
A DBWS service may be constructed using pre-existing EclipseLink ORM and OXM maps (both Project classes and Project deployment XML are supported) with the following naming convention:
+
== Use of pre-existing EclipseLink ORM and OXM mappings==
: 1. identical case-sensitive Project names
+
  
<source lang="xml">
+
A DBWS service may be constructed using pre-existing EclipseLink ORM and OXM maps (both Project classes and Project deployment XML are supported) with identical case-sensitive aliases for Descriptors that are common between the projects
<xml version="1.0" encoding="UTF-8"?>
+
<object-persistence version="Eclipse Persistence Services - @VERSION@ (Build @BUILD_NUMBER@)"
+
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
  xmlns="http://www.eclipse.org/eclipselink/xsds/persistence"
+
  >
+
  <name>Example</name>
+
</source>&nbsp;or&nbsp;
+
  
 +
<source lang="xml" enclose="div">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<object-persistence version="Eclipse Persistence Services - some version (some build date)" xmlns="http://www.eclipse.org/eclipselink/xsds/persistence" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:eclipselink="http://www.eclipse.org/eclipselink/xsds/persistence">
 +
  <name>SomeORProject</name>
 +
  <class-mapping-descriptors>
 +
      <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
 +
        <class>some.package.SomeClass</class>
 +
        <alias>SomeAlias</alias>
 +
...
  
<source lang="java">
+
<?xml version="1.0" encoding="UTF-8"?>
import org.eclipse.persistence.sessions.Project;
+
<object-persistence version="Eclipse Persistence Services - some version (some build date)" xmlns="http://www.eclipse.org/eclipselink/xsds/persistence" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:eclipselink="http://www.eclipse.org/eclipselink/xsds/persistence">
public class SomeORProject extends Project {
+
  <name>SomeOXProject</name>
  public SomeORProject () {
+
  <class-mapping-descriptor xsi:type="xml-class-mapping-descriptor">
    setName("Example");
+
      <class>some.package.SomeClass</class>
    ...
+
      <alias>SomeAlias</alias>
}
+
...
public class SomeOXProject extends Project {
+
  public SomeOXProject () {
+
    setName("Example");
+
    ...
+
}
+
 
</source>
 
</source>
  
: 2. identical case-sensitive aliases for Descriptors that are common between the projects
 
  
<source lang="xml">
+
'''Note:''' When building a DBWS web service in this way (that is, without the <tt>DBWSBuilder</tt> Utility) be sure to create all the necessary deployment artifacts
<class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
+
  <class>some.package.SomeClass</class>
+
  <alias>SomeAlias</alias>
+
  ...
+
<class-mapping-descriptor xsi:type="xml-class-mapping-descriptor">
+
  <class>some.package.SomeClass</class>
+
  <alias>SomeAlias</alias>
+
</source>
+
 
+
Any existing named queries from the EclipseLink ORM map may be exposed as query operations for the EclipseLink DBWS service; additional Insert/Update/Delete/Query operations can be added. Pre-existing domain classes can be bundled with the service so that they are available at runtime.
+

Latest revision as of 08:48, 7 December 2011


Use of pre-existing EclipseLink ORM and OXM mappings

A DBWS service may be constructed using pre-existing EclipseLink ORM and OXM maps (both Project classes and Project deployment XML are supported) with identical case-sensitive aliases for Descriptors that are common between the projects

<?xml version="1.0" encoding="UTF-8"?>
<object-persistence version="Eclipse Persistence Services - some version (some build date)" xmlns="http://www.eclipse.org/eclipselink/xsds/persistence" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:eclipselink="http://www.eclipse.org/eclipselink/xsds/persistence">
   <name>SomeORProject</name>
   <class-mapping-descriptors>
      <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
         <class>some.package.SomeClass</class>
         <alias>SomeAlias</alias>
...

<?xml version="1.0" encoding="UTF-8"?>
<object-persistence version="Eclipse Persistence Services - some version (some build date)" xmlns="http://www.eclipse.org/eclipselink/xsds/persistence" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:eclipselink="http://www.eclipse.org/eclipselink/xsds/persistence">
   <name>SomeOXProject</name>
   <class-mapping-descriptor xsi:type="xml-class-mapping-descriptor">
      <class>some.package.SomeClass</class>
      <alias>SomeAlias</alias>
...


Note: When building a DBWS web service in this way (that is, without the DBWSBuilder Utility) be sure to create all the necessary deployment artifacts

Back to the top