Merge branch 'master' of ssh://git.eclipse.org/gitroot/eclipselink/examples

Conflicts:
	dbws/dbws.simple/src/main/resources/dbws-builder.xml
diff --git a/dbws/dbws.simple/pom.xml b/dbws/dbws.simple/pom.xml
index 246e1a7..2d06ae6 100644
--- a/dbws/dbws.simple/pom.xml
+++ b/dbws/dbws.simple/pom.xml
@@ -35,7 +35,7 @@
 		<developer>
 			<name>Dave McCann</name>
 			<organization>Oracle</organization>
-			<email>david.nccann@oracle.com</email>
+			<email>david.mccann@oracle.com</email>
 		</developer>
 	</developers>
 
diff --git a/jpa-moxy/round-trip/.classpath b/jpa-moxy/round-trip/.classpath
new file mode 100644
index 0000000..698778f
--- /dev/null
+++ b/jpa-moxy/round-trip/.classpath
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/jpa-moxy/round-trip/.project b/jpa-moxy/round-trip/.project
new file mode 100644
index 0000000..15966b8
--- /dev/null
+++ b/jpa-moxy/round-trip/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>round-trip</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
+	</natures>
+</projectDescription>
diff --git a/jpa-moxy/round-trip/.settings/org.eclipse.core.resources.prefs b/jpa-moxy/round-trip/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..839d647
--- /dev/null
+++ b/jpa-moxy/round-trip/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,5 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
+encoding//src/test/java=UTF-8
+encoding/<project>=UTF-8
diff --git a/jpa-moxy/round-trip/.settings/org.eclipse.jdt.core.prefs b/jpa-moxy/round-trip/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..ec4300d
--- /dev/null
+++ b/jpa-moxy/round-trip/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,5 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/jpa-moxy/round-trip/.settings/org.eclipse.m2e.core.prefs b/jpa-moxy/round-trip/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/jpa-moxy/round-trip/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/jpa-moxy/round-trip/README.md b/jpa-moxy/round-trip/README.md
new file mode 100644
index 0000000..7a1525d
--- /dev/null
+++ b/jpa-moxy/round-trip/README.md
@@ -0,0 +1,32 @@
+This example illustrates JPA-JAXB fidelity with EclipseLink JPA and MOXy:
+
+It demonstrates the use of XmlInverseReference to manage the ManyToOne 'backpointer' of a ManyToOne relationship.  EclipseLink MOXy will marshall a cyclical JPA entity graph to XML or JSON and upon unmarshall, will restore the backpointer.
+
+It also demonstrates how EclipseLink MOXy and JPA can be used to obtain database data in either XML or JSON format and how that data can be modified and any changes returned to the database.  This ability underlies JPA-RS.
+
+Running the Example
+-------------------
+
+Using Maven, create and populate the sample database with:
+
+	mvn exec:java -P initdb
+	
+You can run the Marshall class to produce either an XML or JSON version of the sole Customer object in the database with either:
+
+	mvn exec:java -P marshall-json
+	
+or
+
+	mvn exec:java -P marshall-xml
+	
+The result will be a  customer.[xml|json] file in the target folder.  Feel free to edit the contents of the file to say, change the name of the customer.
+
+To apply your changes to the database run the appropriate command, either:
+
+	mvn exec:java -P unmarshall-json
+	
+or 
+
+	mvn exec:java -P unmarshall-xml
+	
+With EclipseLink logging set to FINE in the example you'll see UPDATE statements that correspond to the changes you made to the XML or JSON file.
\ No newline at end of file
diff --git a/jpa-moxy/round-trip/pom.xml b/jpa-moxy/round-trip/pom.xml
new file mode 100644
index 0000000..78beb4b
--- /dev/null
+++ b/jpa-moxy/round-trip/pom.xml
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>eclipselink.example.jpa-moxy</groupId>
+	<artifactId>round-trip</artifactId>
+	<version>2.4.2-SNAPSHOT</version>
+	<packaging>jar</packaging>
+
+	<name>JPA-MOXy Example</name>
+
+	<scm>
+		<connection>git://git.eclipse.org/gitroot/eclipselink/examples.git</connection>
+		<url>http://git.eclipse.org/c/eclipselink/examples.git/</url>
+	</scm>
+
+	<licenses>
+		<license>
+			<name>EPL: Eclipse Public License</name>
+			<url>http://www.eclipse.org/legal/epl-v10.html</url>
+		</license>
+		<license>
+			<name>EDL: Eclipse Distribution License</name>
+			<url>http://www.eclipse.org/org/documents/edl-v10.php</url>
+		</license>
+	</licenses>
+
+	<developers>
+		<developer>
+			<name>Shaun Smith</name>
+			<organization>Oracle</organization>
+			<email>shaun.smith@oracle.com</email>
+			<url>onpersistence.blogspot.com</url>
+		</developer>
+	</developers>
+
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<eclipselink.groupid>org.eclipse.persistence</eclipselink.groupid>
+		<eclipselink.version>2.4.2-SNAPSHOT</eclipselink.version>
+	</properties>
+
+	<repositories>
+		<repository>
+			<id>Java.Net</id>
+			<url>http://download.java.net/maven/2/</url>
+		</repository>
+		<repository>
+			<id>EclipseLink</id>
+			<url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
+		</repository>
+	</repositories>
+
+	<dependencies>
+		<dependency>
+			<groupId>${eclipselink.groupid}</groupId>
+			<artifactId>javax.persistence</artifactId>
+			<version>2.0.5</version>
+		</dependency>
+		<dependency>
+			<groupId>${eclipselink.groupid}</groupId>
+			<artifactId>eclipselink</artifactId>
+			<version>${eclipselink.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.derby</groupId>
+			<artifactId>derby</artifactId>
+			<version>10.9.1.0</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.11</version>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<defaultGoal>test</defaultGoal>
+
+		<!-- ensure jaxb.properties copied to target/classes -->
+		<resources>
+			<resource>
+				<directory>src/main/java</directory>
+				<excludes>
+					<exclude>**/*.java</exclude>
+				</excludes>
+			</resource>
+			<resource>
+				<directory>src/main/resources</directory>
+			</resource>
+		</resources>
+
+		<plugins>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>exec-maven-plugin</artifactId>
+				<version>1.2.1</version>
+				<configuration>
+					<systemProperties>
+						<property>
+							<key>derby.stream.error.file</key>
+							<value>target/derby.log</value>
+						</property>
+					</systemProperties>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.3.2</version>
+				<configuration>
+					<source>1.7</source>
+					<target>1.7</target>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+	<profiles>
+		<profile>
+			<id>initdb</id>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.codehaus.mojo</groupId>
+						<artifactId>exec-maven-plugin</artifactId>
+						<version>1.2.1</version>
+						<configuration>
+							<mainClass>eclipselink.example.jpamoxy.roundtrip.InitDB</mainClass>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+		<profile>
+			<id>marshall-xml</id>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.codehaus.mojo</groupId>
+						<artifactId>exec-maven-plugin</artifactId>
+						<version>1.2.1</version>
+						<configuration>
+							<mainClass>eclipselink.example.jpamoxy.roundtrip.Marshall</mainClass>
+							<arguments>
+								<argument>xml</argument>
+							</arguments>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+		<profile>
+			<id>marshall-json</id>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.codehaus.mojo</groupId>
+						<artifactId>exec-maven-plugin</artifactId>
+						<version>1.2.1</version>
+						<configuration>
+							<mainClass>eclipselink.example.jpamoxy.roundtrip.Marshall</mainClass>
+							<arguments>
+								<argument>json</argument>
+							</arguments>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+		<profile>
+			<id>unmarshall-xml</id>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.codehaus.mojo</groupId>
+						<artifactId>exec-maven-plugin</artifactId>
+						<version>1.2.1</version>
+						<configuration>
+							<mainClass>eclipselink.example.jpamoxy.roundtrip.Unmarshall</mainClass>
+							<arguments>
+								<argument>xml</argument>
+							</arguments>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+		<profile>
+			<id>unmarshall-json</id>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.codehaus.mojo</groupId>
+						<artifactId>exec-maven-plugin</artifactId>
+						<version>1.2.1</version>
+						<configuration>
+							<mainClass>eclipselink.example.jpamoxy.roundtrip.Unmarshall</mainClass>
+							<arguments>
+								<argument>json</argument>
+							</arguments>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
+
+</project>
diff --git a/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/InitDB.java b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/InitDB.java
new file mode 100755
index 0000000..3b034a0
--- /dev/null
+++ b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/InitDB.java
@@ -0,0 +1,48 @@
+package eclipselink.example.jpamoxy.roundtrip;

+

+import java.util.HashMap;

+import java.util.Map;

+

+import javax.persistence.EntityManager;

+import javax.persistence.EntityManagerFactory;

+import javax.persistence.Persistence;

+

+import eclipselink.example.jpamoxy.roundtrip.model.Address;

+import eclipselink.example.jpamoxy.roundtrip.model.Customer;

+import eclipselink.example.jpamoxy.roundtrip.model.PhoneNumber;

+

+public class InitDB {

+

+	public static void main(String[] args) {

+		Map<String, Object> properties = new HashMap<String, Object>();

+		properties.put("eclipselink.ddl-generation", "drop-and-create-tables");

+		properties.put("eclipselink.ddl-generation.output-mode", "database");

+		properties.put("eclipselink.logging.level", "FINE");

+		EntityManagerFactory emf = Persistence

+				.createEntityManagerFactory("customer", properties);

+		EntityManager em = emf.createEntityManager();

+		em.getTransaction().begin();

+		Customer customer = new Customer();

+		customer.setId(1);

+		em.persist(customer);

+		customer.setFirstName("Woody");

+		customer.setLastName("Allen");

+		Address address = new Address();

+		address.setCity("New York");

+		address.setStreet("Central Park East");

+		customer.setAddress(address);

+		address.setCustomer(customer);

+		PhoneNumber phone1 = new PhoneNumber();

+		phone1.setType("home");

+		phone1.setNum("512-555-1234");

+		customer.addPhoneNumber(phone1);

+		PhoneNumber phone2 = new PhoneNumber();

+		phone2.setType("mobile");

+		phone2.setNum("512-555-9999");

+		customer.addPhoneNumber(phone2);

+		em.getTransaction().commit();

+		em.close();

+		emf.close();

+	}

+

+}

diff --git a/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/Marshall.java b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/Marshall.java
new file mode 100755
index 0000000..9c4956b
--- /dev/null
+++ b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/Marshall.java
@@ -0,0 +1,43 @@
+package eclipselink.example.jpamoxy.roundtrip;

+

+import java.io.File;

+

+import javax.persistence.EntityManager;

+import javax.persistence.EntityManagerFactory;

+import javax.persistence.Persistence;

+import javax.xml.bind.JAXBContext;

+import javax.xml.bind.JAXBException;

+import javax.xml.bind.Marshaller;

+

+import eclipselink.example.jpamoxy.roundtrip.model.Customer;

+

+

+public class Marshall {

+

+	public static void main(String[] args) throws JAXBException {

+		if (args.length != 1) {

+			System.out.println("Error media type not specified.  Should be either 'json' or 'xml'");

+		}

+		String mediaType = args[0];

+		

+		// JPA Query

+		EntityManagerFactory emf = Persistence

+				.createEntityManagerFactory("customer");

+		EntityManager em = emf.createEntityManager();

+		Customer customer = em.find(Customer.class, 1l);

+		em.close();

+		emf.close();

+

+		// JAXB Marshall

+		JAXBContext context = JAXBContext.newInstance(Customer.class);

+		Marshaller marshaller = context.createMarshaller();

+		marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, new Boolean(true));

+        marshaller.setProperty("eclipselink.media-type", "application/" + mediaType);

+        marshaller.setProperty("eclipselink.json.include-root", false);

+        marshaller.setProperty("eclipselink.json.wrapper-as-array-name", true);

+        File file = new File("target/customer." + mediaType);

+		marshaller.marshal(customer, file);

+

+	}

+

+}

diff --git a/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/Unmarshall.java b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/Unmarshall.java
new file mode 100755
index 0000000..5aba444
--- /dev/null
+++ b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/Unmarshall.java
@@ -0,0 +1,49 @@
+package eclipselink.example.jpamoxy.roundtrip;

+

+import java.io.File;

+

+import javax.persistence.EntityManager;

+import javax.persistence.EntityManagerFactory;

+import javax.persistence.Persistence;

+import javax.xml.bind.JAXBContext;

+import javax.xml.bind.JAXBElement;

+import javax.xml.bind.JAXBException;

+import javax.xml.bind.Unmarshaller;

+import javax.xml.transform.stream.StreamSource;

+

+import eclipselink.example.jpamoxy.roundtrip.model.Customer;

+

+

+public class Unmarshall {

+

+	public static void main(String[] args) throws JAXBException {

+		if (args.length != 1) {

+			System.out.println("Error media type not specified.  Should be either 'json' or 'xml'");

+		}

+		

+		String mediaType = args[0];

+		// JAXB Unmarshall

+		JAXBContext context = JAXBContext.newInstance(Customer.class);

+		Unmarshaller unmarshaller = context.createUnmarshaller();

+        unmarshaller.setProperty("eclipselink.media-type", "application/" + mediaType);

+        unmarshaller.setProperty("eclipselink.json.include-root", false);

+        unmarshaller.setProperty("eclipselink.json.wrapper-as-array-name", true);

+		File file = new File("target/customer." + mediaType);

+        StreamSource source = new StreamSource(file);

+        JAXBElement<Customer> jaxbElement = unmarshaller.unmarshal(source, Customer.class);

+

+		Customer customer = jaxbElement.getValue();

+

+		EntityManagerFactory emf = Persistence

+				.createEntityManagerFactory("customer");

+		EntityManager em = emf.createEntityManager();

+

+		em.getTransaction().begin();

+		em.merge(customer);		

+		em.getTransaction().commit();

+		

+		em.close();

+		emf.close();

+	}

+

+}

diff --git a/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/model/Address.java b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/model/Address.java
new file mode 100755
index 0000000..5343d00
--- /dev/null
+++ b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/model/Address.java
@@ -0,0 +1,67 @@
+package eclipselink.example.jpamoxy.roundtrip.model;
+
+import java.io.Serializable;
+import javax.persistence.*;
+
+import org.eclipse.persistence.oxm.annotations.XmlInverseReference;
+
+
+/**
+ * The persistent class for the ADDRESS database table.
+ * 
+ */
+@Entity
+public class Address implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	@GeneratedValue
+	private long id;
+
+	private String city;
+
+	private String street;
+
+	//bi-directional one-to-one association to Customer
+	@OneToOne
+	@JoinColumn(name="ID")
+	@MapsId
+	@XmlInverseReference(mappedBy="address")
+	private Customer customer;
+
+    public Address() {
+    }
+
+	public long getId() {
+		return this.id;
+	}
+
+	public void setId(long id) {
+		this.id = id;
+	}
+
+	public String getCity() {
+		return this.city;
+	}
+
+	public void setCity(String city) {
+		this.city = city;
+	}
+
+	public String getStreet() {
+		return this.street;
+	}
+
+	public void setStreet(String street) {
+		this.street = street;
+	}
+
+	public Customer getCustomer() {
+		return this.customer;
+	}
+
+	public void setCustomer(Customer customer) {
+		this.customer = customer;
+	}
+	
+}
\ No newline at end of file
diff --git a/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/model/Customer.java b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/model/Customer.java
new file mode 100755
index 0000000..a910ffb
--- /dev/null
+++ b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/model/Customer.java
@@ -0,0 +1,103 @@
+package eclipselink.example.jpamoxy.roundtrip.model;
+
+import static javax.persistence.CascadeType.*;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+
+
+/**
+ * The persistent class for the CUSTOMER database table.
+ * 
+ */
+@Entity
+@NamedQuery(name = "findCustomerByName", 
+        query = "SELECT c " +
+                "FROM Customer c " +
+                "WHERE c.firstName = :firstName AND " +
+                "      c.lastName = :lastName")
+@XmlRootElement
+public class Customer implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	@GeneratedValue
+	private long id;
+
+	@Column(name="FIRST_NAME")
+	private String firstName;
+
+	@Column(name="LAST_NAME")
+	private String lastName;
+
+	//bi-directional one-to-one association to Address
+	@OneToOne(mappedBy="customer", cascade = ALL)
+	private Address address;
+
+	@XmlElementWrapper(name="phone-numbers")
+    @XmlElement(name="phone-number")	
+	//bi-directional many-to-one association to PhoneNumber
+	@OneToMany(mappedBy="customer", cascade = ALL)
+	private Set<PhoneNumber> phoneNumbers = new HashSet<PhoneNumber>();
+
+    public Customer() {
+    }
+
+	public long getId() {
+		return this.id;
+	}
+
+	public void setId(long id) {
+		this.id = id;
+	}
+
+	public String getFirstName() {
+		return this.firstName;
+	}
+
+	public void setFirstName(String firstName) {
+		this.firstName = firstName;
+	}
+
+	public String getLastName() {
+		return this.lastName;
+	}
+
+	public void setLastName(String lastName) {
+		this.lastName = lastName;
+	}
+
+	public Address getAddress() {
+		return this.address;
+	}
+
+	public void setAddress(Address address) {
+		this.address = address;
+	}
+	
+	public Set<PhoneNumber> getPhoneNumbers() {
+		return this.phoneNumbers;
+	}
+
+	public void setPhoneNumbers(Set<PhoneNumber> phoneNumbers) {
+		this.phoneNumbers = phoneNumbers;
+	}
+	
+	public void addPhoneNumber(PhoneNumber phoneNumber) {
+		this.phoneNumbers.add(phoneNumber);
+		phoneNumber.setCustomer(this);
+	}
+}
\ No newline at end of file
diff --git a/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/model/PhoneNumber.java b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/model/PhoneNumber.java
new file mode 100755
index 0000000..0db0bf0
--- /dev/null
+++ b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/model/PhoneNumber.java
@@ -0,0 +1,67 @@
+package eclipselink.example.jpamoxy.roundtrip.model;
+
+import java.io.Serializable;
+import javax.persistence.*;
+
+import org.eclipse.persistence.oxm.annotations.XmlInverseReference;
+
+
+/**
+ * The persistent class for the PHONE_NUMBER database table.
+ * 
+ */
+@Entity
+@Table(name="PHONE_NUMBER")
+public class PhoneNumber implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	@GeneratedValue
+	private long id;
+
+	private String num;
+
+	private String type;
+
+	//bi-directional many-to-one association to Customer
+    @ManyToOne
+	@JoinColumn(name="ID_CUSTOMER")
+	@XmlInverseReference(mappedBy="phoneNumbers")
+	private Customer customer;
+
+    public PhoneNumber() {
+    }
+
+	public long getId() {
+		return this.id;
+	}
+
+	public void setId(long id) {
+		this.id = id;
+	}
+
+	public String getNum() {
+		return this.num;
+	}
+
+	public void setNum(String num) {
+		this.num = num;
+	}
+
+	public String getType() {
+		return this.type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public Customer getCustomer() {
+		return this.customer;
+	}
+
+	public void setCustomer(Customer customer) {
+		this.customer = customer;
+	}
+	
+}
\ No newline at end of file
diff --git a/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/model/jaxb.properties b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/model/jaxb.properties
new file mode 100755
index 0000000..5837a4c
--- /dev/null
+++ b/jpa-moxy/round-trip/src/main/java/eclipselink/example/jpamoxy/roundtrip/model/jaxb.properties
@@ -0,0 +1 @@
+javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
\ No newline at end of file
diff --git a/jpa-moxy/round-trip/src/main/resources/META-INF/persistence.xml b/jpa-moxy/round-trip/src/main/resources/META-INF/persistence.xml
new file mode 100755
index 0000000..6ce230e
--- /dev/null
+++ b/jpa-moxy/round-trip/src/main/resources/META-INF/persistence.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

+	<persistence-unit name="customer" transaction-type="RESOURCE_LOCAL">

+		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

+		<class>eclipselink.example.jpamoxy.roundtrip.model.Address</class>

+		<class>eclipselink.example.jpamoxy.roundtrip.model.Customer</class>

+		<class>eclipselink.example.jpamoxy.roundtrip.model.PhoneNumber</class>

+		<properties>

+			<property name="javax.persistence.jdbc.url" value="jdbc:derby:target/derby/test;create=true" />

+			<property name="javax.persistence.jdbc.user" value="app" />

+			<property name="javax.persistence.jdbc.password" value="app" />

+			<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver" />

+			<property name="eclipselink.jdbc.read-connections.min" value="1"/>

+			<property name="eclipselink.jdbc.write-connections.min" value="1"/>

+			<property name="eclipselink.logging.thread" value="false"/>

+			<property name="eclipselink.logging.timestamp" value="false"/>

+			<property name="eclipselink.logging.session" value="false"/>

+			<property name="eclipselink.logging.exceptions" value="false"/>

+			<property name="eclipselink.logging.connection" value="false"/>

+			<property name="eclipselink.logging.level" value="FINE"/>

+		</properties>

+	</persistence-unit>

+</persistence>

diff --git a/jpa/polyglot/client/.classpath b/jpa/polyglot/client/.classpath
index e43402f..2dd4731 100644
--- a/jpa/polyglot/client/.classpath
+++ b/jpa/polyglot/client/.classpath
@@ -6,22 +6,6 @@
 			<attribute name="maven.pomderived" value="true"/>
 		</attributes>
 	</classpathentry>
-	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
-		<attributes>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
-		<attributes>
-			<attribute name="optional" value="true"/>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
-		<attributes>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
 		<attributes>
 			<attribute name="maven.pomderived" value="true"/>
diff --git a/jpa/polyglot/composite-pu/.classpath b/jpa/polyglot/composite-pu/.classpath
index e43402f..5d012a0 100644
--- a/jpa/polyglot/composite-pu/.classpath
+++ b/jpa/polyglot/composite-pu/.classpath
@@ -1,27 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="src" output="target/classes" path="src/main/java">
-		<attributes>
-			<attribute name="optional" value="true"/>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
 	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
 		<attributes>
 			<attribute name="maven.pomderived" value="true"/>
 		</attributes>
 	</classpathentry>
-	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
-		<attributes>
-			<attribute name="optional" value="true"/>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
-		<attributes>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
 		<attributes>
 			<attribute name="maven.pomderived" value="true"/>
diff --git a/jpa/polyglot/nosql-pu/pom.xml b/jpa/polyglot/nosql-pu/pom.xml
index e5de559..f2b61d4 100644
--- a/jpa/polyglot/nosql-pu/pom.xml
+++ b/jpa/polyglot/nosql-pu/pom.xml
@@ -32,8 +32,8 @@
 		</dependency>
 		<dependency>
 			<groupId>javax.resource</groupId>
-			<artifactId>connector</artifactId>
-			<version>1.0</version>
+			<artifactId>connector-api</artifactId>
+			<version>1.5</version>
 		</dependency>
 	</dependencies>
 </project>
\ No newline at end of file