Removed old incubators not being actively worked on
Put 2010 summit files in zip archive for now
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5d5ad74
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+
+/JPA-RS/org.eclipse.persistence.jpars/classes
+/JPA-RS/org.eclipse.persistence.jpars.test/classes
\ No newline at end of file
diff --git a/das/trunk/eclipselink.sdo.test.das/.classpath b/das/trunk/eclipselink.sdo.test.das/.classpath
deleted file mode 100644
index 6d0263e..0000000
--- a/das/trunk/eclipselink.sdo.test.das/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry excluding="**/.svn/**" kind="src" path="src"/>
- <classpathentry kind="src" path="resource"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.sdo.das"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
- <classpathentry combineaccessrules="false" kind="src" path="/commonj.sdo 2.1.0"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.jpa"/>
- <classpathentry combineaccessrules="false" kind="src" path="/eclipselink.sdo.test"/>
- <classpathentry combineaccessrules="false" kind="src" path="/eclipselink.moxy.test"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/das/trunk/eclipselink.sdo.test.das/.project b/das/trunk/eclipselink.sdo.test.das/.project
deleted file mode 100644
index 21e6e28..0000000
--- a/das/trunk/eclipselink.sdo.test.das/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>eclipselink.sdo.test.das</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/.classpath b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/.classpath
deleted file mode 100644
index 68c2296..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry excluding="**/.svn/**" kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry combineaccessrules="false" kind="src" path="/javax.persistence 1.99"/>
- <classpathentry combineaccessrules="false" kind="src" path="/commonj.sdo 2.1.0"/>
- <classpathentry kind="lib" path="/org.eclipse.persistence.sdo.das/eclipselink-das.jar" sourcepath="/org.eclipse.persistence.sdo.das/eclipselink-das-src.zip"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/.project b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/.project
deleted file mode 100644
index 2c85d19..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.persistence.example.sdo.das.customer</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/data/samples/customer-1.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/data/samples/customer-1.xml
deleted file mode 100644
index aafcd3e..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/data/samples/customer-1.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<tns:ROOT xsi:type="tns:customer" id="1" xmlns:tns="urn:customer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <tns:first-name>Jane</tns:first-name>
- <tns:last-name>Doe</tns:last-name>
- <tns:billing-address id="1">
- <tns:street>1229111021156 Any Street</tns:street>
- <tns:city>Ottawa</tns:city>
- <tns:province>ON</tns:province>
- <tns:postal-code>A1B2C3</tns:postal-code>
- </tns:billing-address>
- <tns:shipping-address id="2">
- <tns:street>456 Another Road</tns:street>
- <tns:city>Nepean</tns:city>
- <tns:province>ON</tns:province>
- <tns:postal-code>A2B4C6</tns:postal-code>
- </tns:shipping-address>
- <tns:phone-number id="1">
- <tns:type>work</tns:type>
- <tns:number>613-555-WORK</tns:number>
- </tns:phone-number>
- <tns:phone-number id="2">
- <tns:type>home</tns:type>
- <tns:number>613-555-HOME</tns:number>
- </tns:phone-number>
- <tns:spouse>
- <tns:first-name>Jane</tns:first-name>
- <tns:last-name>Doe</tns:last-name>
- <tns:mailing-address>1</tns:mailing-address>
- </tns:spouse>
-</tns:ROOT>
\ No newline at end of file
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/MANIFEST.MF b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/MANIFEST.MF
deleted file mode 100644
index 5e94951..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path:
-
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/customer-oxm.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/customer-oxm.xml
deleted file mode 100644
index cfb4fa6..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/customer-oxm.xml
+++ /dev/null
@@ -1,209 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<object-persistence version="Eclipse Persistence Services - 1.0.1 (Build 20080905)" 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>MeetInTheMiddle</name>
- <class-mapping-descriptors>
- <class-mapping-descriptor xsi:type="xml-class-mapping-descriptor">
- <class>com.example.customer.Address</class>
- <alias>Address</alias>
- <primary-key>
- <field name="@id" xsi:type="node"/>
- </primary-key>
- <events xsi:type="event-policy"/>
- <querying xsi:type="query-policy"/>
- <attribute-mappings>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>id</attribute-name>
- <field name="@id" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>street</attribute-name>
- <field name="tns:street/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>city</attribute-name>
- <field name="tns:city/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>province</attribute-name>
- <field name="tns:province/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>postalCode</attribute-name>
- <field name="tns:postal-code/text()" xsi:type="node"/>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>aggregate</descriptor-type>
- <instantiation/>
- <copying xsi:type="instantiation-copy-policy"/>
- <namespace-resolver>
- <namespaces>
- <namespace>
- <prefix>tns</prefix>
- <namespace-uri>urn:customer</namespace-uri>
- </namespace>
- </namespaces>
- </namespace-resolver>
- <schema xsi:type="schema-file-reference">
- <resource>..\src\xsd\jpadas-customer.xsd</resource>
- <schema-context>/tns:address</schema-context>
- <node-type>complex-type</node-type>
- </schema>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="xml-class-mapping-descriptor">
- <class>com.example.customer.Customer</class>
- <alias>Customer</alias>
- <events xsi:type="event-policy"/>
- <querying xsi:type="query-policy"/>
- <attribute-mappings>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>id</attribute-name>
- <field name="@id" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>firstName</attribute-name>
- <field name="tns:first-name/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>lastName</attribute-name>
- <field name="tns:last-name/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-composite-object-mapping">
- <attribute-name>billingAddress</attribute-name>
- <reference-class>com.example.customer.Address</reference-class>
- <field name="tns:billing-address" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-composite-object-mapping">
- <attribute-name>shippingAddress</attribute-name>
- <reference-class>com.example.customer.Address</reference-class>
- <field name="tns:shipping-address" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-composite-collection-mapping">
- <attribute-name>phoneNumbers</attribute-name>
- <reference-class>com.example.customer.PhoneNumber</reference-class>
- <field name="tns:phone-number" xsi:type="node"/>
- <container xsi:type="container-policy">
- <collection-type>java.util.HashSet</collection-type>
- </container>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-composite-object-mapping">
- <attribute-name>spouse</attribute-name>
- <reference-class>com.example.customer.Spouse</reference-class>
- <field name="tns:spouse" xsi:type="node"/>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>aggregate</descriptor-type>
- <amendment>
- <amendment-class>com.example.customer.eclipselink.DescriptorAfterLoads</amendment-class>
- <amendment-method>amendCustomerDescriptor</amendment-method>
- </amendment>
- <instantiation/>
- <copying xsi:type="instantiation-copy-policy"/>
- <namespace-resolver>
- <namespaces>
- <namespace>
- <prefix>tns</prefix>
- <namespace-uri>urn:customer</namespace-uri>
- </namespace>
- </namespaces>
- </namespace-resolver>
- <schema xsi:type="schema-file-reference">
- <resource>..\src\xsd\jpadas-customer.xsd</resource>
- <schema-context>/tns:customer</schema-context>
- <node-type>complex-type</node-type>
- </schema>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="xml-class-mapping-descriptor">
- <class>com.example.customer.PhoneNumber</class>
- <alias>PhoneNumber</alias>
- <primary-key>
- <field name="@id" xsi:type="node"/>
- </primary-key>
- <events xsi:type="event-policy"/>
- <querying xsi:type="query-policy"/>
- <attribute-mappings>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>id</attribute-name>
- <field name="@id" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>type</attribute-name>
- <field name="tns:type/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>number</attribute-name>
- <field name="tns:number/text()" xsi:type="node"/>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>aggregate</descriptor-type>
- <instantiation/>
- <copying xsi:type="instantiation-copy-policy"/>
- <namespace-resolver>
- <namespaces>
- <namespace>
- <prefix>tns</prefix>
- <namespace-uri>urn:customer</namespace-uri>
- </namespace>
- </namespaces>
- </namespace-resolver>
- <schema xsi:type="schema-file-reference">
- <resource>..\src\xsd\jpadas-customer.xsd</resource>
- <schema-context>/tns:phone-number</schema-context>
- <node-type>complex-type</node-type>
- </schema>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="xml-class-mapping-descriptor">
- <class>com.example.customer.Spouse</class>
- <alias>Spouse</alias>
- <events xsi:type="event-policy"/>
- <querying xsi:type="query-policy"/>
- <attribute-mappings>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>id</attribute-name>
- <field name="@id" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>firstName</attribute-name>
- <field name="tns:first-name/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>lastName</attribute-name>
- <field name="tns:last-name/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-object-reference-mapping">
- <attribute-name>address</attribute-name>
- <reference-class>com.example.customer.Address</reference-class>
- <source-to-target-key-field-association>
- <field-reference>
- <source-field name="tns:mailing-address/text()" xsi:type="node"/>
- <target-field name="@id" xsi:type="node"/>
- </field-reference>
- </source-to-target-key-field-association>
- <source-to-target-key-fields>
- <field name="tns:mailing-address/text()" xsi:type="node"/>
- </source-to-target-key-fields>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>aggregate</descriptor-type>
- <instantiation/>
- <copying xsi:type="instantiation-copy-policy"/>
- <namespace-resolver>
- <namespaces>
- <namespace>
- <prefix>tns</prefix>
- <namespace-uri>urn:customer</namespace-uri>
- </namespace>
- </namespaces>
- </namespace-resolver>
- <schema xsi:type="schema-file-reference">
- <resource>..\src\xsd\jpadas-customer.xsd</resource>
- <schema-context>/tns:spouse</schema-context>
- <node-type>complex-type</node-type>
- </schema>
- </class-mapping-descriptor>
- </class-mapping-descriptors>
- <login xsi:type="xml-login">
- <platform-class>org.eclipse.persistence.oxm.platform.SAXPlatform</platform-class>
- <user-name></user-name>
- <password></password>
- </login>
-</object-persistence>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/orm.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/orm.xml
deleted file mode 100644
index d760a7d..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/orm.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0">
-</entity-mappings>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/persistence.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/persistence.xml
deleted file mode 100644
index 4a9c61c..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/persistence.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence version="1.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_1_0.xsd">
- <persistence-unit name="MeetInTheMiddle" transaction-type="RESOURCE_LOCAL">
- <class>
- com.example.customer.Address</class>
- <class>
- com.example.customer.Customer</class>
- <class>
- com.example.customer.PhoneNumber</class>
- <class>
- com.example.customer.Spouse</class>
- <properties>
- <property name="eclipselink.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
- <property name="eclipselink.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:xe"/>
- <property name="eclipselink.jdbc.user" value="system"/>
- <property name="eclipselink.jdbc.password" value="password"/>
- <property name="eclipselink.logging.level" value="FINEST"/>
- </properties>
- </persistence-unit>
-</persistence>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/sessions.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/sessions.xml
deleted file mode 100644
index ad10986..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/META-INF/sessions.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<sessions version="1.0.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <session xsi:type="database-session">
- <name>com.example.customer</name>
- <event-listener-classes/>
- <logging xsi:type="eclipselink-log"/>
- <primary-project xsi:type="xml">customer-oxm.xml</primary-project>
- <login xsi:type="xml-login"/>
- </session>
-</sessions>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/Address.java b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/Address.java
deleted file mode 100644
index 883acfd..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/Address.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * bdoughan - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package com.example.customer;
-
-import javax.persistence.*;
-
-@Entity
-public class Address {
-
- @Id
- private int id;
-
- private String street;
- private String city;
- private String province;
- private String postalCode;
-
- @Transient
- private Customer customer;
-
- public Address() {
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getStreet() {
- return street;
- }
-
- public void setStreet(String street) {
- this.street = street;
- }
-
- public String getCity() {
- return city;
- }
-
- public void setCity(String city) {
- this.city = city;
- }
-
- public String getProvince() {
- return province;
- }
-
- public void setProvince(String province) {
- this.province = province;
- }
-
- public String getPostalCode() {
- return postalCode;
- }
-
- public void setPostalCode(String postalCode) {
- this.postalCode = postalCode;
- }
-
- public Customer getCustomer() {
- return customer;
- }
-
- public void setCustomer(Customer customer) {
- this.customer = customer;
- }
-
-}
\ No newline at end of file
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/Customer.java b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/Customer.java
deleted file mode 100644
index 7ce2844..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/Customer.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * bdoughan - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package com.example.customer;
-
-import java.util.HashSet;
-import java.util.Set;
-import javax.persistence.*;
-
-import static javax.persistence.CascadeType.ALL;
-
-@Entity
-public class Customer {
-
- @Id
- private int id;
-
- private String firstName;
- private String lastName;
-
- @ManyToOne(cascade=ALL)
- private Address billingAddress;
-
- @ManyToOne(cascade=ALL)
- private Address shippingAddress;
-
- @OneToMany(targetEntity=PhoneNumber.class, mappedBy="customer", cascade = ALL)
- private Set<PhoneNumber> phoneNumbers;
-
- @OneToOne
- private Spouse spouse;
-
- public Customer() {
- phoneNumbers = new HashSet<PhoneNumber>();
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
-
- public Address getBillingAddress() {
- return billingAddress;
- }
-
- public void setBillingAddress(Address billingAddress) {
- this.billingAddress = billingAddress;
- }
-
- public Address getShippingAddress() {
- return shippingAddress;
- }
-
- public void setShippingAddress(Address shippingAddress) {
- this.shippingAddress = shippingAddress;
- }
-
- public Set<PhoneNumber> getPhoneNumbers() {
- return phoneNumbers;
- }
-
- public void setPhoneNumbers(Set<PhoneNumber> phoneNumbers) {
- this.phoneNumbers = phoneNumbers;
- }
-
- public Spouse getSpouse() {
- return spouse;
- }
-
- public void setSpouse(Spouse spouse) {
- this.spouse = spouse;
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/PhoneNumber.java b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/PhoneNumber.java
deleted file mode 100644
index c341042..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/PhoneNumber.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * bdoughan - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package com.example.customer;
-
-import javax.persistence.*;
-import static javax.persistence.CascadeType.ALL;
-
-@Entity
-public class PhoneNumber {
-
- @Id
- private int id;
-
- private String type;
-
- @Column(name="num")
- private String number;
-
- @ManyToOne(cascade=ALL)
- private Customer customer;
-
- public PhoneNumber() {
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getNumber() {
- return number;
- }
-
- public void setNumber(String number) {
- this.number = number;
- }
-
- public Customer getCustomer() {
- return customer;
- }
-
- public void setCustomer(Customer customer) {
- this.customer = customer;
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/Spouse.java b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/Spouse.java
deleted file mode 100644
index 020dacc..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/Spouse.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * bdoughan - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package com.example.customer;
-
-import static javax.persistence.CascadeType.ALL;
-
-import java.util.List;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-
-@Entity
-public class Spouse {
-
- @Id
- private int id;
-
- private String firstName;
- private String lastName;
-
- @ManyToOne(cascade=ALL)
- private Address address;
-
- private List<PhoneNumber> phoneNumbers;
-
- public Spouse() {
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
-
- public Address getAddress() {
- return address;
- }
-
- public void setAddress(Address address) {
- this.address = address;
- }
-
-}
\ No newline at end of file
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/eclipselink/DescriptorAfterLoads.java b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/eclipselink/DescriptorAfterLoads.java
deleted file mode 100644
index 9dfcd6c..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/eclipselink/DescriptorAfterLoads.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * bdoughan - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package com.example.customer.eclipselink;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.internal.descriptors.InstanceVariableAttributeAccessor;
-import org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping;
-import org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping;
-
-
-/**
- * This class contains the after load methods referred to by the descriptors.
- * After load methods are required to specify settings that are not available
- * in the EclipseLink Workbench.
- */
-public class DescriptorAfterLoads {
-
- public static void amendCustomerDescriptor(ClassDescriptor descriptor) {
- XMLCompositeCollectionMapping phoneNumbersMapping = (XMLCompositeCollectionMapping) descriptor.getMappingForAttributeName("phoneNumbers");
- InstanceVariableAttributeAccessor containerAccessor = new InstanceVariableAttributeAccessor();
- containerAccessor.setAttributeName("customer");
- phoneNumbersMapping.setContainerAccessor(containerAccessor);
-
- XMLCompositeObjectMapping billingAddressMapping = (XMLCompositeObjectMapping) descriptor.getMappingForAttributeName("billingAddress");
- InstanceVariableAttributeAccessor containerAccessor3 = new InstanceVariableAttributeAccessor();
- containerAccessor3.setAttributeName("customer");
- billingAddressMapping.setContainerAccessor(containerAccessor3);
-
- XMLCompositeObjectMapping shippingAddressMapping = (XMLCompositeObjectMapping) descriptor.getMappingForAttributeName("shippingAddress");
- InstanceVariableAttributeAccessor containerAccessor2 = new InstanceVariableAttributeAccessor();
- containerAccessor2.setAttributeName("customer");
- shippingAddressMapping.setContainerAccessor(containerAccessor2);
-
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/jaxb.properties b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/jaxb.properties
deleted file mode 100644
index 5837a4c..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/com/example/customer/jaxb.properties
+++ /dev/null
@@ -1 +0,0 @@
-javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
\ No newline at end of file
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/demo/JAXBDemo.java b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/demo/JAXBDemo.java
deleted file mode 100644
index ad91f3e..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/demo/JAXBDemo.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * bdoughan - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package demo;
-
-import java.io.FileInputStream;
-import java.util.Date;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import javax.xml.bind.JAXBContext;
-import org.eclipse.persistence.sdo.helper.jaxb.JAXBHelperContext;
-import com.example.customer.Customer;
-
-import commonj.sdo.DataObject;
-
-public class JAXBDemo {
-
- public static void main(String[] args) throws Exception {
-
- /*
- * Step #1
- * Create the JPA EntityManager
- */
- EntityManagerFactory emf =
- Persistence.createEntityManagerFactory("MeetInTheMiddle");
- EntityManager em = emf.createEntityManager();
-
- /*
- * Step #2
- * Create the JAXBContext
- */
- JAXBContext jaxbContext = JAXBContext.newInstance("com.example.customer");
-
- /*
- * Step #3
- * Create the JAXB aware SDO Helper Context
- */
- JAXBHelperContext jaxbHelperContext = new JAXBHelperContext(jaxbContext);
-
- /*
- * Step #4
- * Define the SDO metadata from an XML Schema
- */
- FileInputStream xsd = new FileInputStream("xsd/jpadas-customer.xsd");
- jaxbHelperContext.getXSDHelper().define(xsd, null);
-
- /*
- * Step #5
- * Query the entities from the database using JPA APIs.
- */
- Customer customer =
- (Customer) em.createQuery("select c from Customer c where c.id = 1").getSingleResult();
-
- /*
- * Step #6
- * Wrap the JPA entity in a SDO data object.
- */
- DataObject customerDO = jaxbHelperContext.wrap(customer);
-
- /*
- * Step #7
- * Interact with the SDO data object.
- */
- System.out.println(customerDO.getString("billing-address/street"));
- customerDO.set("billing-address/street", new Date().getTime() + " Any Street");
- String xml = jaxbHelperContext.getXMLHelper().save(customerDO, "http://www.example.com/customer", "ROOT");
- System.out.println(xml);
-
- /*
- * Step #8 (Optional)
- * If necessary, unwrap the SDO data object to get the JPA entity.
- * Since the data object never left the VM it is still wrapping the
- * original entity.
- */
- System.out.println(customer == jaxbHelperContext.unwrap(customerDO));
-
- /*
- * Step #9
- * Commit the JPA entity to the database.
- */
- em.getTransaction().begin();
- em.persist(jaxbHelperContext.unwrap(customerDO));
- em.getTransaction().commit();
-
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/demo/JAXBDemo2.java b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/demo/JAXBDemo2.java
deleted file mode 100644
index 2d25322..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/demo/JAXBDemo2.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * bdoughan - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package demo;
-
-import java.io.FileInputStream;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import javax.xml.bind.JAXBContext;
-
-import org.eclipse.persistence.sdo.helper.jaxb.JAXBHelperContext;
-
-
-import com.example.customer.Customer;
-import commonj.sdo.DataObject;
-
-public class JAXBDemo2 {
-
- public static void main(String[] args) throws Exception {
-
- /*
- * Step #1
- * Create the JAXBContext
- */
- JAXBContext jaxbContext = JAXBContext.newInstance("com.example.customer");
-
- /*
- *Step #2
- * Create the JAXB aware SDO Helper Context
- */
- JAXBHelperContext jaxbHelperContext = new JAXBHelperContext(jaxbContext);
-
- /*
- * Step #3
- * Define the SDO metadata from an XML Schema
- */
- FileInputStream xsd = new FileInputStream("xsd/jpadas-customer.xsd");
- jaxbHelperContext.getXSDHelper().define(xsd, null);
-
- /*
- * Step #4
- * Create new DataObjects
- */
- DataObject customerDO = jaxbHelperContext.getDataFactory().create("urn:customer", "customer");
- customerDO.set("first-name", "Jane");
- Customer customer = (Customer) jaxbHelperContext.unwrap(customerDO);
- System.out.println(customer.getFirstName());
-
- DataObject billingAddressDO = customerDO.createDataObject("billing-address");
- billingAddressDO.set("street", "123 Any Street");
- System.out.println(customer.getBillingAddress().getStreet());
-
- DataObject phoneNumberDO = jaxbHelperContext.getDataFactory().create("urn:customer", "phone-number");
- customerDO.getList("phone-number").add(phoneNumberDO);
-
- customerDO.unset("billing-address");
- customerDO.unset("phone-number");
- }
-
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/demo/JAXBDemo3.java b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/demo/JAXBDemo3.java
deleted file mode 100644
index 2d1b81c..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/demo/JAXBDemo3.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * bdoughan - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package demo;
-
-import java.io.FileInputStream;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import javax.xml.bind.JAXBContext;
-
-import org.eclipse.persistence.sdo.helper.jaxb.JAXBHelperContext;
-
-import commonj.sdo.helper.XMLDocument;
-
-public class JAXBDemo3 {
-
- public static void main(String[] args) throws Exception {
-
- /*
- * Step #1
- * Create the JAXBContext
- */
- JAXBContext jaxbContext = JAXBContext.newInstance("com.example.customer");
-
- /*
- * Step #2
- * Create the JPA aware SDO Helper Context
- */
- JAXBHelperContext jaxbHelperContext = new JAXBHelperContext(jaxbContext);
-
-
- /*
- * Step #3
- * Define the SDO metadata from an XML Schema
- */
- FileInputStream xsd = new FileInputStream("xsd/jpadas-customer.xsd");
- jaxbHelperContext.getXSDHelper().define(xsd, null);
-
- /*
- * Step #4
- * Unmarshal the XML document to DataObjects
- */
- FileInputStream xml = new FileInputStream("customer-1.xml");
- XMLDocument xmlDocument = jaxbHelperContext.getXMLHelper().load(xml);
-
- /*
- * Step #5
- * Marshal the DataObjects to XML
- */
- jaxbHelperContext.getXMLHelper().save(xmlDocument, System.out, null);
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/demo/JAXBDemo4.java b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/demo/JAXBDemo4.java
deleted file mode 100644
index 2204a94..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/demo/JAXBDemo4.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * bdoughan - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package demo;
-
-import java.io.FileInputStream;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import javax.xml.bind.JAXBContext;
-
-import org.eclipse.persistence.sdo.helper.jaxb.JAXBHelperContext;
-
-import com.example.customer.Customer;
-import commonj.sdo.DataObject;
-
-public class JAXBDemo4 {
-
- public static void main(String[] args) throws Exception {
- /*
- * Step #1
- * Create the JPA EntityManager
- */
- EntityManagerFactory emf =
- Persistence.createEntityManagerFactory("MeetInTheMiddle");
- EntityManager em = emf.createEntityManager();
-
- /*
- * Step #2
- * Create the JAXBContext
- */
- JAXBContext jaxbContext = JAXBContext.newInstance("com.example.customer");
-
- /*
- * Step #3
- * Create the JAXB aware SDO Helper Context
- */
- JAXBHelperContext jaxbHelperContext = new JAXBHelperContext(jaxbContext);
-
- /*
- * Step #4
- * Define the SDO metadata from an XML Schema
- */
- FileInputStream xsd = new FileInputStream("Customer-XML.xsd");
- jaxbHelperContext.getXSDHelper().define(xsd, null);
-
- /*
- * Step #5
- * Query the entities from the database using JPA APIs.
- */
- Customer customer =
- (Customer) em.createQuery("select c from Customer c where c.id = 1").getSingleResult();
-
- /*
- * Step #6
- * Wrap the JPA entity in a SDO data object.
- */
- DataObject customerDO = jaxbHelperContext.wrap(customer);
-
- System.out.println(customer.getPhoneNumbers().size());
-
- DataObject phoneNumberDO = jaxbHelperContext.getDataFactory().create("urn:customer", "phone-number");
- customerDO.getList("phone-number").add(phoneNumberDO);
-
- System.out.println(customer.getPhoneNumbers().size());
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/xsd/jpadas-customer.xsd b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/xsd/jpadas-customer.xsd
deleted file mode 100644
index 6f29065..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/src/xsd/jpadas-customer.xsd
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * bdoughan - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
--->
-<xs:schema elementFormDefault="qualified" version="1.0"
- targetNamespace="urn:customer" xmlns:tns="urn:customer"
- xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sdo="commonj.sdo/xml">
- <xs:import namespace="commonj.sdo/xml" />
- <xs:complexType name="address">
- <xs:sequence>
- <xs:element name="street" type="xs:ID" minOccurs="0" />
- <xs:element name="city" type="xs:string" minOccurs="0" />
- <xs:element name="province" type="xs:string" minOccurs="0" />
- <xs:element name="postal-code" type="xs:string" minOccurs="0" />
- </xs:sequence>
- <xs:attribute name="id" type="xs:ID" use="required" />
- </xs:complexType>
- <xs:complexType name="customer">
- <xs:sequence>
- <xs:element name="first-name" type="xs:string" minOccurs="0" />
- <xs:element name="last-name" type="xs:string" minOccurs="0" />
- <xs:element name="billing-address" type="tns:address"
- minOccurs="0" />
- <xs:element name="shipping-address" type="tns:address"
- minOccurs="0" />
- <xs:element name="phone-number" type="tns:phone-number"
- nillable="true" minOccurs="0" maxOccurs="unbounded" />
- <xs:element name="spouse" type="tns:spouse" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="id" type="xs:int" use="required" />
- </xs:complexType>
- <xs:complexType name="phone-number">
- <xs:sequence>
- <xs:element name="type" type="xs:string" minOccurs="0" />
- <xs:element name="number" type="xs:string" minOccurs="0" />
- </xs:sequence>
- <xs:attribute name="id" type="xs:ID" use="required" />
- </xs:complexType>
- <xs:complexType name="spouse">
- <xs:sequence>
- <xs:element name="first-name" type="xs:string" minOccurs="0" />
- <xs:element name="last-name" type="xs:string" minOccurs="0" />
- <xs:element name="mailing-address" type="xs:IDREF" minOccurs="0"
- sdo:propertyType="tns:address" />
- <!-- xs:element name="phone-number" type="xs:IDREF" minOccurs="0"
- sdo:propertyType="tns:phone-number" maxOccurs="unbounded" /-->
- </xs:sequence>
- <xs:attribute name="id" type="xs:int" use="required" />
- </xs:complexType>
-</xs:schema>
\ No newline at end of file
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/MeetInTheMiddle.mwp b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/MeetInTheMiddle.mwp
deleted file mode 100644
index aa23ccb..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/MeetInTheMiddle.mwp
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project type="o-x">
- <name>MeetInTheMiddle</name>
- <product-version>1.0</product-version>
- <schema-version>7.0</schema-version>
- <class-repository>
- <classpath-entries>
- <entry>../build/classes</entry>
- </classpath-entries>
- <user-type-names>
- <name>com.example.customer.Address</name>
- <name>com.example.customer.Customer</name>
- <name>com.example.customer.eclipselink.DescriptorAfterLoads</name>
- <name>com.example.customer.package-info</name>
- <name>com.example.customer.PhoneNumber</name>
- <name>com.example.customer.Spouse</name>
- </user-type-names>
- </class-repository>
- <descriptor-names>
- <descriptor-name>com.example.customer.Address</descriptor-name>
- <descriptor-name>com.example.customer.Customer</descriptor-name>
- <descriptor-name>com.example.customer.PhoneNumber</descriptor-name>
- <descriptor-name>com.example.customer.Spouse</descriptor-name>
- </descriptor-names>
- <defaults-policy type="o-x">
- <use-method-accessing>false</use-method-accessing>
- </defaults-policy>
- <deployment-xml-file>../src/META-INF/customer-oxm.xml</deployment-xml-file>
- <xml-schema-repository>
- <schema-names>
- <name>Customer-XML</name>
- </schema-names>
- </xml-schema-repository>
-</project>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.Address.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.Address.xml
deleted file mode 100644
index e1b8315..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.Address.xml
+++ /dev/null
@@ -1,198 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>com.example.customer.Address</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <last-refresh-timestamp>2008-12-18T11:34:59.843</last-refresh-timestamp>
- <attributes>
- <class-attribute>
- <name>city</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>id</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>postalCode</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>province</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>street</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>Address</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- <method>
- <name>getCity</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getPostalCode</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getProvince</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getStreet</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>setCity</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setPostalCode</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setProvince</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setStreet</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- </methods>
-</class>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.Customer.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.Customer.xml
deleted file mode 100644
index 24780b5..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.Customer.xml
+++ /dev/null
@@ -1,270 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>com.example.customer.Customer</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <last-refresh-timestamp>2008-12-18T11:34:59.843</last-refresh-timestamp>
- <attributes>
- <class-attribute>
- <name>billingAddress</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>com.example.customer.Address</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>firstName</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>id</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>lastName</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>phoneNumbers</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.util.Set</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>shippingAddress</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>com.example.customer.Address</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>spouse</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>com.example.customer.Spouse</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>Customer</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- <method>
- <name>getBillingAddress</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>com.example.customer.Address</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getFirstName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getLastName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getPhoneNumbers</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.util.Set</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getShippingAddress</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>com.example.customer.Address</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getSpouse</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>com.example.customer.Spouse</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>setBillingAddress</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>com.example.customer.Address</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setFirstName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setLastName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setPhoneNumbers</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.util.Set</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setShippingAddress</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>com.example.customer.Address</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setSpouse</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>com.example.customer.Spouse</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- </methods>
-</class>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.PhoneNumber.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.PhoneNumber.xml
deleted file mode 100644
index 9423584..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.PhoneNumber.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>com.example.customer.PhoneNumber</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <last-refresh-timestamp>2008-12-18T11:34:59.843</last-refresh-timestamp>
- <attributes>
- <class-attribute>
- <name>customer</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>com.example.customer.Customer</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>id</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>number</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>type</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>PhoneNumber</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- <method>
- <name>getCustomer</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>com.example.customer.Customer</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getNumber</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getType</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>setCustomer</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>com.example.customer.Customer</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setNumber</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setType</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- </methods>
-</class>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.Spouse.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.Spouse.xml
deleted file mode 100644
index f14d721..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.Spouse.xml
+++ /dev/null
@@ -1,171 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>com.example.customer.Spouse</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <last-refresh-timestamp>2008-12-18T11:34:59.843</last-refresh-timestamp>
- <attributes>
- <class-attribute>
- <name>address</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>com.example.customer.Address</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>firstName</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>id</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>lastName</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>phoneNumbers</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.util.List</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>Spouse</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- <method>
- <name>getAddress</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>com.example.customer.Address</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getFirstName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getLastName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>setAddress</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>com.example.customer.Address</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setFirstName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setLastName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- </methods>
-</class>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.eclipselink.DescriptorAfterLoads.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.eclipselink.DescriptorAfterLoads.xml
deleted file mode 100644
index 961a022..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.eclipselink.DescriptorAfterLoads.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>com.example.customer.eclipselink.DescriptorAfterLoads</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <last-refresh-timestamp>2008-12-18T11:35:22.578</last-refresh-timestamp>
- <methods>
- <method>
- <name>DescriptorAfterLoads</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- <method>
- <name>amendCustomerDescriptor</name>
- <modifier>9</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>org.eclipse.persistence.descriptors.ClassDescriptor</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- </methods>
-</class>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.package-info.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.package-info.xml
deleted file mode 100644
index 1490bd2..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/classes/com.example.customer.package-info.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>com.example.customer.package-info</name>
- <is-interface>true</is-interface>
- <modifier>1024</modifier>
- <last-refresh-timestamp>2008-12-15T19:59:40.5</last-refresh-timestamp>
-</class>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/descriptors/com.example.customer.Address.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/descriptors/com.example.customer.Address.xml
deleted file mode 100644
index bba7992..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/descriptors/com.example.customer.Address.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<descriptor type="o-x">
- <name>com.example.customer.Address</name>
- <class-handle>
- <type-name>com.example.customer.Address</type-name>
- </class-handle>
- <transactional-policy type="ox">
- <descriptor-alias>Address</descriptor-alias>
- <refresh-cache-policy/>
- <caching-policy/>
- <query-manager type="ox"/>
- <locking-policy type="ox"/>
- <primary-key-policy>
- <primary-keys>
- <xml-field>@id</xml-field>
- </primary-keys>
- </primary-key-policy>
- </transactional-policy>
- <mappings>
- <mapping type="xml-direct">
- <name>city</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Address</attribute-declaring-type-name>
- <attribute-name>city</attribute-name>
- </attribute-handle>
- <xml-field>tns:city/text()</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>id</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Address</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </attribute-handle>
- <xml-field>@id</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>postalCode</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Address</attribute-declaring-type-name>
- <attribute-name>postalCode</attribute-name>
- </attribute-handle>
- <xml-field>tns:postal-code/text()</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>province</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Address</attribute-declaring-type-name>
- <attribute-name>province</attribute-name>
- </attribute-handle>
- <xml-field>tns:province/text()</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>street</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Address</attribute-declaring-type-name>
- <attribute-name>street</attribute-name>
- </attribute-handle>
- <xml-field>tns:street/text()</xml-field>
- </mapping>
- </mappings>
- <schema-context-handle>
- <schema>Customer-XML</schema>
- <qname-path>
- <qname component-type="complex-type" namespace-uri="urn:customer" local-name="address"/>
- </qname-path>
- </schema-context-handle>
- <root-descriptor>false</root-descriptor>
-</descriptor>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/descriptors/com.example.customer.Customer.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/descriptors/com.example.customer.Customer.xml
deleted file mode 100644
index 5dd8f2b..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/descriptors/com.example.customer.Customer.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<descriptor type="o-x">
- <name>com.example.customer.Customer</name>
- <class-handle>
- <type-name>com.example.customer.Customer</type-name>
- </class-handle>
- <transactional-policy type="ox">
- <descriptor-alias>Customer</descriptor-alias>
- <refresh-cache-policy/>
- <caching-policy/>
- <query-manager type="ox"/>
- <locking-policy type="ox"/>
- <primary-key-policy/>
- </transactional-policy>
- <mappings>
- <mapping type="composite-object">
- <name>billingAddress</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Customer</attribute-declaring-type-name>
- <attribute-name>billingAddress</attribute-name>
- </attribute-handle>
- <reference-descriptor-handle>
- <descriptor-name>com.example.customer.Address</descriptor-name>
- </reference-descriptor-handle>
- <xpath>tns:billing-address</xpath>
- </mapping>
- <mapping type="xml-direct">
- <name>firstName</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Customer</attribute-declaring-type-name>
- <attribute-name>firstName</attribute-name>
- </attribute-handle>
- <xml-field>tns:first-name/text()</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>id</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Customer</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </attribute-handle>
- <xml-field>@id</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>lastName</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Customer</attribute-declaring-type-name>
- <attribute-name>lastName</attribute-name>
- </attribute-handle>
- <xml-field>tns:last-name/text()</xml-field>
- </mapping>
- <mapping type="composite-collection">
- <name>phoneNumbers</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Customer</attribute-declaring-type-name>
- <attribute-name>phoneNumbers</attribute-name>
- </attribute-handle>
- <reference-descriptor-handle>
- <descriptor-name>com.example.customer.PhoneNumber</descriptor-name>
- </reference-descriptor-handle>
- <xpath>tns:phone-number</xpath>
- <container-policy type="set">
- <container-class>
- <uses-default-container-class>true</uses-default-container-class>
- </container-class>
- </container-policy>
- </mapping>
- <mapping type="composite-object">
- <name>shippingAddress</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Customer</attribute-declaring-type-name>
- <attribute-name>shippingAddress</attribute-name>
- </attribute-handle>
- <reference-descriptor-handle>
- <descriptor-name>com.example.customer.Address</descriptor-name>
- </reference-descriptor-handle>
- <xpath>tns:shipping-address</xpath>
- </mapping>
- <mapping type="composite-object">
- <name>spouse</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Customer</attribute-declaring-type-name>
- <attribute-name>spouse</attribute-name>
- </attribute-handle>
- <reference-descriptor-handle>
- <descriptor-name>com.example.customer.Spouse</descriptor-name>
- </reference-descriptor-handle>
- <xpath>tns:spouse</xpath>
- </mapping>
- </mappings>
- <after-loading-policy>
- <post-load-class-handle>
- <type-name>com.example.customer.eclipselink.DescriptorAfterLoads</type-name>
- </post-load-class-handle>
- <post-load-method-handle>
- <method-declaring-type-name>com.example.customer.eclipselink.DescriptorAfterLoads</method-declaring-type-name>
- <method-signature>amendCustomerDescriptor(org.eclipse.persistence.descriptors.ClassDescriptor)</method-signature>
- </post-load-method-handle>
- </after-loading-policy>
- <schema-context-handle>
- <schema>Customer-XML</schema>
- <qname-path>
- <qname component-type="complex-type" namespace-uri="urn:customer" local-name="customer"/>
- </qname-path>
- </schema-context-handle>
- <root-descriptor>false</root-descriptor>
-</descriptor>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/descriptors/com.example.customer.PhoneNumber.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/descriptors/com.example.customer.PhoneNumber.xml
deleted file mode 100644
index e7e3c5f..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/descriptors/com.example.customer.PhoneNumber.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<descriptor type="o-x">
- <name>com.example.customer.PhoneNumber</name>
- <class-handle>
- <type-name>com.example.customer.PhoneNumber</type-name>
- </class-handle>
- <transactional-policy type="ox">
- <descriptor-alias>PhoneNumber</descriptor-alias>
- <refresh-cache-policy/>
- <caching-policy/>
- <query-manager type="ox"/>
- <locking-policy type="ox"/>
- <primary-key-policy>
- <primary-keys>
- <xml-field>@id</xml-field>
- </primary-keys>
- </primary-key-policy>
- </transactional-policy>
- <mappings>
- <mapping type="xml-direct">
- <name>id</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.PhoneNumber</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </attribute-handle>
- <xml-field>@id</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>number</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.PhoneNumber</attribute-declaring-type-name>
- <attribute-name>number</attribute-name>
- </attribute-handle>
- <xml-field>tns:number/text()</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>type</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.PhoneNumber</attribute-declaring-type-name>
- <attribute-name>type</attribute-name>
- </attribute-handle>
- <xml-field>tns:type/text()</xml-field>
- </mapping>
- </mappings>
- <schema-context-handle>
- <schema>Customer-XML</schema>
- <qname-path>
- <qname component-type="complex-type" namespace-uri="urn:customer" local-name="phone-number"/>
- </qname-path>
- </schema-context-handle>
- <root-descriptor>false</root-descriptor>
-</descriptor>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/descriptors/com.example.customer.Spouse.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/descriptors/com.example.customer.Spouse.xml
deleted file mode 100644
index 0ce16d3..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/descriptors/com.example.customer.Spouse.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<descriptor type="o-x">
- <name>com.example.customer.Spouse</name>
- <class-handle>
- <type-name>com.example.customer.Spouse</type-name>
- </class-handle>
- <transactional-policy type="ox">
- <descriptor-alias>Spouse</descriptor-alias>
- <refresh-cache-policy/>
- <caching-policy/>
- <query-manager type="ox"/>
- <locking-policy type="ox"/>
- <primary-key-policy/>
- </transactional-policy>
- <mappings>
- <mapping type="xml-object-reference">
- <name>address</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Spouse</attribute-declaring-type-name>
- <attribute-name>address</attribute-name>
- </attribute-handle>
- <reference-descriptor-handle>
- <descriptor-name>com.example.customer.Address</descriptor-name>
- </reference-descriptor-handle>
- <xml-field-pairs>
- <field-pair>
- <source-xml-field>tns:mailing-address/text()</source-xml-field>
- <target-xml-field>@id</target-xml-field>
- </field-pair>
- </xml-field-pairs>
- </mapping>
- <mapping type="xml-direct">
- <name>firstName</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Spouse</attribute-declaring-type-name>
- <attribute-name>firstName</attribute-name>
- </attribute-handle>
- <xml-field>tns:first-name/text()</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>id</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Spouse</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </attribute-handle>
- <xml-field>@id</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>lastName</name>
- <attribute-handle>
- <attribute-declaring-type-name>com.example.customer.Spouse</attribute-declaring-type-name>
- <attribute-name>lastName</attribute-name>
- </attribute-handle>
- <xml-field>tns:last-name/text()</xml-field>
- </mapping>
- </mappings>
- <schema-context-handle>
- <schema>Customer-XML</schema>
- <qname-path>
- <qname component-type="complex-type" namespace-uri="urn:customer" local-name="spouse"/>
- </qname-path>
- </schema-context-handle>
- <root-descriptor>false</root-descriptor>
-</descriptor>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/schemas/Customer-XML.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/schemas/Customer-XML.xml
deleted file mode 100644
index 11caba9..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.customer/workbench/schemas/Customer-XML.xml
+++ /dev/null
@@ -1,267 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xml-schema>
- <name>Customer-XML</name>
- <target-namespace-url>urn:customer</target-namespace-url>
- <schema-source type="file">
- <location>../src/xsd/jpadas-customer.xsd</location>
- </schema-source>
- <built-in-namespaces>
- <namespace url="http://www.w3.org/2001/XMLSchema" prefix="xs"/>
- <namespace url="http://www.w3.org/2001/XMLSchema-instance" prefix="xsi"/>
- </built-in-namespaces>
- <declared-namespaces>
- <namespace>
- <namespace-prefix>tns</namespace-prefix>
- <namespace-prefix-is-user-defined>false</namespace-prefix-is-user-defined>
- <namespace-url>urn:customer</namespace-url>
- <declared>true</declared>
- <type-definitions>
- <type-definition type="complex-type">
- <name>address</name>
- <namespace-url>urn:customer</namespace-url>
- <abstract>false</abstract>
- <derivation-method>restriction</derivation-method>
- <base-type type="complex-type-ref">
- <name>anyType</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </base-type>
- <attributes>
- <attribute type="attribute">
- <name>id</name>
- <use>required</use>
- <type type="simple-type-ref">
- <name>ID</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </attribute>
- </attributes>
- <content type="complex">
- <mixed-flag>false</mixed-flag>
- <particle compositor="sequence" type="model-group">
- <particles>
- <particle type="element">
- <name>street</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="simple-type-ref">
- <name>ID</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- <particle type="element">
- <name>city</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- <particle type="element">
- <name>province</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- <particle type="element">
- <name>postal-code</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- </particles>
- </particle>
- </content>
- </type-definition>
- <type-definition type="complex-type">
- <name>customer</name>
- <namespace-url>urn:customer</namespace-url>
- <abstract>false</abstract>
- <derivation-method>restriction</derivation-method>
- <base-type type="complex-type-ref">
- <name>anyType</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </base-type>
- <attributes>
- <attribute type="attribute">
- <name>id</name>
- <use>required</use>
- <type type="simple-type-ref">
- <name>int</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </attribute>
- </attributes>
- <content type="complex">
- <mixed-flag>false</mixed-flag>
- <particle compositor="sequence" type="model-group">
- <particles>
- <particle type="element">
- <name>first-name</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- <particle type="element">
- <name>last-name</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- <particle type="element">
- <name>billing-address</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="complex-type-ref">
- <name>address</name>
- <namespace-url>urn:customer</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- <particle type="element">
- <name>shipping-address</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="complex-type-ref">
- <name>address</name>
- <namespace-url>urn:customer</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- <particle type="element">
- <name>phone-number</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="complex-type-ref">
- <name>phone-number</name>
- <namespace-url>urn:customer</namespace-url>
- </type>
- <nillable>true</nillable>
- <min-occurs>0</min-occurs>
- <max-occurs>-1</max-occurs>
- </particle>
- <particle type="element">
- <name>spouse</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="complex-type-ref">
- <name>spouse</name>
- <namespace-url>urn:customer</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- </particles>
- </particle>
- </content>
- </type-definition>
- <type-definition type="complex-type">
- <name>phone-number</name>
- <namespace-url>urn:customer</namespace-url>
- <abstract>false</abstract>
- <derivation-method>restriction</derivation-method>
- <base-type type="complex-type-ref">
- <name>anyType</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </base-type>
- <attributes>
- <attribute type="attribute">
- <name>id</name>
- <use>required</use>
- <type type="simple-type-ref">
- <name>ID</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </attribute>
- </attributes>
- <content type="complex">
- <mixed-flag>false</mixed-flag>
- <particle compositor="sequence" type="model-group">
- <particles>
- <particle type="element">
- <name>type</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- <particle type="element">
- <name>number</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- </particles>
- </particle>
- </content>
- </type-definition>
- <type-definition type="complex-type">
- <name>spouse</name>
- <namespace-url>urn:customer</namespace-url>
- <abstract>false</abstract>
- <derivation-method>restriction</derivation-method>
- <base-type type="complex-type-ref">
- <name>anyType</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </base-type>
- <attributes>
- <attribute type="attribute">
- <name>id</name>
- <use>required</use>
- <type type="simple-type-ref">
- <name>int</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </attribute>
- </attributes>
- <content type="complex">
- <mixed-flag>false</mixed-flag>
- <particle compositor="sequence" type="model-group">
- <particles>
- <particle type="element">
- <name>first-name</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- <particle type="element">
- <name>last-name</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- <particle type="element">
- <name>mailing-address</name>
- <namespace-url>urn:customer</namespace-url>
- <type type="simple-type-ref">
- <name>IDREF</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- </particles>
- </particle>
- </content>
- </type-definition>
- </type-definitions>
- </namespace>
- </declared-namespaces>
-</xml-schema>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/.classpath b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/.classpath
deleted file mode 100644
index b6f3ddc..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/.classpath
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry excluding="**/.svn/**" kind="src" path="src"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.sdo.das"/>
- <classpathentry kind="var" path="ORACLE_JDBC_LIB"/>
- <classpathentry combineaccessrules="false" kind="src" path="/commonj.sdo 2.1.0"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.antlr"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.asm"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.core"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.jpa"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.sdo"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
- <classpathentry combineaccessrules="false" kind="src" path="/javax.persistence 1.99"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/.project b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/.project
deleted file mode 100644
index ddbda9f..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.persistence.example.sdo.das.employee</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/.settings/org.eclipse.jdt.core.prefs b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 862e7b5..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,60 +0,0 @@
-#Thu Dec 11 09:49:45 EST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-1.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-1.xml
deleted file mode 100644
index e3f7bc5..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-1.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<emp:employee id="1" version="1" xmlns="http://www.example.org/jpadas-employee" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:emp="http://www.example.org/jpadas-employee">
- <first-name>Bob</first-name>
- <last-name>Smith</last-name>
- <gender>Male</gender>
- <salary>35000.0</salary>
- <address id="1">
- <street>1450 Acme Cr., Suite 4</street>
- <city>Toronto</city>
- <state>ONT</state>
- <zip-code>L5J2B5</zip-code>
- <country>Canada</country>
- </address>
- <phone-number number="6135558812" type="Work"/>
-</emp:employee>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-10.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-10.xml
deleted file mode 100644
index 6deccfc..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-10.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<emp:employee id="10" version="1" xmlns="http://www.example.org/jpadas-employee" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:emp="http://www.example.org/jpadas-employee">
- <first-name>Jill</first-name>
- <last-name>May</last-name>
- <gender>Female</gender>
- <salary>56232.0</salary>
- <address id="10">
- <street>1111 Mooseland Rd.</street>
- <city>Calgary</city>
- <state>AB</state>
- <zip-code>J5J2B5</zip-code>
- <country>Canada</country>
- </address>
- <phone-number number="6135558812" type="Work"/>
- <phone-number number="6135555943" type="Work Fax"/>
-</emp:employee>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-11.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-11.xml
deleted file mode 100644
index 6822322..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-11.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<emp:employee id="11" version="1" xmlns="http://www.example.org/jpadas-employee" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:emp="http://www.example.org/jpadas-employee">
- <first-name>Sarah-Lou</first-name>
- <last-name>Smitty</last-name>
- <gender>Female</gender>
- <salary>75000.0</salary>
- <address id="11">
- <street>1 Hawthorne Drive</street>
- <city>Arnprior</city>
- <state>ONT</state>
- <zip-code>W1A2B5</zip-code>
- <country>Canada</country>
- </address>
- <phone-number number="6135551234" type="Home"/>
- <phone-number number="4165551111" type="Cellular"/>
- <phone-number number="6135555943" type="Work Fax"/>
-</emp:employee>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-12.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-12.xml
deleted file mode 100644
index bc9a0dd..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-12.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<emp:employee id="12" version="1" xmlns="http://www.example.org/jpadas-employee" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:emp="http://www.example.org/jpadas-employee">
- <first-name>Jim-Bob</first-name>
- <last-name>Jefferson</last-name>
- <gender>Male</gender>
- <salary>50000.0</salary>
- <address id="12">
- <street>1112 Gold Rush Rd.</street>
- <city>Yellowknife</city>
- <state>YK</state>
- <zip-code>Y5J2N5</zip-code>
- <country>Canada</country>
- </address>
- <phone-number number="6135551234" type="Home"/>
- <phone-number number="4165551111" type="Cellular"/>
-</emp:employee>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-2.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-2.xml
deleted file mode 100644
index a1135fb..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-2.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<emp:employee id="2" version="1" xmlns="http://www.example.org/jpadas-employee" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:emp="http://www.example.org/jpadas-employee">
- <first-name>John</first-name>
- <last-name>Way</last-name>
- <gender>Male</gender>
- <salary>53000.0</salary>
- <address id="2">
- <street>12 Merivale Rd., Suite 5</street>
- <city>Ottawa</city>
- <state>ONT</state>
- <zip-code>K5J2B5</zip-code>
- <country>Canada</country>
- </address>
- <phone-number number="9055553691" type="ISDN"/>
- <phone-number number="6135558812" type="Work"/>
-</emp:employee>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-3.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-3.xml
deleted file mode 100644
index 479718d..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-3.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<emp:employee id="3" version="1" xmlns="http://www.example.org/jpadas-employee" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:emp="http://www.example.org/jpadas-employee">
- <first-name>Charles</first-name>
- <last-name>Chanley</last-name>
- <gender>Male</gender>
- <salary>43000.0</salary>
- <address id="3">
- <street>1 Canadien Place</street>
- <city>Montreal</city>
- <state>QUE</state>
- <zip-code>Q2S5Z5</zip-code>
- <country>Canada</country>
- </address>
- <phone-number number="9765556666" type="Pager"/>
- <phone-number number="9055553691" type="ISDN"/>
-</emp:employee>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-4.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-4.xml
deleted file mode 100644
index 5c0f8ce..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-4.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<emp:employee id="4" version="1" xmlns="http://www.example.org/jpadas-employee" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:emp="http://www.example.org/jpadas-employee">
- <first-name>Emanual</first-name>
- <last-name>Smith</last-name>
- <gender>Male</gender>
- <salary>49631.0</salary>
- <address id="4">
- <street>20 Mountain Blvd., Floor 53, Suite 6</street>
- <city>Vancouver</city>
- <state>BC</state>
- <zip-code>N5J2N5</zip-code>
- <country>Canada</country>
- </address>
- <phone-number number="9055553691" type="ISDN"/>
- <phone-number number="9765556666" type="Pager"/>
- <phone-number number="6135555943" type="Work Fax"/>
- <phone-number number="4165551111" type="Cellular"/>
-</emp:employee>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-5.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-5.xml
deleted file mode 100644
index f4a0062..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-5.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<emp:employee id="5" version="1" xmlns="http://www.example.org/jpadas-employee" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:emp="http://www.example.org/jpadas-employee">
- <first-name>Sarah</first-name>
- <last-name>Way</last-name>
- <gender>Female</gender>
- <salary>87000.0</salary>
- <address id="5">
- <street>3254 Parkway Place</street>
- <city>Prince Rupert</city>
- <state>BC</state>
- <zip-code>K3K5D5</zip-code>
- <country>Canada</country>
- </address>
- <phone-number number="6135551234" type="Home"/>
- <phone-number number="9055553691" type="ISDN"/>
- <phone-number number="6135558812" type="Work"/>
-</emp:employee>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-6.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-6.xml
deleted file mode 100644
index b28b5f8..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-6.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<emp:employee id="6" version="1" xmlns="http://www.example.org/jpadas-employee" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:emp="http://www.example.org/jpadas-employee">
- <first-name>Marcus</first-name>
- <last-name>Saunders</last-name>
- <gender>Male</gender>
- <salary>54300.0</salary>
- <address id="6">
- <street>234 Caledonia Lane</street>
- <city>Perth</city>
- <state>ONT</state>
- <zip-code>Y3Q2N9</zip-code>
- <country>Canada</country>
- </address>
- <phone-number number="9055553691" type="ISDN"/>
- <phone-number number="6135558812" type="Work"/>
-</emp:employee>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-7.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-7.xml
deleted file mode 100644
index 0544862..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-7.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<emp:employee id="7" version="1" xmlns="http://www.example.org/jpadas-employee" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:emp="http://www.example.org/jpadas-employee">
- <first-name>Nancy</first-name>
- <last-name>White</last-name>
- <gender>Female</gender>
- <salary>31000.0</salary>
- <address id="7">
- <street>2 Anderson Rd.</street>
- <city>Metcalfe</city>
- <state>ONT</state>
- <zip-code>Y4F7V6</zip-code>
- <country>Canada</country>
- </address>
- <phone-number number="6135551234" type="Home"/>
-</emp:employee>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-8.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-8.xml
deleted file mode 100644
index 2342ccf..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-8.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<emp:employee id="8" version="1" xmlns="http://www.example.org/jpadas-employee" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:emp="http://www.example.org/jpadas-employee">
- <first-name>Fred</first-name>
- <last-name>Jones</last-name>
- <gender>Male</gender>
- <salary>500000.0</salary>
- <address id="8">
- <street>382 Hyde Park Blvd.</street>
- <city>Victoria</city>
- <state>BC</state>
- <zip-code>Z5J2N5</zip-code>
- <country>Canada</country>
- </address>
- <phone-number number="9055553691" type="ISDN"/>
- <phone-number number="4165551111" type="Cellular"/>
-</emp:employee>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-9.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-9.xml
deleted file mode 100644
index 75de517..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/data/samples/employee-9.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<emp:employee id="9" version="1" xmlns="http://www.example.org/jpadas-employee" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:emp="http://www.example.org/jpadas-employee">
- <first-name>Betty</first-name>
- <last-name>Jones</last-name>
- <gender>Female</gender>
- <salary>500001.0</salary>
- <address id="9">
- <street>89 Chocolate Drive</street>
- <city>Smith Falls</city>
- <state>ONT</state>
- <zip-code>C6C6C6</zip-code>
- <country>Canada</country>
- </address>
- <phone-number number="9055553691" type="ISDN"/>
- <phone-number number="6135558812" type="Work"/>
-</emp:employee>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/META-INF/eclipselink-orm.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/META-INF/eclipselink-orm.xml
deleted file mode 100644
index 1b8ae02..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/META-INF/eclipselink-orm.xml
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.0" encoding="windows-1252" ?>
-<!--
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
--->
-<entity-mappings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
-
- <object-type-converter name="gender-converter"
- object-type="model.Gender" data-type="java.lang.String">
- <conversion-value object-value="Male" data-value="M" />
- <conversion-value object-value="Female" data-value="F" />
- </object-type-converter>
-
- <sequence-generator name="EMP_SEQ" sequence-name="EMP_SEQ" allocation-size="13" />
- <sequence-generator name="ADDR_SEQ" sequence-name="ADDR_SEQ" allocation-size="13" />
-
- <named-query name="Employee.findAll">
- <query>SELECT e FROM Employee e</query>
- </named-query>
-
- <entity class="model.Address">
- <table name="JPADAS_ADDRESS" />
- <attributes>
- <id name="id">
- <column name="ADDRESS_ID" />
- <generated-value strategy="SEQUENCE" generator="ADDR_SEQ" />
- </id>
- <basic name="city" />
- <basic name="country" />
- <basic name="province" />
- <basic name="postalCode">
- <column name="P_CODE" />
- </basic>
- <basic name="street" />
- </attributes>
- </entity>
-
- <entity class="model.PhoneNumber">
- <table name="JPADAS_PHONE" />
- <id-class class="model.PhoneNumber$ID" />
- <attributes>
- <id name="id">
- <column name="EMP_ID" updatable="false" insertable="false" />
- </id>
- <id name="type">
- <column updatable="false" />
- </id>
- <basic name="number">
- <column name="P_NUMBER" column-definition="VARCHAR2(20)"/>
- </basic>
- <many-to-one name="owner">
- <join-column name="EMP_ID" />
- </many-to-one>
- </attributes>
- </entity>
-
- <entity class="model.Employee">
- <table name="JPADAS_EMPLOYEE" />
- <secondary-table name="JPADAS_SALARY" />
- <attributes>
- <id name="id">
- <column name="EMP_ID" />
- <generated-value strategy="SEQUENCE" generator="EMP_SEQ" />
- </id>
- <basic name="firstName">
- <column name="F_NAME" />
- </basic>
- <basic name="lastName">
- <column name="L_NAME" />
- </basic>
- <basic name="startTime">
- <column name="START_TIME" />
- </basic>
- <basic name="endTime">
- <column name="END_TIME" />
- </basic>
- <basic name="gender">
- <column name="GENDER" />
- <convert>gender-converter</convert>
- </basic>
- <basic name="salary">
- <column table="JPADAS_SALARY" />
- </basic>
- <basic-collection name="responsibilities">
- <value-column name="JPADAS_RESPON_DESC" />
- <collection-table name="RESPONS" />
- </basic-collection>
- <version name="version" />
- <many-to-one name="manager" fetch="LAZY" optional="true">
- <join-column name="MANAGER_ID" />
- </many-to-one>
- <one-to-many name="managedEmployees" mapped-by="manager" />
- <one-to-many name="phoneNumbers" mapped-by="owner">
- <cascade>
- <cascade-all />
- </cascade>
- <private-owned />
- </one-to-many>
- <one-to-one name="address" fetch="LAZY">
- <join-column name="ADDR_ID" />
- <cascade>
- <cascade-all />
- </cascade>
- <private-owned />
- </one-to-one>
- <embedded name="period">
- <attribute-override name="startDate">
- <column name="START_DATE" />
- </attribute-override>
- <attribute-override name="endDate">
- <column name="END_DATE" />
- </attribute-override>
- </embedded>
- </attributes>
- </entity>
-
- <embeddable class="model.EmploymentPeriod">
- <attributes>
- <basic name="startDate">
- <temporal>DATE</temporal>
- </basic>
- <basic name="endDate">
- <temporal>DATE</temporal>
- </basic>
- </attributes>
- </embeddable>
-</entity-mappings>
\ No newline at end of file
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/META-INF/employee-oxm.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/META-INF/employee-oxm.xml
deleted file mode 100644
index 5b706b7..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/META-INF/employee-oxm.xml
+++ /dev/null
@@ -1,186 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<object-persistence version="Eclipse Persistence Services - 1.1.0 (Build 20081209)" 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>jpadas-employee</name>
- <class-mapping-descriptors>
- <class-mapping-descriptor xsi:type="xml-class-mapping-descriptor">
- <class>model.Address</class>
- <alias>Address</alias>
- <events xsi:type="event-policy"/>
- <querying xsi:type="query-policy"/>
- <attribute-mappings>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>id</attribute-name>
- <field name="@id" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>street</attribute-name>
- <field name="street/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>city</attribute-name>
- <field name="city/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>province</attribute-name>
- <field name="state/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>postalCode</attribute-name>
- <field name="zip-code/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>country</attribute-name>
- <field name="country/text()" xsi:type="node"/>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>aggregate</descriptor-type>
- <instantiation/>
- <copying xsi:type="instantiation-copy-policy"/>
- <namespace-resolver>
- <namespaces>
- <namespace>
- <prefix>xs</prefix>
- <namespace-uri>http://www.w3.org/2001/XMLSchema</namespace-uri>
- </namespace>
- <namespace>
- <prefix>xsi</prefix>
- <namespace-uri>http://www.w3.org/2001/XMLSchema-instance</namespace-uri>
- </namespace>
- <namespace>
- <prefix>emp</prefix>
- <namespace-uri>http://www.example.org/jpadas-employee</namespace-uri>
- </namespace>
- </namespaces>
- <default-namespace-uri>http://www.example.org/jpadas-employee</default-namespace-uri>
- </namespace-resolver>
- <schema xsi:type="schema-file-reference">
- <resource>..\src\xsd\jpadas-employee.xsd</resource>
- <schema-context>/emp:address-type</schema-context>
- <node-type>complex-type</node-type>
- </schema>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="xml-class-mapping-descriptor">
- <class>model.Employee</class>
- <alias>Employee</alias>
- <events xsi:type="event-policy"/>
- <querying xsi:type="query-policy"/>
- <attribute-mappings>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>id</attribute-name>
- <field name="@id" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>version</attribute-name>
- <field name="@version" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>firstName</attribute-name>
- <field name="first-name/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>lastName</attribute-name>
- <field name="last-name/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>gender</attribute-name>
- <field name="gender/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>salary</attribute-name>
- <field name="salary/text()" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-composite-object-mapping">
- <attribute-name>address</attribute-name>
- <reference-class>model.Address</reference-class>
- <field name="address" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-composite-collection-mapping">
- <attribute-name>phoneNumbers</attribute-name>
- <reference-class>model.PhoneNumber</reference-class>
- <field name="phone-number" xsi:type="node"/>
- <container xsi:type="list-container-policy">
- <collection-type>java.util.Vector</collection-type>
- </container>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>aggregate</descriptor-type>
- <amendment>
- <amendment-class>model.persistence.MOXyDescriptorCustomizers</amendment-class>
- <amendment-method>afterLoadEmployee</amendment-method>
- </amendment>
- <instantiation/>
- <copying xsi:type="instantiation-copy-policy"/>
- <default-root-element>emp:employee</default-root-element>
- <default-root-element-field name="emp:employee" xsi:type="node">
- <leaf-element-type>emp:employee-type</leaf-element-type>
- </default-root-element-field>
- <namespace-resolver>
- <namespaces>
- <namespace>
- <prefix>xs</prefix>
- <namespace-uri>http://www.w3.org/2001/XMLSchema</namespace-uri>
- </namespace>
- <namespace>
- <prefix>xsi</prefix>
- <namespace-uri>http://www.w3.org/2001/XMLSchema-instance</namespace-uri>
- </namespace>
- <namespace>
- <prefix>emp</prefix>
- <namespace-uri>http://www.example.org/jpadas-employee</namespace-uri>
- </namespace>
- </namespaces>
- <default-namespace-uri>http://www.example.org/jpadas-employee</default-namespace-uri>
- </namespace-resolver>
- <schema xsi:type="schema-file-reference">
- <resource>..\src\xsd\jpadas-employee.xsd</resource>
- <schema-context>/emp:employee-type</schema-context>
- <node-type>complex-type</node-type>
- </schema>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="xml-class-mapping-descriptor">
- <class>model.PhoneNumber</class>
- <alias>PhoneNumber</alias>
- <events xsi:type="event-policy"/>
- <querying xsi:type="query-policy"/>
- <attribute-mappings>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>number</attribute-name>
- <field name="@number" xsi:type="node"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="xml-direct-mapping">
- <attribute-name>type</attribute-name>
- <field name="@type" xsi:type="node"/>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>aggregate</descriptor-type>
- <instantiation/>
- <copying xsi:type="instantiation-copy-policy"/>
- <namespace-resolver>
- <namespaces>
- <namespace>
- <prefix>xs</prefix>
- <namespace-uri>http://www.w3.org/2001/XMLSchema</namespace-uri>
- </namespace>
- <namespace>
- <prefix>xsi</prefix>
- <namespace-uri>http://www.w3.org/2001/XMLSchema-instance</namespace-uri>
- </namespace>
- <namespace>
- <prefix>emp</prefix>
- <namespace-uri>http://www.example.org/jpadas-employee</namespace-uri>
- </namespace>
- </namespaces>
- <default-namespace-uri>http://www.example.org/jpadas-employee</default-namespace-uri>
- </namespace-resolver>
- <schema xsi:type="schema-file-reference">
- <resource>..\src\xsd\jpadas-employee.xsd</resource>
- <schema-context>/emp:phone-type</schema-context>
- <node-type>complex-type</node-type>
- </schema>
- </class-mapping-descriptor>
- </class-mapping-descriptors>
- <login xsi:type="xml-login">
- <platform-class>org.eclipse.persistence.oxm.platform.SAXPlatform</platform-class>
- <user-name></user-name>
- </login>
-</object-persistence>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/META-INF/persistence.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/META-INF/persistence.xml
deleted file mode 100644
index 2b69c5a..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/META-INF/persistence.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="windows-1252" ?>
-<!--
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
--->
-<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_1_0.xsd"
- version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
- <persistence-unit name="employee" transaction-type="RESOURCE_LOCAL">
- <properties>
- <!-- Default Login using Oracle -->
- <property name="eclipselink.jdbc.driver" value="oracle.jdbc.OracleDriver" />
- <property name="eclipselink.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:XE" />
- <property name="eclipselink.jdbc.user" value="user" />
- <property name="eclipselink.jdbc.password" value="password" />
- <property name="eclipselink.target-database" value="Oracle" />
-
- <!-- Minimal connections in internal pool -->
- <property name="eclipselink.jdbc.read-connections.min" value="1" />
- <property name="eclipselink.jdbc.write-connections.min" value="1" />
- <property name="eclipselink.jdbc.batch-writing" value="JDBC" />
-
- <!-- Default Login using Oracle -->
- <property name="eclipselink.logging.level" value="FINE" />
- <property name="eclipselink.logging.timestamp" value="false" />
- <property name="eclipselink.logging.thread" value="false" />
- <property name="eclipselink.logging.session" value="false" />
- <property name="eclipselink.logging.exceptions" value="false" />
- </properties>
- </persistence-unit>
-</persistence>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/META-INF/sessions.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/META-INF/sessions.xml
deleted file mode 100644
index 2d21fce..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/META-INF/sessions.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<sessions version="1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <session xsi:type="database-session">
- <name>model</name>
- <event-listener-classes/>
- <logging xsi:type="eclipselink-log"/>
- <primary-project xsi:type="xml">META-INF/employee-oxm.xml</primary-project>
- <login xsi:type="xml-login"/>
- </session>
-</sessions>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/Address.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/Address.java
deleted file mode 100644
index f0aed3e..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/Address.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package model;
-
-import java.io.Serializable;
-
-import javax.persistence.*;
-
-public class Address implements Serializable {
- private int id;
- private String city;
-
- @Lob
- @Basic(fetch=FetchType.LAZY)
- private String country;
- private String province;
- private String postalCode;
- private String street;
-
- @OneToOne(mappedBy="address")
- private Employee owner;
-
- public Address() {
- }
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int addressId) {
- this.id = addressId;
- }
-
- public String getCity() {
- return city;
- }
-
- public void setCity(String city) {
- this.city = city;
- }
-
- public String getCountry() {
- return country;
- }
-
- public void setCountry(String country) {
- this.country = country;
- }
-
- public String getProvince() {
- return province;
- }
-
- public void setProvince(String province) {
- this.province = province;
- }
-
- public String getPostalCode() {
- return this.postalCode;
- }
-
- public void setPostalCode(String pCode) {
- this.postalCode = pCode;
- }
-
- public String getStreet() {
- return street;
- }
-
- public void setStreet(String street) {
- this.street = street;
- }
-
- public Employee getOwner() {
- return this.owner;
- }
-
- public void setOwner(Employee owner) {
- this.owner = owner;
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/Employee.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/Employee.java
deleted file mode 100644
index ffd1ff5..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/Employee.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package model;
-
-import java.sql.Time;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-public class Employee {
- private int id;
- private String firstName;
- private Gender gender = Gender.Male;
- private String lastName;
- private Time startTime;
- private Time endTime;
- private long version;
- private Employee manager;
- private List<Employee> managedEmployees = new ArrayList<Employee>();
- private List<PhoneNumber> phoneNumbers = new ArrayList<PhoneNumber>();
- private Address address;
- private EmploymentPeriod period;
- private double salary;
- private List<String> responsibilities = new ArrayList<String>();
-
- public Employee() {
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int empId) {
- this.id = empId;
- }
-
- public Time getEndTime() {
- return this.endTime;
- }
-
- public void setEndTime(Time endTime) {
- this.endTime = endTime;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String fName) {
- this.firstName = fName;
- }
-
- public Gender getGender() {
- return this.gender;
- }
-
- public void setGender(Gender gender) {
- this.gender = gender;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public void setLastName(String lName) {
- this.lastName = lName;
- }
-
- public Time getStartTime() {
- return startTime;
- }
-
- public void setStartTime(Time startTime) {
- this.startTime = startTime;
- }
-
- public long getVersion() {
- return version;
- }
-
- public void setVersion(long version) {
- this.version = version;
- }
-
- public Employee getManager() {
- return manager;
- }
-
- public void setManager(Employee employee) {
- this.manager = employee;
- }
-
- public List<Employee> getManagedEmployees() {
- return this.managedEmployees;
- }
-
- public void setManagedEmployees(List<Employee> employeeList) {
- this.managedEmployees = employeeList;
- }
-
- public Employee addManagedEmployee(Employee employee) {
- getManagedEmployees().add(employee);
- employee.setManager(this);
- return employee;
- }
-
- public Employee removeManagedEmployee(Employee employee) {
- getManagedEmployees().remove(employee);
- employee.setManager(null);
- return employee;
- }
-
- public List<PhoneNumber> getPhoneNumbers() {
- return phoneNumbers;
- }
-
- public void setPhoneNumbers(List<PhoneNumber> phoneNumberList) {
- this.phoneNumbers = phoneNumberList;
- }
-
- public PhoneNumber addPhoneNumber(PhoneNumber phoneNumber) {
- getPhoneNumbers().add(phoneNumber);
- phoneNumber.setOwner(this);
- return phoneNumber;
- }
-
- public PhoneNumber addPhoneNumber(String type, String number) {
- PhoneNumber phoneNumber = new PhoneNumber(type, number);
- return addPhoneNumber(phoneNumber);
- }
-
- public PhoneNumber removePhoneNumber(PhoneNumber phoneNumber) {
- getPhoneNumbers().remove(phoneNumber);
- phoneNumber.setOwner(null);
- return phoneNumber;
- }
-
- public void setAddress(Address address) {
- this.address = address;
- }
-
- public Address getAddress() {
- return address;
- }
-
- public void setPeriod(EmploymentPeriod period) {
- this.period = period;
- }
-
- public EmploymentPeriod getPeriod() {
- return period;
- }
-
- public double getSalary() {
- return salary;
- }
-
- public void setSalary(double salary) {
- this.salary = salary;
- }
-
- public List<String> getResponsibilities() {
- return this.responsibilities;
- }
-
- public void setResponsibilities(List<String> responsibilities) {
- this.responsibilities = responsibilities;
- }
-
- public void addResponsibility(String responsibility) {
- getResponsibilities().add(responsibility);
- }
-
- public void removeResponsibility(String responsibility) {
- getResponsibilities().remove(responsibility);
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/EmploymentPeriod.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/EmploymentPeriod.java
deleted file mode 100644
index 64795c6..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/EmploymentPeriod.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package model;
-
-import java.util.Calendar;
-
-/**
- * Represents the period of time an employee has worked for the company. A null
- * endDate indicates that the employee is current.
- *
- * @author djclarke
- */
-public class EmploymentPeriod {
- private Calendar startDate;
- private Calendar endDate;
-
- public Calendar getStartDate() {
- return startDate;
- }
-
- public void setStartDate(Calendar startDate) {
- this.startDate = startDate;
- }
-
- public void setStartDate(int year, int month, int date) {
- if (this.startDate == null) {
- setStartDate(Calendar.getInstance());
- }
- getStartDate().set(year, month, date);
- }
-
- public Calendar getEndDate() {
- return endDate;
- }
-
- public void setEndDate(Calendar endDate) {
- this.endDate = endDate;
- }
-
- public void setEndDate(int year, int month, int date) {
- if (this.endDate == null) {
- setEndDate(Calendar.getInstance());
- }
- getEndDate().set(year, month, date);
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/Gender.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/Gender.java
deleted file mode 100644
index c3ee544..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/Gender.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package model;
-
-/**
- * @author dclarke
- * @since EclipseLink 1.0
- */
-public enum Gender {
- Female, Male, ;
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/PhoneNumber.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/PhoneNumber.java
deleted file mode 100644
index 9242b3a..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/PhoneNumber.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package model;
-
-import java.io.Serializable;
-
-public class PhoneNumber implements Serializable {
- private int id;
- private String number;
- private String type;
- private Employee owner;
-
- public PhoneNumber() {
- }
-
- public PhoneNumber(String type, String number) {
- this();
- setType(type);
- setNumber(number);
- }
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int empId) {
- this.id = empId;
- }
-
- public String getNumber() {
- return this.number;
- }
-
- public void setNumber(String pNumber) {
- this.number = pNumber;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public Employee getOwner() {
- return this.owner;
- }
-
- public void setOwner(Employee employee) {
- this.owner = employee;
- this.id = employee.getId();
- }
-
- public static class ID implements Serializable {
- public int id;
- public String type;
-
- public ID() {
- }
-
- public ID(int empId, String type) {
- this.id = empId;
- this.type = type;
- }
-
- public boolean equals(Object other) {
- if (other instanceof ID) {
- final ID otherID = (ID) other;
- return otherID.id == id && otherID.type.equals(type);
- }
- return false;
- }
-
- public int hashCode() {
- return super.hashCode();
- }
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/jaxb.properties b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/jaxb.properties
deleted file mode 100644
index 5837a4c..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/jaxb.properties
+++ /dev/null
@@ -1 +0,0 @@
-javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
\ No newline at end of file
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/persistence/MOXyDescriptorCustomizers.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/persistence/MOXyDescriptorCustomizers.java
deleted file mode 100644
index 3daa465..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/persistence/MOXyDescriptorCustomizers.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package model.persistence;
-
-import model.*;
-
-import org.eclipse.persistence.descriptors.*;
-import org.eclipse.persistence.mappings.converters.ObjectTypeConverter;
-import org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping;
-import org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping;
-import org.eclipse.persistence.oxm.mappings.XMLDirectMapping;
-
-public class MOXyDescriptorCustomizers {
-
- public static void afterLoadEmployee(ClassDescriptor descriptor) {
- XMLDirectMapping genderMapping = (XMLDirectMapping) descriptor.getMappingForAttributeName("gender");
-
- ObjectTypeConverter converter = new ObjectTypeConverter();
- converter.setFieldClassification(String.class);
- converter.addConversionValue(Gender.Male.name(), Gender.Male);
- converter.addConversionValue(Gender.Female.name(), Gender.Female);
-
- genderMapping.setConverter(converter);
-
- XMLCompositeCollectionMapping phoneMapping = (XMLCompositeCollectionMapping) descriptor.getMappingForAttributeName("phoneNumbers");
- phoneMapping.setContainerAttributeName("owner");
-
- XMLCompositeObjectMapping addressMapping = (XMLCompositeObjectMapping) descriptor.getMappingForAttributeName("address");
- addressMapping.setContainerAttributeName("owner");
-
- descriptor.getDescriptorEventManager().addListener(new FixPhonesListener());
- }
-
- public static class FixPhonesListener extends DescriptorEventAdapter {
-
- @Override
- public void postBuild(DescriptorEvent event) {
- Employee emp = (Employee) event.getSource();
-
- for (PhoneNumber phone: emp.getPhoneNumbers()) {
- phone.setOwner(emp);
- }
- }
-
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/persistence/PersistenceHelper.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/persistence/PersistenceHelper.java
deleted file mode 100644
index cd8e6ee..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/model/persistence/PersistenceHelper.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package model.persistence;
-
-import java.io.*;
-import java.util.*;
-
-import javax.persistence.*;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.sdo.helper.jaxb.JAXBHelperContext;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.0
- */
-public abstract class PersistenceHelper {
-
- public static final String PERSISTENCE_UNIT_NAME = "employee";
-
- public static EntityManagerFactory createEMF() {
- return createEMF(null);
- }
-
- /**
- *
- * @param properties
- * @return
- */
- public static EntityManagerFactory createEMF(Map properties) {
- Map puProperties = properties == null ? new HashMap() : properties;
-
- try {
- applyUserHomeProperties(puProperties);
- return Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, puProperties);
-
- } catch (RuntimeException e) {
- System.out.println("Persistence.createEMF FAILED: " + e.getMessage());
- e.printStackTrace();
- throw e;
- }
- }
-
- /**
- *
- * @param properties
- */
- public static void applyUserHomeProperties(Map puProperties) {
- String userHome = System.getProperty("user.home");
-
- if (userHome != null && !userHome.isEmpty()) {
- if (!userHome.endsWith(System.getProperty("file.separator"))) {
- userHome = userHome + System.getProperty("file.separator");
- }
-
- File testPropFile = new File(userHome + "test.properties");
-
- if (testPropFile.exists()) {
- Properties testProperties = new Properties();
- FileInputStream in = null;
-
- try {
- in = new FileInputStream(testPropFile);
- testProperties.load(in);
- } catch (FileNotFoundException fnfe) {
- return;
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- // Now process the test properties into the PU properties
- copyProperty(testProperties, "db.driver", puProperties, PersistenceUnitProperties.JDBC_DRIVER);
- copyProperty(testProperties, "db.url", puProperties, PersistenceUnitProperties.JDBC_URL);
- copyProperty(testProperties, "db.user", puProperties, PersistenceUnitProperties.JDBC_USER);
- copyProperty(testProperties, "db.pwd", puProperties, PersistenceUnitProperties.JDBC_PASSWORD);
- copyProperty(testProperties, "db.platform", puProperties, PersistenceUnitProperties.TARGET_DATABASE);
- }
- }
- }
-
- private static void copyProperty(Properties testProperties, String testProp, Map puProperties, String puProperty) {
- if (testProperties.containsKey(testProp)) {
- puProperties.put(puProperty, testProperties.get(testProp));
- }
- }
-
- public static final String MODEL_PACKAGE = "model";
-
- public static final String SCHEMA_REOSURCE = "xsd/jpadas-employee.xsd";
-
- public static final String URI = "http://www.example.org/jpadas-employee";
-
- public static final String EMPLOYEE_TYPE = "employee-type";
- public static final String ADDRESS_TYPE = "address-type";
- public static final String PHONE_TYPE = "phone-type";
-
- /**
- * Return the JAXBHelperContext and lazily create one if null.
- */
- public static JAXBHelperContext createJAXBHelperContext() {
- JAXBHelperContext context = null;
- InputStream xsdIn = null;
-
- try {
- JAXBContext jaxbContext = JAXBContext.newInstance(MODEL_PACKAGE);
- context = new JAXBHelperContext(jaxbContext);
-
- xsdIn = Thread.currentThread().getContextClassLoader().getResourceAsStream(SCHEMA_REOSURCE);
- context.getXSDHelper().define(xsdIn, null);
-
- // Make this the default context
- context.makeDefaultContext();
- } catch (JAXBException e) {
- throw new RuntimeException("EmployeeDAS.getContext()::Could not create JAXBContext for: " + MODEL_PACKAGE, e);
- } finally {
- if (xsdIn != null) {
- try {
- xsdIn.close();
- } catch (IOException e) {
- }
- }
- }
- return context;
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/service/EmployeeDAS.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/service/EmployeeDAS.java
deleted file mode 100644
index adf0d48..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/service/EmployeeDAS.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package service;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import model.Employee;
-
-import org.eclipse.persistence.sdo.helper.jaxb.JAXBHelperContext;
-
-import commonj.sdo.DataObject;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-public class EmployeeDAS {
-
- private JAXBHelperContext context;
-
- private EntityManager entityManager;
-
- public void setHelperContext(JAXBHelperContext context) {
- this.context = context;
- }
-
- public JAXBHelperContext getContext() {
- return this.context;
- }
-
- @PersistenceContext(unitName = "employee")
- public void setEMF(EntityManager em) {
- this.entityManager = em;
- }
-
- public EntityManager getEntityManager() {
- return this.entityManager;
- }
-
- public void close() {
- if (this.entityManager != null && this.entityManager.isOpen()) {
- if (this.entityManager.getTransaction().isActive()) {
- this.entityManager.getTransaction().rollback();
- }
- this.entityManager.close();
- }
-
- this.entityManager = null;
- this.context = null;
- }
-
- public DataObject findEmployee(int id) {
- EntityManager em = getEntityManager();
-
- Employee emp = em.find(Employee.class, id);
-
- if (emp == null) {
- return null;
- }
-
- return getContext().wrap(emp);
- }
-
- public DataObject merge(DataObject empDO) {
- EntityManager em = getEntityManager();
- Employee emp = (Employee) getContext().unwrap(empDO);
-
- try {
- em.getTransaction().begin();
- emp = em.merge(emp);
- em.getTransaction().commit();
- return getContext().wrap(em.find(Employee.class, emp.getId()));
- } finally {
- if (em.getTransaction().isActive()) {
- em.getTransaction().rollback();
- }
- }
-
- }
-
- public void remove(DataObject empDO) {
- EntityManager em = getEntityManager();
-
- em.getTransaction().begin();
- Employee emp = (Employee) getContext().unwrap(empDO);
-
- if (emp == null) {
- return;
- }
- emp = em.find(Employee.class, emp.getId());
-
- em.remove(emp);
-
- em.getTransaction().commit();
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/AllTests.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/AllTests.java
deleted file mode 100644
index 8d28906..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/AllTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { testing.jpa.AllTests.class, testing.jaxb.AllTests.class, testing.sdo.AllTests.class, testing.das.AllTests.class })
-public class AllTests {
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/SamplePopulation.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/SamplePopulation.java
deleted file mode 100644
index 8258f48..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/SamplePopulation.java
+++ /dev/null
@@ -1,537 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing;
-
-import java.util.*;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import junit.framework.Assert;
-import model.*;
-
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.internal.jpa.EJBQueryImpl;
-import org.eclipse.persistence.internal.jpa.EntityManagerImpl;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.*;
-
-public class SamplePopulation {
-
- public static SamplePopulation population = new SamplePopulation();
-
- private Employee[] employees = { basicEmployeeExample1(), basicEmployeeExample2(), basicEmployeeExample3(), basicEmployeeExample4(), basicEmployeeExample5(), basicEmployeeExample6(),
- basicEmployeeExample7(), basicEmployeeExample8(), basicEmployeeExample9(), basicEmployeeExample10(), basicEmployeeExample11(), basicEmployeeExample12() };
-
- private SamplePopulation() {
- addManagedEmployees(0, new int[] { 2, 3, 4 });
- addManagedEmployees(1, new int[] { 5, 0 });
- addManagedEmployees(2, new int[] {});
- addManagedEmployees(3, new int[] {});
- addManagedEmployees(4, new int[] {});
- addManagedEmployees(5, new int[] {});
- addManagedEmployees(6, new int[] {});
- addManagedEmployees(7, new int[] {});
- addManagedEmployees(8, new int[] {});
- addManagedEmployees(9, new int[] { 11 });
- addManagedEmployees(10, new int[] { 6 });
- addManagedEmployees(11, new int[] { 1 });
- }
-
- public Employee basicEmployeeExample1() {
- Employee employee = new Employee();
-
- employee.setFirstName("Bob");
- employee.setLastName("Smith");
- employee.setGender(Gender.Male);
- employee.setSalary(35000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(1996, 0, 1);
- employmentPeriod.setStartDate(1993, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Toronto");
- address.setPostalCode("L5J2B5");
- address.setProvince("ONT");
- address.setStreet("1450 Acme Cr., Suite 4");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Water the office plants.");
- employee.addResponsibility("Maintain the kitchen facilities.");
- employee.addPhoneNumber("Work", "6135558812");
-
- return employee;
- }
-
- public Employee basicEmployeeExample10() {
- Employee employee = new Employee();
-
- employee.setFirstName("Jill");
- employee.setLastName("May");
- employee.setGender(Gender.Female);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setStartDate(1991, 10, 11);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Calgary");
- address.setPostalCode("J5J2B5");
- address.setProvince("AB");
- address.setStreet("1111 Mooseland Rd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.setSalary(56232);
- employee.addPhoneNumber("Work", "6135558812");
- employee.addPhoneNumber("Work Fax", "6135555943");
-
- return employee;
- }
-
- public Employee basicEmployeeExample11() {
- Employee employee = new Employee();
-
- employee.setFirstName("Sarah-Lou");
- employee.setLastName("Smitty");
- employee.setGender(Gender.Female);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(1996, 0, 1);
- employmentPeriod.setStartDate(1993, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Arnprior");
- address.setPostalCode("W1A2B5");
- address.setProvince("ONT");
- address.setStreet("1 Hawthorne Drive");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.setSalary(75000);
- employee.addPhoneNumber("Work Fax", "6135555943");
- employee.addPhoneNumber("Home", "6135551234");
- employee.addPhoneNumber("Cellular", "4165551111");
-
- return employee;
- }
-
- public Employee basicEmployeeExample12() {
- Employee employee = new Employee();
-
- employee.setFirstName("Jim-Bob");
- employee.setLastName("Jefferson");
- employee.setGender(Gender.Male);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 12);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Yellowknife");
- address.setPostalCode("Y5J2N5");
- address.setProvince("YK");
- address.setStreet("1112 Gold Rush Rd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.setSalary(50000);
- employee.addPhoneNumber("Home", "6135551234");
- employee.addPhoneNumber("Cellular", "4165551111");
-
- return employee;
- }
-
- public Employee basicEmployeeExample2() {
- Employee employee = new Employee();
-
- employee.setFirstName("John");
- employee.setLastName("Way");
- employee.setGender(Gender.Male);
- employee.setSalary(53000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setStartDate(1991, 10, 11);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Ottawa");
- address.setPostalCode("K5J2B5");
- address.setProvince("ONT");
- address.setStreet("12 Merivale Rd., Suite 5");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Hire people when more people are required.");
- employee.addResponsibility("Lay off employees when less people are required.");
- employee.addPhoneNumber("Work", "6135558812");
- employee.addPhoneNumber("ISDN", "9055553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample3() {
- Employee employee = new Employee();
-
- employee.setFirstName("Charles");
- employee.setLastName("Chanley");
- employee.setGender(Gender.Male);
- employee.setSalary(43000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Montreal");
- address.setPostalCode("Q2S5Z5");
- address.setProvince("QUE");
- address.setStreet("1 Canadien Place");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Perform code reviews as required.");
- employee.addPhoneNumber("Pager", "9765556666");
- employee.addPhoneNumber("ISDN", "9055553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample4() {
- Employee employee = new Employee();
-
- employee.setFirstName("Emanual");
- employee.setLastName("Smith");
- employee.setGender(Gender.Male);
- employee.setSalary(49631);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Vancouver");
- address.setPostalCode("N5J2N5");
- address.setProvince("BC");
- address.setStreet("20 Mountain Blvd., Floor 53, Suite 6");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Have to fix the Database problem.");
- employee.addPhoneNumber("Work Fax", "6135555943");
- employee.addPhoneNumber("Cellular", "4165551111");
- employee.addPhoneNumber("Pager", "9765556666");
- employee.addPhoneNumber("ISDN", "9055553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample5() {
- Employee employee = new Employee();
-
- employee.setFirstName("Sarah");
- employee.setLastName("Way");
- employee.setGender(Gender.Female);
- employee.setSalary(87000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 6, 31);
- employmentPeriod.setStartDate(1995, 4, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Prince Rupert");
- address.setPostalCode("K3K5D5");
- address.setProvince("BC");
- address.setStreet("3254 Parkway Place");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Write code documentation.");
- employee.addPhoneNumber("Work", "6135558812");
- employee.addPhoneNumber("ISDN", "9055553691");
- employee.addPhoneNumber("Home", "6135551234");
-
- return employee;
- }
-
- public Employee basicEmployeeExample6() {
- Employee employee = new Employee();
-
- employee.setFirstName("Marcus");
- employee.setLastName("Saunders");
- employee.setGender(Gender.Male);
- employee.setSalary(54300);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 12);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Perth");
- address.setPostalCode("Y3Q2N9");
- address.setProvince("ONT");
- address.setStreet("234 Caledonia Lane");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Write user specifications.");
- employee.addPhoneNumber("ISDN", "9055553691");
- employee.addPhoneNumber("Work", "6135558812");
-
- return employee;
- }
-
- public Employee basicEmployeeExample7() {
- Employee employee = new Employee();
-
- employee.setFirstName("Nancy");
- employee.setLastName("White");
- employee.setGender(Gender.Female);
- employee.setSalary(31000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(1996, 0, 1);
- employmentPeriod.setStartDate(1993, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Metcalfe");
- address.setPostalCode("Y4F7V6");
- address.setProvince("ONT");
- address.setStreet("2 Anderson Rd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addPhoneNumber("Home", "6135551234");
-
- return employee;
- }
-
- public Employee basicEmployeeExample8() {
- Employee employee = new Employee();
-
- employee.setFirstName("Fred");
- employee.setLastName("Jones");
- employee.setGender(Gender.Male);
- employee.setSalary(500000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Victoria");
- address.setPostalCode("Z5J2N5");
- address.setProvince("BC");
- address.setStreet("382 Hyde Park Blvd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addPhoneNumber("Cellular", "4165551111");
- employee.addPhoneNumber("ISDN", "9055553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample9() {
- Employee employee = new Employee();
-
- employee.setFirstName("Betty");
- employee.setLastName("Jones");
- employee.setGender(Gender.Female);
- employee.setSalary(500001);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setStartDate(2001, 11, 31);
- employmentPeriod.setEndDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Smith Falls");
- address.setPostalCode("C6C6C6");
- address.setProvince("ONT");
- address.setStreet("89 Chocolate Drive");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addPhoneNumber("Work", "6135558812");
- employee.addPhoneNumber("ISDN", "9055553691");
-
- return employee;
- }
-
- private void addManagedEmployees(int managerIndex, int[] employeeIndeces) {
- Employee manager = this.employees[managerIndex];
-
- if (manager.getManagedEmployees().isEmpty()) {
- for (int index = 0; index < employeeIndeces.length; index++) {
- manager.addManagedEmployee(this.employees[employeeIndeces[index]]);
- }
- }
- }
-
- /**
- * Register all of the population in the provided EntityManager to be
- * persisted This method should only be called from within a test case. It
- * asserts that the provided EntityManager is in a transaction and that the
- * database tables are empty.
- */
- public void persistAll(EntityManager em) {
- Assert.assertTrue("EntityManager not in Transaction", em.getTransaction().isActive());
-
- // Verify that the database tables are empty
- assertCount(em, Employee.class, 0);
- assertCount(em, Address.class, 0);
- assertCount(em, PhoneNumber.class, 0);
-
- for (int index = 0; index < this.employees.length; index++) {
- em.persist(this.employees[index]);
- }
-
- em.flush();
- verifyCounts(em);
- }
-
- public void verifyCounts(EntityManager em) {
- assertCount(em, Employee.class, this.employees.length);
- assertCount(em, Address.class, this.employees.length);
- }
-
- /**
- * Verify that the provided entity type has no rows in the database using a
- * native ReportQuery.
- *
- * @param entityClass
- * @param count
- */
- public void assertCount(EntityManager em, Class entityClass, int count) {
- ReportQuery query = new ReportQuery(entityClass, new ExpressionBuilder());
- query.addCount();
- query.setShouldReturnSingleValue(true);
-
- int dbCount = ((Number) JpaHelper.getEntityManager(em).getUnitOfWork().executeQuery(query)).intValue();
- Assert.assertEquals("Incorrect quantity found of " + entityClass, count, dbCount);
- }
-
- /**
- * Verify that the provided list of Employee instances matches the sample
- * population.
- *
- * @param employees
- */
- public void assertSame(List<Employee> dbEmps) {
- Assert.assertEquals("Incorrect quantity of employees", this.employees.length, dbEmps.size());
-
- Collections.sort(dbEmps, new EmployeeComparator());
-
- for (int index = 0; index < this.employees.length; index++) {
- Employee emp = employees[index];
- Employee dbEmp = dbEmps.get(index);
-
- Assert.assertEquals("First name does not match on employees[" + index + "]", emp.getFirstName(), dbEmp.getFirstName());
- Assert.assertEquals("Last name does not match on employees[" + index + "]", emp.getLastName(), dbEmp.getLastName());
- Assert.assertEquals("Salary does not match on employees[" + index + "]", emp.getSalary(), dbEmp.getSalary());
- }
- }
-
- /**
- * Simple comparator used to order the employees for use within assertSame
- */
- class EmployeeComparator implements Comparator<Employee> {
-
- public int compare(Employee emp1, Employee emp2) {
- return emp1.getId() - emp2.getId();
- }
-
- }
-
- /**
- * Extract the id's from the sample Employee instances.
- *
- * @param em
- * @return
- */
- public int[] getEmployeeIds(EntityManager em) {
- int[] ids = new int[this.employees.length];
-
- for (int index = 0; index < this.employees.length; index++) {
- if (this.employees[index].getId() <= 0) {
- Employee emp = queryByExample(em, this.employees[index]);
-
- if (emp == null) {
- throw new RuntimeException("Could not find Employee: " + this.employees[index]);
- }
- this.employees[index].setId(emp.getId());
- }
- ids[index] = this.employees[index].getId();
- }
-
- return ids;
- }
-
- /**
- * Reset the database so that only the sample population exists.
- *
- * @param em
- */
- public void resetDatabase(EntityManager em) {
- em.getTransaction().begin();
-
- DeleteAllQuery deleteEmpsQuery = new DeleteAllQuery(Employee.class);
- ExpressionBuilder eb = deleteEmpsQuery.getExpressionBuilder();
- deleteEmpsQuery.setSelectionCriteria(eb.get("id").notIn(getEmployeeIds(em)));
- deleteEmpsQuery.setFlushOnExecute(true);
-
- JpaHelper.getEntityManager(em).getUnitOfWork().executeQuery(deleteEmpsQuery);
-
- em.getTransaction().commit();
- }
-
- /**
- * Example of EclipseLink's native query-by-example support.
- *
- * @param em
- * @param sampleEmployee
- * @return
- */
- public Employee queryByExample(EntityManager em, Employee sampleEmployee) {
- QueryByExamplePolicy policy = new QueryByExamplePolicy();
- policy.excludeDefaultPrimitiveValues();
- ReadObjectQuery roq = new ReadObjectQuery(sampleEmployee, policy);
- // Wrap the native query in a JPA Query and execute it.
- Query query = new EJBQueryImpl(roq, (EntityManagerImpl) JpaHelper.getEntityManager(em));
- return (Employee) query.getSingleResult();
- }
-
- public static void compare(Employee emp1, Employee emp2) {
-
- return;
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/AllTests.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/AllTests.java
deleted file mode 100644
index 09041c6..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/AllTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.das;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { TestEmployeeDAS_Config.class, TestEmployeeDAS_Queries.class, TestEmployeeDAS_Modify.class, TestEmployeeDAS_Create.class, TestEmployeeDAS_Delete.class })
-public class AllTests {
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS.java
deleted file mode 100644
index 463b40b..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.das;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-
-import model.Employee;
-import model.persistence.PersistenceHelper;
-
-import org.eclipse.persistence.internal.helper.SerializationHelper;
-import org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl;
-import org.eclipse.persistence.jaxb.JAXBContext;
-import org.eclipse.persistence.jaxb.JAXBContextFactory;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.sdo.helper.jaxb.JAXBHelperContext;
-import org.junit.*;
-
-import service.EmployeeDAS;
-import testing.jpa.QuerySQLTracker;
-
-import commonj.sdo.DataObject;
-
-/**
- *
- * @author dclarke EclipseLink 1.1
- */
-public abstract class TestEmployeeDAS {
-
- private EmployeeDAS das;
-
- private static EntityManagerFactory emf;
-
- private static JAXBHelperContext context;
-
- public EmployeeDAS getDAS() {
- return this.das;
- }
-
- protected EntityManagerFactory getEMF() {
- return emf;
- }
-
- protected JAXBHelperContext getSDOContext() {
- return context;
- }
-
- public int findMinimumEmployeeId() {
- EntityManager em = getEMF().createEntityManager();
-
- try {
- return (Integer) em.createQuery("SELECT MIN(E.id) FROM Employee e").getSingleResult();
- } finally {
- em.close();
- }
- }
-
- public int findMaximumEmployeeId() {
- EntityManager em = getEMF().createEntityManager();
-
- try {
- return (Integer) em.createQuery("SELECT MAX(E.id) FROM Employee e").getSingleResult();
- } finally {
- em.close();
- }
- }
-
- protected DataObject serialize(DataObject dataObject) {
- try {
- byte[] bytes = SerializationHelper.serialize(dataObject);
- return (DataObject) SerializationHelper.deserialize(bytes);
- } catch (Exception e) {
- Assert.fail("Exception thrown serializing: " + dataObject + "::" + e);
- return null;
- }
- }
-
- protected QuerySQLTracker getTracker() {
- return QuerySQLTracker.getTracker(JpaHelper.getServerSession(getEMF()));
- }
-
- @Before
- public void initializeDAS() {
- this.das = new EmployeeDAS();
-
- this.das.setEMF(emf.createEntityManager());
- this.das.setHelperContext(context);
-
- getTracker().reset();
- }
-
- @After
- public void shutdown() {
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
- List<Employee> deleteEmps = em.createQuery("SELECT e FROM Employee e WHERE e.firstName = 'Delete' and e.lastName = 'Me'").getResultList();
- for (Employee emp : deleteEmps) {
- em.remove(emp);
- }
- em.getTransaction().commit();
- em.close();
-
- this.das.close();
- this.das = null;
- }
-
- @BeforeClass
- public static void intialize() {
- emf = PersistenceHelper.createEMF(null);
- context = PersistenceHelper.createJAXBHelperContext();
-
- JAXBContext jaxbContext = (JAXBContext)context.getJAXBContext();
- jaxbContext.applyORMMetadata(((EntityManagerFactoryImpl)emf).getServerSession());
- QuerySQLTracker.install(JpaHelper.getServerSession(emf));
- }
-
- @AfterClass
- public static void afterClass() {
- if (emf != null && emf.isOpen()) {
- emf.close();
- emf = null;
- }
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Config.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Config.java
deleted file mode 100644
index 197348e..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Config.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.das;
-
-import static junit.framework.Assert.*;
-
-import java.util.Iterator;
-
-import model.*;
-import model.persistence.PersistenceHelper;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.descriptors.changetracking.ChangeTracker;
-import org.eclipse.persistence.internal.descriptors.PersistenceEntity;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.sdo.helper.SDODataFactory;
-import org.eclipse.persistence.sdo.helper.SDOXMLHelper;
-import org.eclipse.persistence.sdo.helper.jaxb.JAXBHelperContext;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.Test;
-
-import commonj.sdo.Type;
-import commonj.sdo.helper.*;
-import commonj.sdo.impl.HelperProvider;
-
-/**
- *
- * @author dclarke EclipseLink 1.1
- */
-public class TestEmployeeDAS_Config extends TestEmployeeDAS {
-
- /**
- * This test is intended to verify that the DAS properly makes its
- * JAXBHelperContext the default one.
- */
- @Test
- public void verifyConfig_JAXBHelperContext() {
- // Note: This call also sets the JAXBHelperContext to be the default so
- // it must be made first
- JAXBHelperContext dasCtx = getDAS().getContext();
- assertNotNull(dasCtx);
-
- HelperContext sdoCtx = HelperProvider.getDefaultContext();
- assertNotNull(sdoCtx);
-
- DataFactory dataFactory = sdoCtx.getDataFactory();
- assertTrue(dataFactory instanceof SDODataFactory);
- //TODO: assertTrue(((SDODataFactory) dataFactory).getHelperContext() instanceof JAXBHelperContext);
-
- XMLHelper xmlHelper = sdoCtx.getXMLHelper();
- assertTrue(xmlHelper instanceof SDOXMLHelper);
- //TODO: assertTrue(((SDOXMLHelper) xmlHelper).getHelperContext() instanceof JAXBHelperContext);
- }
-
- @Test
- public void verifyConfig_JPA() {
- assertNotNull(getEMF());
- Server session = JpaHelper.getServerSession(getEMF());
-
- assertNotNull(session);
-
- for (Iterator dI = session.getDescriptors().values().iterator(); dI.hasNext();) {
- ClassDescriptor descriptor = (ClassDescriptor) dI.next();
- Class javaClass = descriptor.getJavaClass();
-
- if (!descriptor.isAggregateDescriptor()) {
- assertTrue("Entity class not Woven - PersistenceEntity: " + javaClass, PersistenceEntity.class.isAssignableFrom(javaClass));
- assertTrue("Entity class not Woven - ChangeTracker: " + javaClass, ChangeTracker.class.isAssignableFrom(javaClass));
- }
- }
- }
-
- @Test
- public void verifyConfig_SDOTypes() {
- Type employeeType = getDAS().getContext().getTypeHelper().getType(PersistenceHelper.URI, PersistenceHelper.EMPLOYEE_TYPE);
- assertNotNull(employeeType);
- assertSame(employeeType, getDAS().getContext().getType(Employee.class));
-
- Type addressType = getDAS().getContext().getTypeHelper().getType(PersistenceHelper.URI, PersistenceHelper.ADDRESS_TYPE);
- assertNotNull(addressType);
- assertSame(addressType, getDAS().getContext().getType(Address.class));
-
- Type phoneType = getDAS().getContext().getTypeHelper().getType(PersistenceHelper.URI, PersistenceHelper.PHONE_TYPE);
- assertNotNull(phoneType);
- assertSame(phoneType, getDAS().getContext().getType(PhoneNumber.class));
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Create.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Create.java
deleted file mode 100644
index fe8000e..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Create.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.das;
-
-import static junit.framework.Assert.*;
-import model.Employee;
-import model.Gender;
-
-import org.junit.Test;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.Type;
-
-/**
- *
- * @author dclarke EclipseLink 1.1
- */
-public class TestEmployeeDAS_Create extends TestEmployeeDAS {
-
- @Test
- public void createNewEmployee() {
- createNewEmployee(this, "Delete", "Me", Gender.Male);
- }
-
- @Test
- public void createNewEmplyeeWithAddress() {
- Type type = getDAS().getContext().getType(Employee.class);
- DataObject empDO = getDAS().getContext().getDataFactory().create(type);
-
- assertNotNull(empDO);
-
- assertEquals(0, empDO.getInt("id"));
-
- Employee emp = (Employee) getSDOContext().unwrap(empDO);
- assertNotNull(emp);
- assertEquals(0, emp.getId());
-
- empDO.setString("first-name", "Delete");
- empDO.setString("last-name", "Me");
- empDO.setString("gender", Gender.Female.name());
-
- DataObject addressDO = empDO.createDataObject("address");
- addressDO.setString("city", "Ottawa");
-
- getTracker().reset();
-
- getDAS().merge(empDO);
-
- assertEquals(3, getTracker().getTotalSQLINSERTCalls());
- }
-
- @Test
- public void createNewEmplyeeWithAddressAndPhone() {
- Type type = getDAS().getContext().getType(Employee.class);
- DataObject empDO = getDAS().getContext().getDataFactory().create(type);
-
- assertNotNull(empDO);
-
- assertEquals(0, empDO.getInt("id"));
-
- Employee emp = (Employee) getSDOContext().unwrap(empDO);
- assertNotNull(emp);
- assertEquals(0, emp.getId());
-
- empDO.setString("first-name", "Delete");
- empDO.setString("last-name", "Me");
- empDO.setString("gender", Gender.Female.name());
-
- DataObject addressDO = empDO.createDataObject("address");
- addressDO.setString("city", "Ottawa");
-
- DataObject phoneDO = empDO.createDataObject("phone-number");
- phoneDO.setString("number", "6135551212");
- phoneDO.setString("type", "cell");
-
- getTracker().reset();
-
- getDAS().merge(empDO);
-
- assertEquals(4, getTracker().getTotalSQLINSERTCalls());
- }
-
- public static DataObject createNewEmployee(TestEmployeeDAS test, String firstName, String lastName, Gender gender) {
- Type type = test.getDAS().getContext().getType(Employee.class);
- DataObject empDO = test.getDAS().getContext().getDataFactory().create(type);
-
- assertNotNull(empDO);
-
- assertEquals(0, empDO.getInt("id"));
-
- Employee emp = (Employee) test.getSDOContext().unwrap(empDO);
- assertNotNull(emp);
- assertEquals(0, emp.getId());
-
- empDO.setString("first-name", firstName);
- empDO.setString("last-name", lastName);
- empDO.setString("gender", gender.name());
-
- assertEquals(firstName, empDO.getString("first-name"));
- assertEquals(lastName, empDO.getString("last-name"));
- assertEquals(gender.name(), empDO.getString("gender"));
-
- assertEquals(firstName, emp.getFirstName());
- assertEquals(lastName, emp.getLastName());
- assertEquals(gender, emp.getGender());
- assertNull(emp.getAddress());
- assertTrue(emp.getPhoneNumbers().isEmpty());
-
- DataObject persistedDO = test.getDAS().merge(empDO);
-
- assertNotNull("Null DataObject returned from DAS merge", persistedDO);
- int maxId = test.findMaximumEmployeeId();
- assertEquals(maxId, persistedDO.getInt("id"));
-
- return persistedDO;
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Delete.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Delete.java
deleted file mode 100644
index 56a52a9..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Delete.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.das;
-
-import model.Gender;
-
-import org.junit.Test;
-
-import commonj.sdo.DataObject;
-
-/**
- *
- * @author dclarke EclipseLink 1.1
- */
-public class TestEmployeeDAS_Delete extends TestEmployeeDAS {
-
- @Test
- public void deleteEmployee() {
- DataObject newEmpDO = TestEmployeeDAS_Create.createNewEmployee(this, "Delete", "Me", Gender.Male);
-
- getDAS().remove(newEmpDO);
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Modify.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Modify.java
deleted file mode 100644
index b6fc12e..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Modify.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.das;
-
-import static junit.framework.Assert.*;
-
-import model.Address;
-import model.Employee;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.descriptors.changetracking.ChangeTracker;
-import org.eclipse.persistence.internal.descriptors.changetracking.AttributeChangeListener;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.junit.Test;
-
-import commonj.sdo.DataObject;
-
-/**
- *
- * @author dclarke EclipseLink 1.1
- */
-public class TestEmployeeDAS_Modify extends TestEmployeeDAS {
-
- @Test
- public void incrementSalary_Local() {
- int empId = findMinimumEmployeeId();
-
- DataObject empDO = getDAS().findEmployee(empId);
-
- assertNotNull("No Employee DO returned for known employee id", empDO);
- Employee emp = (Employee) getSDOContext().unwrap(empDO);
- assertNotNull("Null POJO in DataObject wrapper", emp);
-
-
- long initialVersion = empDO.getLong("version");
- double initialSalary = empDO.getDouble("salary");
-
- // Double check values in POJO match
- assertEquals(initialVersion, emp.getVersion());
- assertEquals(initialSalary, emp.getSalary());
-
- if (emp instanceof ChangeTracker && ((ChangeTracker) emp)._persistence_getPropertyChangeListener() != null && ((ChangeTracker) emp)._persistence_getPropertyChangeListener() instanceof AttributeChangeListener) {
- assertFalse(JpaHelper.getEntityManager(getDAS().getEntityManager()).getUnitOfWork().hasChanges());
- }
-
- empDO.setDouble("salary", initialSalary + 1);
-
- if (emp instanceof ChangeTracker && ((ChangeTracker) emp)._persistence_getPropertyChangeListener() != null && ((ChangeTracker) emp)._persistence_getPropertyChangeListener() instanceof AttributeChangeListener) {
- assertTrue(JpaHelper.getEntityManager(getDAS().getEntityManager()).getUnitOfWork().hasChanges());
- }
-
- assertEquals("Salary in POJO not incremented", initialSalary + 1, emp.getSalary());
- assertEquals(initialVersion, emp.getVersion());
-
- DataObject empDO2 = getDAS().merge(empDO);
-
- assertSame(empDO, empDO2);
- assertEquals(initialVersion + 1, empDO2.getLong("version"));
- assertEquals(initialSalary + 1, empDO2.getDouble("salary"));
- }
-
- @Test
- public void incrementSalary_Remote() {
- int empId = findMinimumEmployeeId();
-
- DataObject empDO = serialize(getDAS().findEmployee(empId));
-
- assertNotNull("No Employee DO returned for known employee id", empDO);
- Employee emp = (Employee) getSDOContext().unwrap(empDO);
- assertNotNull("Null POJO in DataObject wrapper", emp);
-
-
- long initialVersion = empDO.getLong("version");
- double initialSalary = empDO.getDouble("salary");
-
- // Double check values in POJO match
- assertEquals(initialVersion, emp.getVersion());
- assertEquals(initialSalary, emp.getSalary());
-
- empDO.setDouble("salary", initialSalary + 1);
- assertEquals("Salary in POJO not incremented", initialSalary + 1, emp.getSalary());
- assertEquals(initialVersion, emp.getVersion());
-
- DataObject empDO2 = serialize(getDAS().merge(serialize(empDO)));
-
- assertNotSame(empDO, empDO2);
- assertEquals(initialVersion + 1, empDO2.getLong("version"));
- assertEquals(initialSalary + 1, empDO2.getDouble("salary"));
- }
-
- @Test
- public void testIncrementSalaryWithChangeSummary() {
- int empId = findMinimumEmployeeId();
-
- DataObject empDO = getDAS().findEmployee(empId);
-
- assertNotNull(empDO);
-
- try {
- empDO.getChangeSummary().beginLogging();
- } catch (NullPointerException e) {
- return;
- }
- fail("No NullPOinterException throws accessing ChangeSummary from dataObject");
- }
-
- @Test
- public void testModifyAddress() {
- int empId = findMinimumEmployeeId();
- int maxId = findMaximumEmployeeId();
- DataObject emp1DO = getDAS().findEmployee(empId);
- DataObject emp2DO = getDAS().findEmployee(maxId);
-
- Employee emp = (Employee)getSDOContext().unwrap(emp1DO);
- Employee emp2 = (Employee)getSDOContext().unwrap(emp2DO);
- //Address addrx = emp2.getAddress();
-
- DataObject addrDO = (DataObject)emp2DO.get("address");
- Address addr = (Address)getSDOContext().unwrap(addrDO);
-
- if (emp instanceof ChangeTracker && ((ChangeTracker) emp)._persistence_getPropertyChangeListener() != null && ((ChangeTracker) emp)._persistence_getPropertyChangeListener() instanceof AttributeChangeListener) {
- assertFalse(JpaHelper.getEntityManager(getDAS().getEntityManager()).getUnitOfWork().hasChanges());
- }
-
- emp1DO.set("address", addrDO);
- if (emp instanceof ChangeTracker && ((ChangeTracker) emp)._persistence_getPropertyChangeListener() != null && ((ChangeTracker) emp)._persistence_getPropertyChangeListener() instanceof AttributeChangeListener) {
- assertTrue(JpaHelper.getEntityManager(getDAS().getEntityManager()).getUnitOfWork().getCurrentChanges().getObjectChangeSetForClone(emp).hasChangeFor("address"));
- assertTrue(JpaHelper.getEntityManager(getDAS().getEntityManager()).getUnitOfWork().getCurrentChanges().getObjectChangeSetForClone(emp2).hasChangeFor("address"));
- assertTrue(JpaHelper.getEntityManager(getDAS().getEntityManager()).getUnitOfWork().getCurrentChanges().getObjectChangeSetForClone(addr).hasChangeFor("owner"));
- }
- }
-
- @Test
- public void testModifyPhoneNumbers() {
- int empId = findMinimumEmployeeId();
- int maxId = findMaximumEmployeeId();
- DataObject emp1DO = getDAS().findEmployee(empId);
- DataObject emp2DO = getDAS().findEmployee(maxId);
-
- Employee emp = (Employee)getSDOContext().unwrap(emp1DO);
- Employee emp2 = (Employee)getSDOContext().unwrap(emp2DO);
-
- DataObject phoneDO = (DataObject)emp1DO.getList("phone-number").get(0);
- PhoneNumber phone = (PhoneNumber)getSDOContext().unwrap(phoneDO);
-
- if (emp instanceof ChangeTracker && ((ChangeTracker) emp)._persistence_getPropertyChangeListener() != null && ((ChangeTracker) emp)._persistence_getPropertyChangeListener() instanceof AttributeChangeListener) {
- assertFalse(JpaHelper.getEntityManager(getDAS().getEntityManager()).getUnitOfWork().hasChanges());
- }
-
- emp2DO.getList("phone-number").add(phoneDO);
- assertFalse(emp.getPhoneNumbers().contains(phone));
- if (emp instanceof ChangeTracker && ((ChangeTracker) emp)._persistence_getPropertyChangeListener() != null && ((ChangeTracker) emp)._persistence_getPropertyChangeListener() instanceof AttributeChangeListener) {
- assertTrue(JpaHelper.getEntityManager(getDAS().getEntityManager()).getUnitOfWork().getCurrentChanges().getObjectChangeSetForClone(emp).hasChangeFor("phoneNumbers"));
- assertTrue(JpaHelper.getEntityManager(getDAS().getEntityManager()).getUnitOfWork().getCurrentChanges().getObjectChangeSetForClone(emp2).hasChangeFor("phoneNumbers"));
- assertTrue(JpaHelper.getEntityManager(getDAS().getEntityManager()).getUnitOfWork().getCurrentChanges().getObjectChangeSetForClone(phone).hasChangeFor("owner"));
- }
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Queries.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Queries.java
deleted file mode 100644
index c92ea61..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/das/TestEmployeeDAS_Queries.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.das;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import model.Employee;
-
-import org.eclipse.persistence.internal.helper.SerializationHelper;
-import org.junit.Test;
-
-import testing.SamplePopulation;
-
-import commonj.sdo.DataObject;
-
-/**
- *
- * @author dclarke EclipseLink 1.1
- */
-public class TestEmployeeDAS_Queries extends TestEmployeeDAS {
- @Test
- public void testFind() {
- int empId = findMinimumEmployeeId();
- DataObject empDO = findEmployee(this, empId);
-
- assertNotNull(empDO);
- assertEquals(empId, empDO.getInt("id"));
-
- Employee emp = (Employee) getDAS().getContext().unwrap(empDO);
- assertNotNull(emp);
- }
-
- @Test
- public void serializeExisting() throws Exception {
- int empId = findMinimumEmployeeId();
- DataObject empDO = findEmployee(this, empId);
-
- Employee emp = (Employee) getSDOContext().unwrap(empDO);
- assertEquals(empId, emp.getId());
-
- DataObject serializedDO = (DataObject) SerializationHelper.deserialize(SerializationHelper.serialize(empDO));
-
- assertNotNull(serializedDO);
- assertEquals(empId, serializedDO.getInt("id"));
-
- Employee serializedEmp = (Employee) getSDOContext().unwrap(serializedDO);
-
- assertNotNull(serializedEmp);
-
- SamplePopulation.compare(emp, serializedEmp);
- }
-
- /**
- *
- * @param test
- * @param id
- * @return
- */
- public static DataObject findEmployee(TestEmployeeDAS test, int id) {
- DataObject empDO = test.getDAS().findEmployee(id);
-
- assertNotNull(empDO);
- assertEquals(id, empDO.getInt("id"));
-
- return empDO;
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jaxb/AllTests.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jaxb/AllTests.java
deleted file mode 100644
index fb65833..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jaxb/AllTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.jaxb;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { CreateNewEmployees.class, ReadEmployeesFromDB.class, UpdateDBFromFiles.class })
-public class AllTests {
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jaxb/CreateNewEmployees.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jaxb/CreateNewEmployees.java
deleted file mode 100644
index b60a4f8..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jaxb/CreateNewEmployees.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.jaxb;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-
-import javax.xml.bind.*;
-
-import model.*;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import static junit.framework.Assert.*;
-
-public class CreateNewEmployees {
-
- private static JAXBContext jaxbContext;
-
- @Test
- public void simple() throws Exception {
- Employee employee = new Employee();
- employee.setId(1);
- employee.setFirstName("John");
- employee.setLastName("Doe");
- employee.setGender(Gender.Male);
- employee.setSalary(49999.99);
-
- Address address = new Address();
- address.setId(1);
- address.setCity("Ottawa");
- address.setStreet("123 Somewhere Lane");
- address.setProvince("ON");
- address.setPostalCode("K1A1A1");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- PhoneNumber p1 = employee.addPhoneNumber("Home", "6135551212");
- assertSame(employee, p1.getOwner());
- PhoneNumber p2 = employee.addPhoneNumber("Mobile", "6135552121");
- assertSame(employee, p2.getOwner());
-
- Marshaller marshaller = jaxbContext.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
- StringWriter writer = new StringWriter();
- marshaller.marshal(employee, writer);
-
- System.out.println("XML::\n" + writer.toString());
-
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
-
- Employee emp2 = (Employee) unmarshaller.unmarshal(new StringReader(writer.toString()));
-
- assertNotNull(emp2);
- assertNotSame(employee, emp2);
- assertEquals(employee.getId(), emp2.getId());
- assertEquals(employee.getFirstName(), emp2.getFirstName());
- assertEquals(employee.getLastName(), emp2.getLastName());
- assertEquals(employee.getGender(), emp2.getGender());
- assertEquals(employee.getSalary(), emp2.getSalary());
- assertEquals(employee.getVersion(), emp2.getVersion());
-
- assertNotNull(emp2.getAddress());
- assertEquals(employee.getAddress().getId(), emp2.getId());
- assertEquals(employee.getAddress().getCity(), emp2.getAddress().getCity());
- assertEquals(employee.getAddress().getStreet(), emp2.getAddress().getStreet());
- assertEquals(employee.getAddress().getProvince(), emp2.getAddress().getProvince());
- assertEquals(employee.getAddress().getPostalCode(), emp2.getAddress().getPostalCode());
- assertEquals(employee.getAddress().getCountry(), emp2.getAddress().getCountry());
-
- assertEquals(2, emp2.getPhoneNumbers().size());
- assertSame(emp2, emp2.getPhoneNumbers().get(0).getOwner());
- assertSame(emp2, emp2.getPhoneNumbers().get(1).getOwner());
- }
-
- @BeforeClass
- public static void initializeContext() throws JAXBException {
- jaxbContext = JAXBContext.newInstance("model");
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jaxb/ReadEmployeesFromDB.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jaxb/ReadEmployeesFromDB.java
deleted file mode 100644
index d221ccb..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jaxb/ReadEmployeesFromDB.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.jaxb;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.xml.bind.*;
-
-import model.Employee;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import testing.jpa.EclipseLinkJPATest;
-
-@PersistenceContext(unitName = "employee")
-public class ReadEmployeesFromDB extends EclipseLinkJPATest {
-
- private static JAXBContext jaxbContext;
-
- @Test
- public void simple() throws Exception {
- Marshaller marshaller = jaxbContext.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createNamedQuery("Employee.findAll").getResultList();
-
- new File("./data/temp/").mkdirs();
-
- for (Employee employee : emps) {
- FileOutputStream out = new FileOutputStream("./data/temp/employee-" + employee.getId() + ".xml");
- marshaller.marshal(employee, System.out);
- marshaller.marshal(employee, out);
- out.close();
- }
- }
-
- @BeforeClass
- public static void initializeContext() throws JAXBException {
- jaxbContext = JAXBContext.newInstance("model");
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jaxb/UpdateDBFromFiles.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jaxb/UpdateDBFromFiles.java
deleted file mode 100644
index 8377532..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jaxb/UpdateDBFromFiles.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.jaxb;
-
-import javax.persistence.PersistenceContext;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import testing.jpa.EclipseLinkJPATest;
-
-@PersistenceContext(unitName = "employee")
-public class UpdateDBFromFiles extends EclipseLinkJPATest {
-
- private static JAXBContext jaxbContext;
-
- @Test
- public void test() throws Exception {
- jaxbContext.toString();
- }
-
- @BeforeClass
- public static void initializeContext() throws JAXBException {
- jaxbContext = JAXBContext.newInstance("model");
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/AllTests.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/AllTests.java
deleted file mode 100644
index 05cc4e3..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/AllTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.jpa;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { MappingConfigTests.class, CreateDatabase.class, QueryTests.class, TransactionExamples.class })
-public class AllTests {
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/CreateDatabase.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/CreateDatabase.java
deleted file mode 100644
index 12081b5..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/CreateDatabase.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.jpa;
-
-import static org.eclipse.persistence.config.PersistenceUnitProperties.DDL_GENERATION;
-import static org.eclipse.persistence.config.PersistenceUnitProperties.DROP_AND_CREATE;
-
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-
-
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-import org.junit.Test;
-
-import testing.SamplePopulation;
-
-/**
- * Utility class to create the database schema and populate it for the Employee
- * JPA example using XML configuration. This
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-public class CreateDatabase extends EclipseLinkJPATest {
-
- @Test
- public void createDatabase() {
- EntityManager em = getEntityManager();
-
- new SchemaManager(JpaHelper.getEntityManager(em).getServerSession()).replaceSequences();
-
- em.getTransaction().begin();
-
- SamplePopulation.population.persistAll(em);
-
- em.getTransaction().commit();
- }
-
- @Override
- protected Map getEMFProperties() {
- Map properties = super.getEMFProperties();
- properties.put(DDL_GENERATION, DROP_AND_CREATE);
- return properties;
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/EclipseLinkJPATest.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/EclipseLinkJPATest.java
deleted file mode 100644
index 52523c3..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/EclipseLinkJPATest.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package testing.jpa;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.persistence.*;
-
-import junit.framework.Assert;
-
-import model.persistence.PersistenceHelper;
-
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.junit.After;
-import org.junit.AfterClass;
-
-import testing.jpa.util.QuerySQLTracker;
-
-
-/**
- * Base test case for testing a JPA persistence unit in JavaSE using JUnit4.
- *
- * Through the usage
- *
- * @PersistenceContext on subclasses a developer can indicate the persistence
- * unit name that the
- * @BeforeClass method should use to access the entityManager.
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-@PersistenceContext(unitName="employee")
-public abstract class EclipseLinkJPATest {
-
- /**
- * This is he current EMF in use
- */
- private static EntityManagerFactory emf;
-
- private EntityManager entityManager;
-
- protected EntityManagerFactory getEMF() {
- if (emf == null) {
- emf = createEMF();
- }
-
- return emf;
- }
-
- protected EntityManager getEntityManager() {
- if (this.entityManager == null) {
- this.entityManager = getEMF().createEntityManager();
- }
-
- return this.entityManager;
- }
-
- private EntityManagerFactory createEMF() {
- try {
- return createEMF(getUnitName(), null);
- } catch (RuntimeException e) {
- System.out.println("Persistence.createEMF FAILED: " + e.getMessage());
- e.printStackTrace();
- throw e;
- }
- }
-
- private String getUnitName() {
- PersistenceContext context = null;
- Class javaClass = getClass();
-
- while (context == null && javaClass != Object.class) {
- context = (PersistenceContext) javaClass.getAnnotation(PersistenceContext.class);
- javaClass = javaClass.getSuperclass();
- }
- Assert.assertNotNull("No @PersistenceContext found", context);
-
- return context.unitName();
- }
-
- /**
- *
- * @param properties
- * @return
- */
- protected EntityManagerFactory createEMF(String unitName, Map properties) {
- Map emfProps = getEMFProperties();
-
- if (properties != null) {
- emfProps.putAll(properties);
- }
-
- try {
- EntityManagerFactory emf = Persistence.createEntityManagerFactory(unitName, emfProps);
- QuerySQLTracker.install(JpaHelper.getServerSession(emf));
- return emf;
- } catch (RuntimeException e) {
- System.out.println("Persistence.createEMF FAILED: " + e.getMessage());
- e.printStackTrace();
- throw e;
- }
- }
-
- /**
- *
- * @return
- */
- protected Map getEMFProperties() {
- Map properties = new HashMap();
- PersistenceHelper.applyUserHomeProperties(properties);
- return properties;
- }
-
-
- protected QuerySQLTracker getQuerySQLTracker(EntityManager em) {
- return QuerySQLTracker.getTracker(JpaHelper.getEntityManager(em).getActiveSession());
- }
-
- @After
- public void cleanupClosedEMF() {
- if (this.entityManager != null) {
-
- if (this.entityManager.getTransaction().isActive()) {
- this.entityManager.getTransaction().rollback();
- }
- if (this.entityManager.isOpen()) {
- this.entityManager.close();
- }
- }
- this.entityManager = null;
-
- if (emf != null) {
- if (!emf.isOpen()) {
- emf = null;
- } else {
- QuerySQLTracker.getTracker(JpaHelper.getServerSession(emf)).reset();
- }
- }
- }
-
- @AfterClass
- public static void closeEMF() throws Exception {
- if (emf != null && emf.isOpen()) {
- emf.close();
- emf = null;
- }
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/MappingConfigTests.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/MappingConfigTests.java
deleted file mode 100644
index 394dba2..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/MappingConfigTests.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.jpa;
-
-import static org.junit.Assert.*;
-import model.*;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-import org.eclipse.persistence.mappings.OneToOneMapping;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.Test;
-
-/**
- * Set of tests to ensure the mappings are properly populated from the provided
- * annotations/xml.
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-public class MappingConfigTests extends EclipseLinkJPATest {
-
- @Test
- public void verifyServerSession() {
- Server session = JpaHelper.getServerSession(getEMF());
-
- assertNotNull(session);
- assertTrue(session.isConnected());
- assertTrue(session.isServerSession());
- assertEquals(1, session.getReadConnectionPool().getMinNumberOfConnections());
- assertEquals(1, session.getDefaultConnectionPool().getMinNumberOfConnections());
-
- assertTrue(session.getName().startsWith("file"));
- assertTrue(session.getName().endsWith("employee"));
- }
-
- @Test
- public void verifyEmployeeDescriptor() {
- Server session = JpaHelper.getServerSession(getEMF());
- ClassDescriptor descriptor = session.getClassDescriptor(Employee.class);
-
- assertNotNull(descriptor);
- assertEquals("Employee", descriptor.getAlias());
- assertNull(descriptor.getInheritancePolicyOrNull());
-
- // Address Mapping
- OneToOneMapping addrMapping = (OneToOneMapping) descriptor.getMappingForAttributeName("address");
- assertNotNull(addrMapping);
- assertTrue(addrMapping.isPrivateOwned());
-
- // PhoenNumber Mapping
- OneToManyMapping phoneMapping = (OneToManyMapping) descriptor.getMappingForAttributeName("phoneNumbers");
- assertNotNull(phoneMapping);
- assertTrue(phoneMapping.isPrivateOwned());
- }
-
- @Test
- public void verifyAddressDescriptor() {
- Server session = JpaHelper.getServerSession(getEMF());
- ClassDescriptor descriptor = session.getClassDescriptor(Address.class);
-
- assertNotNull(descriptor);
- assertEquals("Address", descriptor.getAlias());
- assertNull(descriptor.getInheritancePolicyOrNull());
- }
-
- @Test
- public void verifyPhoneNumberDescriptor() {
- Server session = JpaHelper.getServerSession(getEMF());
- ClassDescriptor descriptor = session.getClassDescriptor(PhoneNumber.class);
-
- assertNotNull(descriptor);
- assertEquals("PhoneNumber", descriptor.getAlias());
- assertNull(descriptor.getInheritancePolicyOrNull());
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/QuerySQLTracker.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/QuerySQLTracker.java
deleted file mode 100644
index d2d609b..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/QuerySQLTracker.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.jpa;
-
-import java.io.StringWriter;
-import java.util.*;
-
-import org.eclipse.persistence.descriptors.DescriptorEvent;
-import org.eclipse.persistence.descriptors.DescriptorEventAdapter;
-import org.eclipse.persistence.internal.helper.Helper;
-import org.eclipse.persistence.logging.*;
-import org.eclipse.persistence.queries.DatabaseQuery;
-import org.eclipse.persistence.sessions.*;
-
-/**
- *
- * @author dclarke
- * @since TopLink 10.1.3
- */
-public class QuerySQLTracker extends SessionEventAdapter {
- private List<QueryResult> queries;
-
- /**
- * Constructs and installs the event listener and sql tracking session log
- *
- * @param session
- */
- private QuerySQLTracker(Session session) {
- session.getEventManager().addListener(this);
- session.setSessionLog(new SQLTrackingSessionLog(session, this));
- reset();
- }
-
- public static QuerySQLTracker install(Session session) {
- if (session.getSessionLog() instanceof SQLTrackingSessionLog) {
- return ((SQLTrackingSessionLog) session.getSessionLog()).getTracker();
- }
- return new QuerySQLTracker(session);
- }
-
- /**
- * Helper method to retrieve a tracker from a session where it was installed
- * If the session exists but does not have a tracler installed then an
- * exception is thrown.
- */
- public static QuerySQLTracker getTracker(Session session) {
- if (session == null) {
- return null;
- }
- SessionLog sessionLog = session.getSessionLog();
-
- if (sessionLog instanceof QuerySQLTracker.SQLTrackingSessionLog) {
- return ((QuerySQLTracker.SQLTrackingSessionLog) sessionLog).getTracker();
- }
- throw new RuntimeException("Could not retireve QuerySQLTracke from session: " + session);
- }
-
- /**
- * Reset the lists of SQL and queries being tracked
- */
- public void reset() {
- this.queries = new ArrayList<QueryResult>();
- }
-
- public List<QueryResult> getQueries() {
- return this.queries;
- }
-
- protected void addBuiltObject(DatabaseQuery query, Object object) {
-
- }
-
- protected QuerySQLTracker.QueryResult getCurrentResult() {
- if (getQueries().size() == 0) {
- getQueries().add(new QueryResult(null));
- // throw new RuntimeException("Received SQL without a Query ???");
- }
- return getQueries().get(getQueries().size() - 1);
- }
-
- public int getTotalSQLCalls() {
- int totalSQLCalls = 0;
-
- for (QueryResult result : getQueries()) {
- totalSQLCalls += result.sqlStatements.size();
- }
-
- return totalSQLCalls;
- }
-
- public int getTotalSQLCalls(String startsWith) {
- int sqlCalls = 0;
-
- for (QueryResult result : getQueries()) {
- for (String sql : result.sqlStatements) {
- String sub = sql.substring(0, startsWith.length());
- if (sub.equalsIgnoreCase(startsWith)) {
- sqlCalls++;
- }
- }
- }
-
- return sqlCalls;
- }
-
- public int getTotalSQLSELECTCalls() {
- return getTotalSQLCalls("SELECT");
- }
-
- public int getTotalSQLINSERTCalls() {
- return getTotalSQLCalls("INSERT");
- }
-
- public int getTotalSQLUPDATECalls() {
- return getTotalSQLCalls("UPDATE");
- }
-
- public int getTotalSQLDELETECalls() {
- return getTotalSQLCalls("DELETE");
- }
-
- public void preExecuteQuery(SessionEvent event) {
- if (event.getQuery() == null) {
- System.out.println("HOW?");
- }
- QueryResult result = new QueryResult(event.getQuery());
- getQueries().add(result);
- }
-
- public void postExecuteQuery(SessionEvent event) {
- if (getCurrentResult().query == null) {
- getCurrentResult().setQuery(event.getQuery());
- }
- getCurrentResult().setResult(event.getResult());
- }
-
- protected class QueryResult {
- private DatabaseQuery query;
- private String resultString = null;
- private List<String> sqlStatements = new ArrayList<String>();
-
- QueryResult(DatabaseQuery q) {
- query = q;
- }
-
- protected void setQuery(DatabaseQuery query) {
- this.query = query;
- }
-
- protected void setResult(Object queryResult) {
- StringWriter writer = new StringWriter();
- writer.write(Helper.getShortClassName(query));
- writer.write("[" + System.identityHashCode(query) + "]");
- writer.write(" result = ");
-
- Object result = queryResult;
- if (queryResult instanceof Collection) {
- result = ((Collection) queryResult).toArray();
- }
-
- if (result == null) {
- writer.write("NONE");
- } else {
- if (result instanceof Object[]) {
- Object[] results = (Object[]) result;
- writer.write("<" + results.length + "> [");
- for (int index = 0; index < results.length; index++) {
- if (index > 0) {
- writer.write(", ");
- }
- writer.write(results[index] + "");
- }
- writer.write("]");
- resultString = writer.toString();
- } else {
- writer.write(result.toString());
- }
- }
-
- this.resultString = writer.toString();
- }
-
- public void addSQL(String sql) {
- sqlStatements.add(sql);
- }
-
- public String toString() {
- if (this.resultString == null) {
- setResult(null);
- }
- return this.resultString;
- }
- }
-
- /**
- * This custom SessionLog implementation wraps the existng one and redirects
- * all SQL calls to the tracker. All messages are also passed to the orginal
- * tracker.
- */
- public class SQLTrackingSessionLog extends DefaultSessionLog {
- private QuerySQLTracker tracker;
-
- private SessionLog originalLog;
-
- protected SQLTrackingSessionLog(Session session, QuerySQLTracker aTracker) {
- this.tracker = aTracker;
- this.originalLog = session.getSessionLog();
- setLevel(this.originalLog.getLevel());
- setSession(session);
- setWriter(this.originalLog.getWriter());
- }
-
- public QuerySQLTracker getTracker() {
- return this.tracker;
- }
-
- public synchronized void log(SessionLogEntry entry) {
-
- if (entry.getNameSpace() != null && entry.getNameSpace().equalsIgnoreCase(SessionLog.SQL)) {
- getTracker().getCurrentResult().addSQL(entry.getMessage());
- }
- super.log(entry);
- }
- }
-
- public void printResults(String prefix) {
- System.out.println(prefix + "-QuerySQLTracker-Queries:");
-
- int sql = 0;
- for (int index = 0; index < getQueries().size(); index++) {
- QueryResult result = getQueries().get(index);
-
- System.out.println("\t" + (index + 1) + "> " + result);
-
- for (int sqlNum = 0; sqlNum < result.sqlStatements.size(); sqlNum++) {
- sql++;
- System.out.println("\t\t" + (index + 1) + "." + (sqlNum + 1) + "-" + sql + "> " + result.sqlStatements.get(sqlNum));
- }
- }
-
- System.out.println(prefix + "-QuerySQLTracker-Queries: " + getQueries().size());
- System.out.println(prefix + "-QuerySQLTracker-INSERT: " + getTotalSQLINSERTCalls());
- System.out.println(prefix + "-QuerySQLTracker-SELECT: " + getTotalSQLSELECTCalls());
- System.out.println(prefix + "-QuerySQLTracker-UPDATE: " + getTotalSQLUPDATECalls());
- System.out.println(prefix + "-QuerySQLTracker-DELETE: " + getTotalSQLDELETECalls());
- }
-
- static class DescriptorBuildCounter extends DescriptorEventAdapter {
- private QuerySQLTracker querySQLTracker;
-
- private DescriptorBuildCounter(QuerySQLTracker tracker) {
- this.querySQLTracker = tracker;
- }
-
- public void postBuild(DescriptorEvent event) {
- this.querySQLTracker.addBuiltObject(event.getQuery(), event.getSource());
- }
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/QueryTests.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/QueryTests.java
deleted file mode 100644
index be4c4e2..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/QueryTests.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.jpa;
-
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.List;
-
-import javax.persistence.*;
-
-import model.Employee;
-import model.Gender;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.ReadAllQuery;
-import org.junit.Test;
-
-import testing.SamplePopulation;
-
-/**
- * Simple query examples for the XML mapped Employee domain model.
- *
- * @author dclarke
- * @since EclipseLink 1.0
- */
-@PersistenceContext(unitName = "employee")
-public class QueryTests extends EclipseLinkJPATest {
-
- protected static int minimumEmployeeId(EntityManager em) {
- return ((Number) em.createQuery("SELECT MIN(e.id) FROM Employee e").getSingleResult()).intValue();
- }
-
- /**
- * Simple example using dynamic JP QL to retrieve all Employee instances
- * sorted by lastName and firstName.
- */
- @Test
- public void readAllEmployees_JPQL() {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e ORDER BY e.lastName ASC, e.firstName ASC").getResultList();
-
- SamplePopulation.population.assertSame(emps);
- }
-
- @Test
- public void joinFetchJPQL() {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address ORDER BY e.lastName ASC, e.firstName ASC").getResultList();
-
- assertNotNull(emps);
- }
-
- @Test
- public void joinFetchHint() {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.manager.address.city = 'Ottawa' ORDER BY e.lastName ASC, e.firstName ASC");
- query.setHint(QueryHints.FETCH, "e.address");
- query.setHint(QueryHints.FETCH, "e.manager");
- query.setHint(QueryHints.FETCH, "e.manager.address");
- query.setHint(QueryHints.BATCH, "e.manager.phoneNumbers");
- List<Employee> emps = query.getResultList();
-
- for (Employee emp : emps) {
- emp.getManager().getPhoneNumbers().size();
- }
-
- assertNotNull(emps);
- }
-
- @Test
- public void minEmployeeId() {
- int minId = minimumEmployeeId(getEntityManager());
-
- assertTrue(minId > 0);
- }
-
- @Test
- public void testLazyLoading() {
- EntityManager em = getEntityManager();
- int minEmpId = minimumEmployeeId(em);
-
- Employee emp = em.find(Employee.class, minEmpId);
- assertNotNull(emp);
- }
-
- @Test
- public void testGenderIn() throws Exception {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e WHERE e.gender IN (:GENDER1, :GENDER2)").setParameter("GENDER1", Gender.Male).setParameter("GENDER2", Gender.Female)
- .getResultList();
-
- assertNotNull(emps);
- }
-
- @Test
- public void testReadAllExressions() throws Exception {
- EntityManager em = getEntityManager();
-
- ReadAllQuery raq = new ReadAllQuery(Employee.class);
- ExpressionBuilder eb = raq.getExpressionBuilder();
- raq.setSelectionCriteria(eb.get("gender").equal(Gender.Male));
-
- Query query = JpaHelper.createQuery(raq, em);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/SamplePopulation.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/SamplePopulation.java
deleted file mode 100644
index 4ead2b7..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/SamplePopulation.java
+++ /dev/null
@@ -1,532 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.jpa;
-
-import java.util.*;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import junit.framework.Assert;
-import model.*;
-
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.internal.jpa.EJBQueryImpl;
-import org.eclipse.persistence.internal.jpa.EntityManagerImpl;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.*;
-
-public class SamplePopulation {
-
- public static SamplePopulation population = new SamplePopulation();
-
- private Employee[] employees = { basicEmployeeExample1(), basicEmployeeExample2(), basicEmployeeExample3(), basicEmployeeExample4(), basicEmployeeExample5(), basicEmployeeExample6(),
- basicEmployeeExample7(), basicEmployeeExample8(), basicEmployeeExample9(), basicEmployeeExample10(), basicEmployeeExample11(), basicEmployeeExample12() };
-
- private SamplePopulation() {
- addManagedEmployees(0, new int[] { 2, 3, 4 });
- addManagedEmployees(1, new int[] { 5, 0 });
- addManagedEmployees(2, new int[] {});
- addManagedEmployees(3, new int[] {});
- addManagedEmployees(4, new int[] {});
- addManagedEmployees(5, new int[] {});
- addManagedEmployees(6, new int[] {});
- addManagedEmployees(7, new int[] {});
- addManagedEmployees(8, new int[] {});
- addManagedEmployees(9, new int[] { 11 });
- addManagedEmployees(10, new int[] { 6 });
- addManagedEmployees(11, new int[] { 1 });
- }
-
- public Employee basicEmployeeExample1() {
- Employee employee = new Employee();
-
- employee.setFirstName("Bob");
- employee.setLastName("Smith");
- employee.setGender(Gender.Male);
- employee.setSalary(35000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(1996, 0, 1);
- employmentPeriod.setStartDate(1993, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Toronto");
- address.setPostalCode("L5J2B5");
- address.setProvince("ONT");
- address.setStreet("1450 Acme Cr., Suite 4");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Water the office plants.");
- employee.addResponsibility("Maintain the kitchen facilities.");
- employee.addPhoneNumber("Work", "6135558812");
-
- return employee;
- }
-
- public Employee basicEmployeeExample10() {
- Employee employee = new Employee();
-
- employee.setFirstName("Jill");
- employee.setLastName("May");
- employee.setGender(Gender.Female);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setStartDate(1991, 10, 11);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Calgary");
- address.setPostalCode("J5J2B5");
- address.setProvince("AB");
- address.setStreet("1111 Mooseland Rd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.setSalary(56232);
- employee.addPhoneNumber("Work", "6135558812");
- employee.addPhoneNumber("Work Fax", "6135555943");
-
- return employee;
- }
-
- public Employee basicEmployeeExample11() {
- Employee employee = new Employee();
-
- employee.setFirstName("Sarah-Lou");
- employee.setLastName("Smitty");
- employee.setGender(Gender.Female);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(1996, 0, 1);
- employmentPeriod.setStartDate(1993, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Arnprior");
- address.setPostalCode("W1A2B5");
- address.setProvince("ONT");
- address.setStreet("1 Hawthorne Drive");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.setSalary(75000);
- employee.addPhoneNumber("Work Fax", "6135555943");
- employee.addPhoneNumber("Home", "6135551234");
- employee.addPhoneNumber("Cellular", "4165551111");
-
- return employee;
- }
-
- public Employee basicEmployeeExample12() {
- Employee employee = new Employee();
-
- employee.setFirstName("Jim-Bob");
- employee.setLastName("Jefferson");
- employee.setGender(Gender.Male);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 12);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Yellowknife");
- address.setPostalCode("Y5J2N5");
- address.setProvince("YK");
- address.setStreet("1112 Gold Rush Rd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.setSalary(50000);
- employee.addPhoneNumber("Home", "6135551234");
- employee.addPhoneNumber("Cellular", "4165551111");
-
- return employee;
- }
-
- public Employee basicEmployeeExample2() {
- Employee employee = new Employee();
-
- employee.setFirstName("John");
- employee.setLastName("Way");
- employee.setGender(Gender.Male);
- employee.setSalary(53000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setStartDate(1991, 10, 11);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Ottawa");
- address.setPostalCode("K5J2B5");
- address.setProvince("ONT");
- address.setStreet("12 Merivale Rd., Suite 5");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Hire people when more people are required.");
- employee.addResponsibility("Lay off employees when less people are required.");
- employee.addPhoneNumber("Work", "6135558812");
- employee.addPhoneNumber("ISDN", "9055553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample3() {
- Employee employee = new Employee();
-
- employee.setFirstName("Charles");
- employee.setLastName("Chanley");
- employee.setGender(Gender.Male);
- employee.setSalary(43000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Montreal");
- address.setPostalCode("Q2S5Z5");
- address.setProvince("QUE");
- address.setStreet("1 Canadien Place");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Perform code reviews as required.");
- employee.addPhoneNumber("Pager", "9765556666");
- employee.addPhoneNumber("ISDN", "9055553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample4() {
- Employee employee = new Employee();
-
- employee.setFirstName("Emanual");
- employee.setLastName("Smith");
- employee.setGender(Gender.Male);
- employee.setSalary(49631);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Vancouver");
- address.setPostalCode("N5J2N5");
- address.setProvince("BC");
- address.setStreet("20 Mountain Blvd., Floor 53, Suite 6");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Have to fix the Database problem.");
- employee.addPhoneNumber("Work Fax", "6135555943");
- employee.addPhoneNumber("Cellular", "4165551111");
- employee.addPhoneNumber("Pager", "9765556666");
- employee.addPhoneNumber("ISDN", "9055553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample5() {
- Employee employee = new Employee();
-
- employee.setFirstName("Sarah");
- employee.setLastName("Way");
- employee.setGender(Gender.Female);
- employee.setSalary(87000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 6, 31);
- employmentPeriod.setStartDate(1995, 4, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Prince Rupert");
- address.setPostalCode("K3K5D5");
- address.setProvince("BC");
- address.setStreet("3254 Parkway Place");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Write code documentation.");
- employee.addPhoneNumber("Work", "6135558812");
- employee.addPhoneNumber("ISDN", "9055553691");
- employee.addPhoneNumber("Home", "6135551234");
-
- return employee;
- }
-
- public Employee basicEmployeeExample6() {
- Employee employee = new Employee();
-
- employee.setFirstName("Marcus");
- employee.setLastName("Saunders");
- employee.setGender(Gender.Male);
- employee.setSalary(54300);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 12);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Perth");
- address.setPostalCode("Y3Q2N9");
- address.setProvince("ONT");
- address.setStreet("234 Caledonia Lane");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Write user specifications.");
- employee.addPhoneNumber("ISDN", "9055553691");
- employee.addPhoneNumber("Work", "6135558812");
-
- return employee;
- }
-
- public Employee basicEmployeeExample7() {
- Employee employee = new Employee();
-
- employee.setFirstName("Nancy");
- employee.setLastName("White");
- employee.setGender(Gender.Female);
- employee.setSalary(31000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(1996, 0, 1);
- employmentPeriod.setStartDate(1993, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Metcalfe");
- address.setPostalCode("Y4F7V6");
- address.setProvince("ONT");
- address.setStreet("2 Anderson Rd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addPhoneNumber("Home", "6135551234");
-
- return employee;
- }
-
- public Employee basicEmployeeExample8() {
- Employee employee = new Employee();
-
- employee.setFirstName("Fred");
- employee.setLastName("Jones");
- employee.setGender(Gender.Male);
- employee.setSalary(500000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Victoria");
- address.setPostalCode("Z5J2N5");
- address.setProvince("BC");
- address.setStreet("382 Hyde Park Blvd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addPhoneNumber("Cellular", "4165551111");
- employee.addPhoneNumber("ISDN", "9055553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample9() {
- Employee employee = new Employee();
-
- employee.setFirstName("Betty");
- employee.setLastName("Jones");
- employee.setGender(Gender.Female);
- employee.setSalary(500001);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setStartDate(2001, 11, 31);
- employmentPeriod.setEndDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Smith Falls");
- address.setPostalCode("C6C6C6");
- address.setProvince("ONT");
- address.setStreet("89 Chocolate Drive");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addPhoneNumber("Work", "6135558812");
- employee.addPhoneNumber("ISDN", "9055553691");
-
- return employee;
- }
-
- private void addManagedEmployees(int managerIndex, int[] employeeIndeces) {
- Employee manager = this.employees[managerIndex];
-
- if (manager.getManagedEmployees().isEmpty()) {
- for (int index = 0; index < employeeIndeces.length; index++) {
- manager.addManagedEmployee(this.employees[employeeIndeces[index]]);
- }
- }
- }
-
- /**
- * Register all of the population in the provided EntityManager to be
- * persisted This method should only be called from within a test case. It
- * asserts that the provided EntityManager is in a transaction and that the
- * database tables are empty.
- */
- public void persistAll(EntityManager em) {
- Assert.assertTrue("EntityManager not in Transaction", em.getTransaction().isActive());
-
- // Verify that the database tables are empty
- assertCount(em, Employee.class, 0);
- assertCount(em, Address.class, 0);
- assertCount(em, PhoneNumber.class, 0);
-
- for (int index = 0; index < this.employees.length; index++) {
- em.persist(this.employees[index]);
- }
-
- em.flush();
- verifyCounts(em);
- }
-
- public void verifyCounts(EntityManager em) {
- assertCount(em, Employee.class, this.employees.length);
- assertCount(em, Address.class, this.employees.length);
- }
-
- /**
- * Verify that the provided entity type has no rows in the database using a
- * native ReportQuery.
- *
- * @param entityClass
- * @param count
- */
- public void assertCount(EntityManager em, Class entityClass, int count) {
- ReportQuery query = new ReportQuery(entityClass, new ExpressionBuilder());
- query.addCount();
- query.setShouldReturnSingleValue(true);
-
- int dbCount = ((Number) JpaHelper.getEntityManager(em).getUnitOfWork().executeQuery(query)).intValue();
- Assert.assertEquals("Incorrect quantity found of " + entityClass, count, dbCount);
- }
-
- /**
- * Verify that the provided list of Employee instances matches the sample
- * population.
- *
- * @param employees
- */
- public void assertSame(List<Employee> dbEmps) {
- Assert.assertEquals("Incorrect quantity of employees", this.employees.length, dbEmps.size());
-
- Collections.sort(dbEmps, new EmployeeComparator());
-
- for (int index = 0; index < this.employees.length; index++) {
- Employee emp = employees[index];
- Employee dbEmp = dbEmps.get(index);
-
- Assert.assertEquals("First name does not match on employees[" + index + "]", emp.getFirstName(), dbEmp.getFirstName());
- Assert.assertEquals("Last name does not match on employees[" + index + "]", emp.getLastName(), dbEmp.getLastName());
- Assert.assertEquals("Salary does not match on employees[" + index + "]", emp.getSalary(), dbEmp.getSalary());
- }
- }
-
- /**
- * Simple comparator used to order the employees for use within assertSame
- */
- class EmployeeComparator implements Comparator<Employee> {
-
- public int compare(Employee emp1, Employee emp2) {
- return emp1.getId() - emp2.getId();
- }
-
- }
-
- /**
- * Extract the id's from the sample Employee instances.
- *
- * @param em
- * @return
- */
- public int[] getEmployeeIds(EntityManager em) {
- int[] ids = new int[this.employees.length];
-
- for (int index = 0; index < this.employees.length; index++) {
- if (this.employees[index].getId() <= 0) {
- Employee emp = queryByExample(em, this.employees[index]);
-
- if (emp == null) {
- throw new RuntimeException("Could not find Employee: " + this.employees[index]);
- }
- this.employees[index].setId(emp.getId());
- }
- ids[index] = this.employees[index].getId();
- }
-
- return ids;
- }
-
- /**
- * Reset the database so that only the sample population exists.
- *
- * @param em
- */
- public void resetDatabase(EntityManager em) {
- em.getTransaction().begin();
-
- DeleteAllQuery deleteEmpsQuery = new DeleteAllQuery(Employee.class);
- ExpressionBuilder eb = deleteEmpsQuery.getExpressionBuilder();
- deleteEmpsQuery.setSelectionCriteria(eb.get("id").notIn(getEmployeeIds(em)));
- deleteEmpsQuery.setFlushOnExecute(true);
-
- JpaHelper.getEntityManager(em).getUnitOfWork().executeQuery(deleteEmpsQuery);
-
- em.getTransaction().commit();
- }
-
- /**
- * Example of EclipseLink's native query-by-example support.
- *
- * @param em
- * @param sampleEmployee
- * @return
- */
- public Employee queryByExample(EntityManager em, Employee sampleEmployee) {
- QueryByExamplePolicy policy = new QueryByExamplePolicy();
- policy.excludeDefaultPrimitiveValues();
- ReadObjectQuery roq = new ReadObjectQuery(sampleEmployee, policy);
- // Wrap the native query in a JPA Query and execute it.
- Query query = new EJBQueryImpl(roq, (EntityManagerImpl) JpaHelper.getEntityManager(em));
- return (Employee) query.getSingleResult();
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/TransactionExamples.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/TransactionExamples.java
deleted file mode 100644
index 0f60bcf..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/TransactionExamples.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.jpa;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-
-import junit.framework.Assert;
-import model.*;
-
-import org.eclipse.persistence.config.PessimisticLock;
-import org.eclipse.persistence.config.QueryHints;
-import org.junit.Test;
-
-import testing.SamplePopulation;
-
-public class TransactionExamples extends EclipseLinkJPATest {
-
- @Test
- public void pessimisticLocking() throws Exception {
- EntityManager em = getEntityManager();
-
- // Find the Employee with the minimum ID
- int minId = QueryTests.minimumEmployeeId(em);
-
- em.getTransaction().begin();
-
- // Lock Employee using query with hint
- Employee emp = (Employee) em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID").setParameter("ID", minId).setHint(QueryHints.PESSIMISTIC_LOCK, PessimisticLock.Lock).getSingleResult();
-
- emp.setSalary(emp.getSalary() - 1);
-
- em.flush();
- }
-
- @Test
- public void updateEmployeeWithCity() throws Exception {
- EntityManager em = getEntityManager();
-
- em.getTransaction().begin();
-
- List<Object[]> emps = em.createQuery("SELECT e, e.address.city FROM Employee e").getResultList();
- Employee emp = (Employee) emps.get(0)[0];
- emp.setSalary(emp.getSalary() + 1);
-
- em.flush();
-
- em.getTransaction().rollback();
-
- SamplePopulation.population.resetDatabase(em);
- }
-
- @Test
- public void createUsingPersist() throws Exception {
- EntityManager em = getEntityManager();
-
- Employee emp = new Employee();
- emp.setFirstName("Sample");
- emp.setLastName("Employee");
- emp.setGender(Gender.Male);
- emp.setSalary(123456);
-
- Address address = new Address();
- emp.setAddress(address);
-
- emp.addPhoneNumber("Mobile", "6135551212");
-
- em.getTransaction().begin();
- em.persist(emp);
- em.getTransaction().commit();
-
- Assert.assertNotNull(emp);
- Assert.assertTrue(emp.getId() > 0);
-
- em.getTransaction().begin();
- em.createQuery("DELETE from PhoneNumber p WHERE p.owner.id = " + emp.getId()).executeUpdate();
- em.createQuery("DELETE from Employee e WHERE e.id = " + emp.getId()).executeUpdate();
- em.createQuery("DELETE from Address a WHERE a.id = " + emp.getAddress().getId()).executeUpdate();
- em.getTransaction().commit();
-
- SamplePopulation.population.verifyCounts(em);
- }
-
- @Test
- public void createUsingMerge() throws Exception {
- EntityManager em = getEntityManager();
-
- Employee emp = new Employee();
- emp.setFirstName("Sample");
- emp.setLastName("Employee");
- emp.setGender(Gender.Male);
- emp.setSalary(123456);
-
- Address address = new Address();
- emp.setAddress(address);
-
- emp.addPhoneNumber("Mobile", "6135551212");
-
- em.getTransaction().begin();
- // When merging the managed instance is returned from the call.
- // Further usage within the transaction must be done with this managed
- // entity.
- emp = em.merge(emp);
- em.getTransaction().commit();
-
- Assert.assertNotNull(emp);
- Assert.assertTrue(emp.getId() > 0);
-
- em.getTransaction().begin();
- em.createQuery("DELETE from PhoneNumber p WHERE p.owner.id = " + emp.getId()).executeUpdate();
- em.createQuery("DELETE from Employee e WHERE e.id = " + emp.getId()).executeUpdate();
- em.createQuery("DELETE from Address a WHERE a.id = " + emp.getAddress().getId()).executeUpdate();
- em.getTransaction().commit();
-
- SamplePopulation.population.verifyCounts(em);
- }
-
- @Test
- public void incrementSalary() {
- EntityManager em = getEntityManager();
-
- Employee emp = (Employee) em.createQuery("SELECT e FROM Employee e WHERE e.id IN (SELECT MIN(ee.id) FROM Employee ee)").getSingleResult();
- assertNotNull("Null POJO in DataObject wrapper", emp);
-
- long initialVersion = emp.getVersion();
- double initialSalary = emp.getSalary();
-
- emp.setSalary(initialSalary + 1);
-
- em.getTransaction().begin();
- em.merge(emp);
- em.getTransaction().commit();
-
- assertEquals(initialVersion + 1, emp.getVersion());
- assertEquals(initialSalary + 1, emp.getSalary());
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/util/QuerySQLTracker.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/util/QuerySQLTracker.java
deleted file mode 100644
index e5b463b..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/jpa/util/QuerySQLTracker.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package testing.jpa.util;
-
-import java.io.StringWriter;
-import java.util.*;
-
-import org.eclipse.persistence.descriptors.DescriptorEvent;
-import org.eclipse.persistence.descriptors.DescriptorEventAdapter;
-import org.eclipse.persistence.internal.helper.Helper;
-import org.eclipse.persistence.logging.*;
-import org.eclipse.persistence.queries.DatabaseQuery;
-import org.eclipse.persistence.sessions.*;
-
-/**
- *
- * @author dclarke
- * @since TopLink 10.1.3
- */
-public class QuerySQLTracker extends SessionEventAdapter {
- private List<QueryResult> queries;
-
- /**
- * Constructs and installs the event listener and sql tracking session log
- *
- * @param session
- */
- private QuerySQLTracker(Session session) {
- session.getEventManager().addListener(this);
- session.setSessionLog(new SQLTrackingSessionLog(session, this));
- reset();
- }
-
- public static QuerySQLTracker install(Session session) {
- if (session.getSessionLog() instanceof SQLTrackingSessionLog) {
- return ((SQLTrackingSessionLog) session.getSessionLog()).getTracker();
- }
- return new QuerySQLTracker(session);
- }
-
- /**
- * Helper method to retrieve a tracker from a session where it was installed
- * If the session exists but does not have a tracler installed then an
- * exception is thrown.
- */
- public static QuerySQLTracker getTracker(Session session) {
- if (session == null) {
- return null;
- }
- SessionLog sessionLog = session.getSessionLog();
-
- if (sessionLog instanceof QuerySQLTracker.SQLTrackingSessionLog) {
- return ((QuerySQLTracker.SQLTrackingSessionLog) sessionLog).getTracker();
- }
- throw new RuntimeException("Could not retireve QuerySQLTracke from session: " + session);
- }
-
- /**
- * Reset the lists of SQL and queries being tracked
- */
- public void reset() {
- this.queries = new ArrayList<QueryResult>();
- }
-
- public List<QueryResult> getQueries() {
- return this.queries;
- }
-
- protected void addBuiltObject(DatabaseQuery query, Object object) {
-
- }
-
- protected QuerySQLTracker.QueryResult getCurrentResult() {
- if (getQueries().size() == 0) {
- getQueries().add(new QueryResult(null));
- // throw new RuntimeException("Received SQL without a Query ???");
- }
- return getQueries().get(getQueries().size() - 1);
- }
-
- public int getTotalSQLCalls() {
- int totalSQLCalls = 0;
-
- for (QueryResult result : getQueries()) {
- totalSQLCalls += result.sqlStatements.size();
- }
-
- return totalSQLCalls;
- }
-
- public int getTotalSQLCalls(String startsWith) {
- int sqlCalls = 0;
-
- for (QueryResult result : getQueries()) {
- for (String sql : result.sqlStatements) {
- String sub = sql.substring(0, startsWith.length());
- if (sub.equalsIgnoreCase(startsWith)) {
- sqlCalls++;
- }
- }
- }
-
- return sqlCalls;
- }
-
- public int getTotalSQLSELECTCalls() {
- return getTotalSQLCalls("SELECT");
- }
-
- public int getTotalSQLINSERTCalls() {
- return getTotalSQLCalls("INSERT");
- }
-
- public int getTotalSQLUPDATECalls() {
- return getTotalSQLCalls("UPDATE");
- }
-
- public int getTotalSQLDELETECalls() {
- return getTotalSQLCalls("DELETE");
- }
-
- public void preExecuteQuery(SessionEvent event) {
- if (event.getQuery() == null) {
- System.out.println("HOW?");
- }
- QueryResult result = new QueryResult(event.getQuery());
- getQueries().add(result);
- }
-
- public void postExecuteQuery(SessionEvent event) {
- if (getCurrentResult().query == null) {
- getCurrentResult().setQuery(event.getQuery());
- }
- getCurrentResult().setResult(event.getResult());
- }
-
- protected class QueryResult {
- private DatabaseQuery query;
- private String resultString = null;
- private List<String> sqlStatements = new ArrayList<String>();
-
- QueryResult(DatabaseQuery q) {
- query = q;
- }
-
- protected void setQuery(DatabaseQuery query) {
- this.query = query;
- }
-
- protected void setResult(Object queryResult) {
- StringWriter writer = new StringWriter();
- writer.write(Helper.getShortClassName(query));
- writer.write("[" + System.identityHashCode(query) + "]");
- writer.write(" result = ");
-
- Object result = queryResult;
- if (queryResult instanceof Collection) {
- result = ((Collection) queryResult).toArray();
- }
-
- if (result == null) {
- writer.write("NONE");
- } else {
- if (result instanceof Object[]) {
- Object[] results = (Object[]) result;
- writer.write("<" + results.length + "> [");
- for (int index = 0; index < results.length; index++) {
- if (index > 0) {
- writer.write(", ");
- }
- writer.write(results[index] + "");
- }
- writer.write("]");
- resultString = writer.toString();
- } else {
- writer.write(result.toString());
- }
- }
-
- this.resultString = writer.toString();
- }
-
- public void addSQL(String sql) {
- sqlStatements.add(sql);
- }
-
- public String toString() {
- if (this.resultString == null) {
- setResult(null);
- }
- return this.resultString;
- }
- }
-
- /**
- * This custom SessionLog implementation wraps the existng one and redirects
- * all SQL calls to the tracker. All messages are also passed to the orginal
- * tracker.
- */
- public class SQLTrackingSessionLog extends DefaultSessionLog {
- private QuerySQLTracker tracker;
-
- private SessionLog originalLog;
-
- protected SQLTrackingSessionLog(Session session, QuerySQLTracker aTracker) {
- this.tracker = aTracker;
- this.originalLog = session.getSessionLog();
- setLevel(this.originalLog.getLevel());
- setSession(session);
- setWriter(this.originalLog.getWriter());
- }
-
- public QuerySQLTracker getTracker() {
- return this.tracker;
- }
-
- public synchronized void log(SessionLogEntry entry) {
-
- if (entry.getNameSpace() != null && entry.getNameSpace().equalsIgnoreCase(SessionLog.SQL)) {
- getTracker().getCurrentResult().addSQL(entry.getMessage());
- }
- super.log(entry);
- }
- }
-
- public void printResults(String prefix) {
- System.out.println(prefix + "-QuerySQLTracker-Queries:");
-
- int sql = 0;
- for (int index = 0; index < getQueries().size(); index++) {
- QueryResult result = getQueries().get(index);
-
- System.out.println("\t" + (index + 1) + "> " + result);
-
- for (int sqlNum = 0; sqlNum < result.sqlStatements.size(); sqlNum++) {
- sql++;
- System.out.println("\t\t" + (index + 1) + "." + (sqlNum + 1) + "-" + sql + "> " + result.sqlStatements.get(sqlNum));
- }
- }
-
- System.out.println(prefix + "-QuerySQLTracker-Queries: " + getQueries().size());
- System.out.println(prefix + "-QuerySQLTracker-INSERT: " + getTotalSQLINSERTCalls());
- System.out.println(prefix + "-QuerySQLTracker-SELECT: " + getTotalSQLSELECTCalls());
- System.out.println(prefix + "-QuerySQLTracker-UPDATE: " + getTotalSQLUPDATECalls());
- System.out.println(prefix + "-QuerySQLTracker-DELETE: " + getTotalSQLDELETECalls());
- }
-
- static class DescriptorBuildCounter extends DescriptorEventAdapter {
- private QuerySQLTracker querySQLTracker;
-
- private DescriptorBuildCounter(QuerySQLTracker tracker) {
- this.querySQLTracker = tracker;
- }
-
- public void postBuild(DescriptorEvent event) {
- this.querySQLTracker.addBuiltObject(event.getQuery(), event.getSource());
- }
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/sdo/AllTests.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/sdo/AllTests.java
deleted file mode 100644
index 2b85d7e..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/sdo/AllTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.sdo;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { })
-public class AllTests {
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/sdo/DynamicSDO_NewEmployee.java b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/sdo/DynamicSDO_NewEmployee.java
deleted file mode 100644
index cebd2cf..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/testing/sdo/DynamicSDO_NewEmployee.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package testing.sdo;
-
-import java.io.*;
-
-import org.junit.Test;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.*;
-
-public class DynamicSDO_NewEmployee {
-
- @Test
- public void readSamples() throws Exception {
- InputStream xsdIn = Thread.currentThread().getContextClassLoader().getResourceAsStream("xsd/jpadas-employee.xsd");
- XSDHelper.INSTANCE.define(xsdIn, null);
-
- File sampleFolder = new File("./data/samples");
- File[] sampleFiles = sampleFolder.listFiles();
-
- for (int index = 0; index < sampleFiles.length; index++) {
- if (sampleFiles[index].isFile()) {
- System.out.println("READING> " + sampleFiles[index].getName());
- FileInputStream xmlInputStream = new FileInputStream(sampleFiles[index]);
- XMLDocument xmlDocument = XMLHelper.INSTANCE.load(xmlInputStream);
- DataObject employeeDO = xmlDocument.getRootObject();
- System.out.println("\t> DataObject: " + employeeDO);
- xmlInputStream.close();
- }
- }
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/xsd/jpadas-employee.xsd b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/xsd/jpadas-employee.xsd
deleted file mode 100644
index 3ad7919..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/src/xsd/jpadas-employee.xsd
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.example.org/jpadas-employee"
- xmlns:sdo="commonj.sdo" targetNamespace="http://www.example.org/jpadas-employee"
- elementFormDefault="qualified" attributeFormDefault="unqualified">
-
- <xs:import namespace="commonj.sdo" />
- <xs:element name="employee" type="employee-type" />
- <xs:complexType name="employee-type">
- <xs:sequence>
- <xs:element name="first-name" type="xs:string" />
- <xs:element name="last-name" type="xs:string" />
- <xs:element name="gender" type="gender" />
- <xs:element name="salary" type="xs:double" />
- <xs:element name="address" type="address-type" />
- <xs:element name="phone-number" type="phone-type" maxOccurs="unbounded" />
- <!-- xs:element name="sdo-change-summary" type="sdo:ChangeSummaryType"
- minOccurs="0" / -->
- </xs:sequence>
- <xs:attribute name="id" type="xs:integer" />
- <xs:attribute name="version" type="xs:long" use="required"/>
- </xs:complexType>
- <xs:simpleType name="gender">
- <xs:restriction base="xs:token">
- <xs:enumeration value="Male" />
- <xs:enumeration value="Female" />
- </xs:restriction>
- </xs:simpleType>
- <xs:complexType name="address-type">
- <xs:sequence>
- <xs:element name="street" type="xs:string" />
- <xs:element name="city" type="xs:string" />
- <xs:element name="state" type="xs:string" />
- <xs:element name="zip-code" type="xs:string" />
- <xs:element name="country" type="xs:string" />
- </xs:sequence>
- <xs:attribute name="id" type="xs:integer" />
- </xs:complexType>
- <xs:complexType name="phone-type">
- <xs:attribute name="type" type="xs:string" />
- <xs:attribute name="number" type="xs:string" />
- </xs:complexType>
-</xs:schema>
\ No newline at end of file
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.Address.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.Address.xml
deleted file mode 100644
index be426af..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.Address.xml
+++ /dev/null
@@ -1,239 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>model.Address</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <last-refresh-timestamp>2008-12-11T10:18:32.343</last-refresh-timestamp>
- <interface-handles>
- <class-handle>
- <type-name>java.io.Serializable</type-name>
- </class-handle>
- </interface-handles>
- <attributes>
- <class-attribute>
- <name>city</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>country</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>id</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>postalCode</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>province</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>street</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>Address</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- <method>
- <name>getCity</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getCountry</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getPostalCode</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getProvince</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getStreet</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>setCity</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setCountry</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setPostalCode</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setProvince</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setStreet</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- </methods>
-</class>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.Employee.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.Employee.xml
deleted file mode 100644
index 47ccebf..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.Employee.xml
+++ /dev/null
@@ -1,662 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>model.Employee</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <last-refresh-timestamp>2008-12-11T10:18:32.156</last-refresh-timestamp>
- <attributes>
- <class-attribute>
- <name>address</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>model.Address</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>endTime</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.sql.Time</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>firstName</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>gender</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>model.Gender</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>id</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>lastName</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>managedEmployees</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.util.List</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>manager</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>model.Employee</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>period</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>model.EmploymentPeriod</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>phoneNumbers</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.util.List</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>responsibilities</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.util.List</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>salary</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>double</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>startTime</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.sql.Time</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>version</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.Long</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>Employee</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- <method>
- <name>addManagedEmployee</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>model.Employee</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>model.Employee</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>addPhoneNumber</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>model.PhoneNumber</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>addPhoneNumber</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>model.PhoneNumber</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>model.PhoneNumber</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>addResponsibility</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>getAddress</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>model.Address</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getEndTime</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.sql.Time</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getFirstName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getGender</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>model.Gender</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getLastName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getManagedEmployees</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.util.List</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getManager</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>model.Employee</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getPeriod</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>model.EmploymentPeriod</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getPhoneNumbers</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.util.List</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getResponsibilities</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.util.List</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getSalary</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>double</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getStartTime</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.sql.Time</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getVersion</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.Long</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>removeManagedEmployee</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>model.Employee</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>model.Employee</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>removePhoneNumber</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>model.PhoneNumber</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>model.PhoneNumber</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>removeResponsibility</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setAddress</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>model.Address</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setEndTime</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.sql.Time</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setFirstName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setGender</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>model.Gender</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setLastName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setManagedEmployees</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.util.List</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setManager</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>model.Employee</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setPeriod</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>model.EmploymentPeriod</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setPhoneNumbers</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.util.List</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setResponsibilities</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.util.List</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setSalary</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>double</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setStartTime</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.sql.Time</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setVersion</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.Long</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- </methods>
-</class>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.EmploymentPeriod.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.EmploymentPeriod.xml
deleted file mode 100644
index 4459029..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.EmploymentPeriod.xml
+++ /dev/null
@@ -1,154 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>model.EmploymentPeriod</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <last-refresh-timestamp>2008-12-11T10:18:32.281</last-refresh-timestamp>
- <attributes>
- <class-attribute>
- <name>endDate</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.util.Calendar</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>startDate</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.util.Calendar</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>EmploymentPeriod</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- <method>
- <name>getEndDate</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.util.Calendar</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getStartDate</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.util.Calendar</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>setEndDate</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setEndDate</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.util.Calendar</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setStartDate</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setStartDate</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.util.Calendar</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- </methods>
-</class>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.Gender.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.Gender.xml
deleted file mode 100644
index 16fe3bf..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.Gender.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>model.Gender</name>
- <modifier>17</modifier>
- <superclass-handle>
- <type-name>java.lang.Enum</type-name>
- </superclass-handle>
- <last-refresh-timestamp>2008-12-11T14:55:20.281</last-refresh-timestamp>
- <attributes>
- <class-attribute>
- <name>Female</name>
- <modifier>25</modifier>
- <type-declaration>
- <type-handle>
- <type-name>model.Gender</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>Male</name>
- <modifier>25</modifier>
- <type-declaration>
- <type-handle>
- <type-name>model.Gender</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>Gender</name>
- <constructor>true</constructor>
- <modifier>2</modifier>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>valueOf</name>
- <modifier>9</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>model.Gender</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>values</name>
- <modifier>9</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>model.Gender</type-name>
- </type-handle>
- <dimensionality>1</dimensionality>
- </return-type-declaration>
- </method>
- </methods>
-</class>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.PhoneNumber.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.PhoneNumber.xml
deleted file mode 100644
index 16e85c6..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.PhoneNumber.xml
+++ /dev/null
@@ -1,193 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>model.PhoneNumber</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <last-refresh-timestamp>2008-12-11T14:13:29.531</last-refresh-timestamp>
- <interface-handles>
- <class-handle>
- <type-name>java.io.Serializable</type-name>
- </class-handle>
- </interface-handles>
- <attributes>
- <class-attribute>
- <name>id</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>number</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>owner</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>model.Employee</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>type</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>PhoneNumber</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- <method>
- <name>PhoneNumber</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>getId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getNumber</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getOwner</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>model.Employee</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>getType</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- </method>
- <method>
- <name>setId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setNumber</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setOwner</name>
- <modifier>4</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>model.Employee</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- <method>
- <name>setType</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- </methods>
- <type-handles>
- <class-handle>
- <type-name>model.PhoneNumber$ID</type-name>
- </class-handle>
- </type-handles>
-</class>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.persistence.MOXyDescriptorCustomizers.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.persistence.MOXyDescriptorCustomizers.xml
deleted file mode 100644
index 033db79..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/classes/model.persistence.MOXyDescriptorCustomizers.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>model.persistence.MOXyDescriptorCustomizers</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <last-refresh-timestamp>2008-12-11T15:03:33.875</last-refresh-timestamp>
- <methods>
- <method>
- <name>MOXyDescriptorCustomizers</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- <method>
- <name>afterLoadEmployee</name>
- <modifier>9</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>org.eclipse.persistence.descriptors.ClassDescriptor</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- </method>
- </methods>
-</class>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/descriptors/model.Address.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/descriptors/model.Address.xml
deleted file mode 100644
index 9a3c19a..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/descriptors/model.Address.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<descriptor type="o-x">
- <name>model.Address</name>
- <class-handle>
- <type-name>model.Address</type-name>
- </class-handle>
- <transactional-policy type="ox">
- <descriptor-alias>Address</descriptor-alias>
- <refresh-cache-policy/>
- <caching-policy/>
- <query-manager type="ox"/>
- <locking-policy type="ox"/>
- <primary-key-policy/>
- </transactional-policy>
- <mappings>
- <mapping type="xml-direct">
- <name>city</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Address</attribute-declaring-type-name>
- <attribute-name>city</attribute-name>
- </attribute-handle>
- <xml-field>city/text()</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>country</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Address</attribute-declaring-type-name>
- <attribute-name>country</attribute-name>
- </attribute-handle>
- <xml-field>country/text()</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>id</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Address</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </attribute-handle>
- <xml-field>@id</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>postalCode</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Address</attribute-declaring-type-name>
- <attribute-name>postalCode</attribute-name>
- </attribute-handle>
- <xml-field>zip-code/text()</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>province</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Address</attribute-declaring-type-name>
- <attribute-name>province</attribute-name>
- </attribute-handle>
- <xml-field>state/text()</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>street</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Address</attribute-declaring-type-name>
- <attribute-name>street</attribute-name>
- </attribute-handle>
- <xml-field>street/text()</xml-field>
- </mapping>
- </mappings>
- <schema-context-handle>
- <schema>employee</schema>
- <qname-path>
- <qname component-type="complex-type" namespace-uri="http://www.example.org/jpadas-employee" local-name="address-type"/>
- </qname-path>
- </schema-context-handle>
- <root-descriptor>false</root-descriptor>
-</descriptor>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/descriptors/model.Employee.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/descriptors/model.Employee.xml
deleted file mode 100644
index ce70b68..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/descriptors/model.Employee.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<descriptor type="o-x">
- <name>model.Employee</name>
- <class-handle>
- <type-name>model.Employee</type-name>
- </class-handle>
- <transactional-policy type="ox">
- <descriptor-alias>Employee</descriptor-alias>
- <refresh-cache-policy/>
- <caching-policy/>
- <query-manager type="ox"/>
- <locking-policy type="ox"/>
- <primary-key-policy/>
- </transactional-policy>
- <mappings>
- <mapping type="composite-object">
- <name>address</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Employee</attribute-declaring-type-name>
- <attribute-name>address</attribute-name>
- </attribute-handle>
- <reference-descriptor-handle>
- <descriptor-name>model.Address</descriptor-name>
- </reference-descriptor-handle>
- <xpath>address</xpath>
- </mapping>
- <mapping type="xml-direct">
- <name>firstName</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Employee</attribute-declaring-type-name>
- <attribute-name>firstName</attribute-name>
- </attribute-handle>
- <xml-field>first-name/text()</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>gender</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Employee</attribute-declaring-type-name>
- <attribute-name>gender</attribute-name>
- </attribute-handle>
- <xml-field>gender/text()</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>id</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Employee</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </attribute-handle>
- <xml-field>@id</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>lastName</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Employee</attribute-declaring-type-name>
- <attribute-name>lastName</attribute-name>
- </attribute-handle>
- <xml-field>last-name/text()</xml-field>
- </mapping>
- <mapping type="composite-collection">
- <name>phoneNumbers</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Employee</attribute-declaring-type-name>
- <attribute-name>phoneNumbers</attribute-name>
- </attribute-handle>
- <reference-descriptor-handle>
- <descriptor-name>model.PhoneNumber</descriptor-name>
- </reference-descriptor-handle>
- <xpath>phone-number</xpath>
- <container-policy type="list">
- <container-class>
- <uses-default-container-class>true</uses-default-container-class>
- </container-class>
- </container-policy>
- </mapping>
- <mapping type="xml-direct">
- <name>salary</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Employee</attribute-declaring-type-name>
- <attribute-name>salary</attribute-name>
- </attribute-handle>
- <xml-field>salary/text()</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>version</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Employee</attribute-declaring-type-name>
- <attribute-name>version</attribute-name>
- </attribute-handle>
- <xml-field>@version</xml-field>
- </mapping>
- </mappings>
- <after-loading-policy>
- <post-load-class-handle>
- <type-name>model.persistence.MOXyDescriptorCustomizers</type-name>
- </post-load-class-handle>
- <post-load-method-handle>
- <method-declaring-type-name>model.persistence.MOXyDescriptorCustomizers</method-declaring-type-name>
- <method-signature>afterLoadEmployee(org.eclipse.persistence.descriptors.ClassDescriptor)</method-signature>
- </post-load-method-handle>
- </after-loading-policy>
- <schema-context-handle>
- <schema>employee</schema>
- <qname-path>
- <qname component-type="complex-type" namespace-uri="http://www.example.org/jpadas-employee" local-name="employee-type"/>
- </qname-path>
- </schema-context-handle>
- <default-root-element-handle>
- <schema>employee</schema>
- <qname-path>
- <qname component-type="element" namespace-uri="http://www.example.org/jpadas-employee" local-name="employee"/>
- </qname-path>
- </default-root-element-handle>
- <root-descriptor>true</root-descriptor>
- <default-root-element-type-handle>
- <schema>employee</schema>
- <qname-path>
- <qname component-type="complex-type" namespace-uri="http://www.example.org/jpadas-employee" local-name="employee-type"/>
- </qname-path>
- </default-root-element-type-handle>
-</descriptor>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/descriptors/model.PhoneNumber.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/descriptors/model.PhoneNumber.xml
deleted file mode 100644
index f5b72fc..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/descriptors/model.PhoneNumber.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<descriptor type="o-x">
- <name>model.PhoneNumber</name>
- <class-handle>
- <type-name>model.PhoneNumber</type-name>
- </class-handle>
- <transactional-policy type="ox">
- <descriptor-alias>PhoneNumber</descriptor-alias>
- <refresh-cache-policy/>
- <caching-policy/>
- <query-manager type="ox"/>
- <locking-policy type="ox"/>
- <primary-key-policy/>
- </transactional-policy>
- <mappings>
- <mapping type="xml-direct">
- <name>number</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.PhoneNumber</attribute-declaring-type-name>
- <attribute-name>number</attribute-name>
- </attribute-handle>
- <xml-field>@number</xml-field>
- </mapping>
- <mapping type="xml-direct">
- <name>type</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.PhoneNumber</attribute-declaring-type-name>
- <attribute-name>type</attribute-name>
- </attribute-handle>
- <xml-field>@type</xml-field>
- </mapping>
- </mappings>
- <schema-context-handle>
- <schema>employee</schema>
- <qname-path>
- <qname component-type="complex-type" namespace-uri="http://www.example.org/jpadas-employee" local-name="phone-type"/>
- </qname-path>
- </schema-context-handle>
- <root-descriptor>false</root-descriptor>
-</descriptor>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/jpadas-employee.mwp b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/jpadas-employee.mwp
deleted file mode 100644
index 3a5d7ae..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/jpadas-employee.mwp
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project type="o-x">
- <name>jpadas-employee</name>
- <product-version>1.0</product-version>
- <schema-version>7.0</schema-version>
- <class-repository>
- <classpath-entries>
- <entry>../classes</entry>
- </classpath-entries>
- <user-type-names>
- <name>model.Address</name>
- <name>model.Employee</name>
- <name>model.EmploymentPeriod</name>
- <name>model.Gender</name>
- <name>model.persistence.MOXyDescriptorCustomizers</name>
- <name>model.PhoneNumber</name>
- </user-type-names>
- </class-repository>
- <descriptor-names>
- <descriptor-name>model.Address</descriptor-name>
- <descriptor-name>model.Employee</descriptor-name>
- <descriptor-name>model.PhoneNumber</descriptor-name>
- </descriptor-names>
- <defaults-policy type="o-x">
- <use-method-accessing>false</use-method-accessing>
- </defaults-policy>
- <deployment-xml-file>../src/META-INF/employee-oxm.xml</deployment-xml-file>
- <xml-schema-repository>
- <schema-names>
- <name>employee</name>
- </schema-names>
- </xml-schema-repository>
-</project>
diff --git a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/schemas/employee.xml b/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/schemas/employee.xml
deleted file mode 100644
index e0846d5..0000000
--- a/das/trunk/org.eclipse.persistence.example.sdo.das.employee/workbench/schemas/employee.xml
+++ /dev/null
@@ -1,232 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xml-schema>
- <name>employee</name>
- <target-namespace-url>http://www.example.org/jpadas-employee</target-namespace-url>
- <default-namespace-url>http://www.example.org/jpadas-employee</default-namespace-url>
- <should-default-namespace-url>true</should-default-namespace-url>
- <schema-source type="file">
- <location>../src/xsd/jpadas-employee.xsd</location>
- </schema-source>
- <built-in-namespaces>
- <namespace url="http://www.w3.org/2001/XMLSchema" prefix="xs" declared="true"/>
- <namespace url="http://www.w3.org/2001/XMLSchema-instance" prefix="xsi" declared="true"/>
- </built-in-namespaces>
- <declared-namespaces>
- <namespace>
- <namespace-prefix>emp</namespace-prefix>
- <namespace-prefix-is-user-defined>false</namespace-prefix-is-user-defined>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <declared>true</declared>
- <element-declarations>
- <element-declaration type="element">
- <name>employee</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <type type="complex-type-ref">
- <name>employee-type</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- </type>
- </element-declaration>
- </element-declarations>
- <type-definitions>
- <type-definition type="complex-type">
- <name>address-type</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <abstract>false</abstract>
- <derivation-method>restriction</derivation-method>
- <base-type type="complex-type-ref">
- <name>anyType</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </base-type>
- <attributes>
- <attribute type="attribute">
- <name>id</name>
- <use>optional</use>
- <type type="simple-type-ref">
- <name>integer</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </attribute>
- </attributes>
- <content type="complex">
- <mixed-flag>false</mixed-flag>
- <particle compositor="sequence" type="model-group">
- <particles>
- <particle type="element">
- <name>street</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </particle>
- <particle type="element">
- <name>city</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </particle>
- <particle type="element">
- <name>state</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </particle>
- <particle type="element">
- <name>zip-code</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </particle>
- <particle type="element">
- <name>country</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </particle>
- </particles>
- </particle>
- </content>
- </type-definition>
- <type-definition type="complex-type">
- <name>employee-type</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <abstract>false</abstract>
- <derivation-method>restriction</derivation-method>
- <base-type type="complex-type-ref">
- <name>anyType</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </base-type>
- <attributes>
- <attribute type="attribute">
- <name>id</name>
- <use>optional</use>
- <type type="simple-type-ref">
- <name>integer</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </attribute>
- <attribute type="attribute">
- <name>version</name>
- <use>required</use>
- <type type="simple-type-ref">
- <name>long</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </attribute>
- </attributes>
- <content type="complex">
- <mixed-flag>false</mixed-flag>
- <particle compositor="sequence" type="model-group">
- <particles>
- <particle type="element">
- <name>first-name</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </particle>
- <particle type="element">
- <name>last-name</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </particle>
- <particle type="element">
- <name>gender</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <type type="simple-type-ref">
- <name>gender</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- </type>
- </particle>
- <particle type="element">
- <name>salary</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <type type="simple-type-ref">
- <name>double</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </particle>
- <particle type="element">
- <name>address</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <type type="complex-type-ref">
- <name>address-type</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- </type>
- </particle>
- <particle type="element">
- <name>phone-number</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <type type="complex-type-ref">
- <name>phone-type</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- </type>
- <max-occurs>2147483640</max-occurs>
- </particle>
- <particle type="element">
- <name>sdo-change-summary</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <type type="complex-type-ref">
- <name>anyType</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- <min-occurs>0</min-occurs>
- </particle>
- </particles>
- </particle>
- </content>
- </type-definition>
- <type-definition type="simple-type">
- <name>gender</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <variety>atomic</variety>
- <base-type type="simple-type-ref">
- <name>token</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </base-type>
- </type-definition>
- <type-definition type="complex-type">
- <name>phone-type</name>
- <namespace-url>http://www.example.org/jpadas-employee</namespace-url>
- <abstract>false</abstract>
- <derivation-method>restriction</derivation-method>
- <base-type type="complex-type-ref">
- <name>anyType</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </base-type>
- <attributes>
- <attribute type="attribute">
- <name>number</name>
- <use>optional</use>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </attribute>
- <attribute type="attribute">
- <name>type</name>
- <use>optional</use>
- <type type="simple-type-ref">
- <name>string</name>
- <namespace-url>http://www.w3.org/2001/XMLSchema</namespace-url>
- </type>
- </attribute>
- </attributes>
- <content type="empty"/>
- </type-definition>
- </type-definitions>
- </namespace>
- </declared-namespaces>
-</xml-schema>
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/.classpath b/das/trunk/org.eclipse.persistence.sdo.das/.classpath
deleted file mode 100644
index 1003fe4..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry excluding="**/.svn/**" kind="src" path="src"/>
- <classpathentry combineaccessrules="false" exported="true" kind="src" path="/org.eclipse.persistence.sdo"/>
- <classpathentry combineaccessrules="false" exported="true" kind="src" path="/org.eclipse.persistence.moxy"/>
- <classpathentry combineaccessrules="false" exported="true" kind="src" path="/commonj.sdo 2.1.0"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/.project b/das/trunk/org.eclipse.persistence.sdo.das/.project
deleted file mode 100644
index 14c56a5..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.persistence.sdo</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/.settings/org.eclipse.jdt.core.prefs b/das/trunk/org.eclipse.persistence.sdo.das/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 5886240..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,52 +0,0 @@
-#Tue Oct 09 11:37:25 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=ignore
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/.settings/org.eclipse.pde.core.prefs b/das/trunk/org.eclipse.persistence.sdo.das/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644
index b8308ee..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/.settings/org.eclipse.pde.core.prefs
+++ /dev/null
@@ -1,5 +0,0 @@
-#Wed May 07 14:06:24 EDT 2008
-eclipse.preferences.version=1
-pluginProject.equinox=false
-pluginProject.extensions=false
-resolve.requirebundle=false
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/build.properties b/das/trunk/org.eclipse.persistence.sdo.das/build.properties
deleted file mode 100644
index ff66a5a..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-#*******************************************************************************
-# Copyright (c) 1998, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
-# which accompanies this distribution.
-# The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
-# and the Eclipse Distribution License is available at
-# http://www.eclipse.org/org/documents/edl-v10.php.
-#
-# Contributors:
-# dclarke - DAS INCUBATOR - Enhancement 258057
-# http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
-#
-# This code is being developed under INCUBATION and is not currently included
-# in the automated EclipseLink build. The API in this code may change, or
-# may never be included in the product. Please provide feedback through mailing
-# lists or the bug database.
-#***************************************************************************** -->
-commonj.sdo.lib=commonj.sdo_2.1.0.jar
-trunk.dir=../../../../trunk
-source.. = src/
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/build.xml b/das/trunk/org.eclipse.persistence.sdo.das/build.xml
deleted file mode 100644
index b5723ac..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/build.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0"?>
-<!-- *******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ****************************************************************************** -->
-<project name="incubation.das" default="build" basedir=".">
-
- <property file="./build.properties"/>
- <property file="${trunk.dir}/build.properties"/>
-
- <!-- Set Compile Path-->
- <path id="compile.path">
- <pathelement path="${trunk.dir}/sdo/plugins/${commonj.sdo.lib}"/>
- <pathelement path="${trunk.dir}/moxy/plugins/javax.xml.bind_2.0.0.jar" />
- <pathelement path="${trunk.dir}/plugins/javax.xml.stream_1.0.0.jar"/>
- <pathelement path="${trunk.dir}/${eclipselink.jar.name}"/>
- </path>
-
- <target name="build" depends="clean,compile,package" />
-
- <!-- clean -->
- <target name="clean" description="Clean all generated content">
- <delete includeEmptyDirs="true" failonerror="false">
- <fileset dir="${classes.dir}"/>
- </delete>
- </target>
-
- <!-- compile -->
- <target name="compile" description="Compile EclipseLink DAS">
- <mkdir dir="${classes.dir}"/>
- <javac srcdir="${src.dir}"
- destdir="${classes.dir}"
- includes="**/*.java"
- debug="${javac.debug}"
- optimize="${javac.optimize}"
- source="${javac.version}"
- target="${javac.version}"
- deprecation="${javac.deprecation}"
- failonerror="true"
- memoryMaximumSize="512m"
- fork="true"
- classpathref="compile.path"
- />
- </target>
-
- <target name="package" >
- <delete file="eclipselink-das.jar"/>
- <delete file="eclipselink-das-src.zip"/>
-
- <!-- include order is important. original eclipselink jar must be -->
- <!-- included last to allow inclusion of incubation classes, and -->
- <!-- exclusion of original eclipselink classes -->
- <jar jarfile="eclipselink-das.jar" duplicate="preserve">
- <manifest>
- <attribute name="Specification-Title" value="${eclipselink.specification.title}"/>
- <attribute name="Specification-Vendor" value="${specification.vendor}"/>
- <attribute name="Specification-Version" value="${release.version}"/>
- <attribute name="Implementation-Title" value="${eclipselink.implementation.title}"/>
- <attribute name="Implementation-Vendor" value="${implementation.vendor}"/>
- <attribute name="Implementation-Version" value="${version.string}-INCUBATION"/>
- <attribute name="Release-Designation" value="${release.designation}"/>
- <attribute name="Premain-Class" value="${eclipselink.premain.class}"/>
- </manifest>
- <fileset dir="${classes.dir}" />
- <zipgroupfileset dir="${trunk.dir}">
- <include name="eclipselink.jar" />
- </zipgroupfileset>
- <filename name="readme.txt"/>
- </jar>
-
- <jar jarfile="eclipselink-das-src.zip" duplicate="preserve">
- <fileset dir="${src.dir}" />
- <zipgroupfileset dir="${trunk.dir}">
- <include name="eclipselink-src.zip" />
- </zipgroupfileset>
- <filename name="readme.txt"/>
- </jar>
-</target>
-
-</project>
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/eclipselink-das-src.zip b/das/trunk/org.eclipse.persistence.sdo.das/eclipselink-das-src.zip
deleted file mode 100644
index 15be137..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/eclipselink-das-src.zip
+++ /dev/null
Binary files differ
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/eclipselink-das.jar b/das/trunk/org.eclipse.persistence.sdo.das/eclipselink-das.jar
deleted file mode 100644
index 38daeb1..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/eclipselink-das.jar
+++ /dev/null
Binary files differ
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/readme.txt b/das/trunk/org.eclipse.persistence.sdo.das/readme.txt
deleted file mode 100644
index c7c5136..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-The contents of this library are provided as part of the EclipseLink Incubator component and should only be used for testing
\ No newline at end of file
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/internal/oxm/accessor/OrmAttributeAccessor.java b/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/internal/oxm/accessor/OrmAttributeAccessor.java
deleted file mode 100644
index 1b33ab4..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/internal/oxm/accessor/OrmAttributeAccessor.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 1998, 2008 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
-* which accompanies this distribution.
-* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
-* and the Eclipse Distribution License is available at
-* http://www.eclipse.org/org/documents/edl-v10.php.
-*
-* Contributors:
-* mmacivor - Feb 06/2009 - Initial implementation
-******************************************************************************/
-package org.eclipse.persistence.internal.oxm.accessor;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import org.eclipse.persistence.descriptors.changetracking.ChangeTracker;
-import org.eclipse.persistence.indirection.ValueHolder;
-import org.eclipse.persistence.indirection.ValueHolderInterface;
-import org.eclipse.persistence.indirection.WeavedAttributeValueHolderInterface;
-import org.eclipse.persistence.mappings.AttributeAccessor;
-/**
- * INTERNAL:
- * A custom AttriuteAccessor to be used when the same object is mapped in both
- * OXM and ORM. This will bridge the gap between the two for attributes that use
- * ValueHolders. Specifically for JPA weaving.
- * @author matt.macivor
- *
- */
-public class OrmAttributeAccessor extends AttributeAccessor {
- private AttributeAccessor ormAccessor;
- private AttributeAccessor oxmAccessor;
- private boolean isValueHolderProperty;
- private boolean isChangeTracking;
-
- public OrmAttributeAccessor(AttributeAccessor ormAccessor, AttributeAccessor oxmAccessor) {
- this.ormAccessor = ormAccessor;
- this.oxmAccessor = oxmAccessor;
- }
-
- public void setValueHolderProperty(boolean isValueHolder) {
- isValueHolderProperty = isValueHolder;
- }
-
- public void setChangeTracking(boolean changeTracking) {
- this.isChangeTracking = changeTracking;
- }
-
- public boolean isValueHolderProperty() {
- return this.isValueHolderProperty;
- }
-
- public boolean isChangeTracking() {
- return this.isChangeTracking;
- }
-
- public Object getAttributeValueFromObject(Object object) {
- if(isValueHolderProperty) {
- ValueHolderInterface vh = (ValueHolderInterface)ormAccessor.getAttributeValueFromObject(object);
- if(vh != null && !vh.isInstantiated()) {
- Object value = vh.getValue();
- oxmAccessor.setAttributeValueInObject(object, value);
- if(vh instanceof WeavedAttributeValueHolderInterface) {
- ((WeavedAttributeValueHolderInterface)vh).setIsCoordinatedWithProperty(true);
- }
- }
- }
- return oxmAccessor.getAttributeValueFromObject(object);
- }
-
- public void setAttributeValueInObject(Object object, Object value) {
- if(isChangeTracking) {
- Object oldValue = getAttributeValueFromObject(object);
- PropertyChangeListener listener = ((ChangeTracker)object)._persistence_getPropertyChangeListener();
- if(listener != null) {
- listener.propertyChange(new PropertyChangeEvent(object, oxmAccessor.getAttributeName(), value, oldValue));
- }
- }
- if(isValueHolderProperty) {
- ValueHolderInterface vh = (ValueHolderInterface)ormAccessor.getAttributeValueFromObject(object);
- if(vh == null) {
- vh = new ValueHolder();
- ((ValueHolder)vh).setIsNewlyWeavedValueHolder(true);
- }
- vh.setValue(value);
- ormAccessor.setAttributeValueInObject(object, vh);
- }
- oxmAccessor.setAttributeValueInObject(object, value);
- }
-
- public AttributeAccessor getOrmAccessor() {
- return this.ormAccessor;
- }
-
- public AttributeAccessor getOxmAccessor() {
- return this.oxmAccessor;
- }
-
- public void setOrmAccessor(AttributeAccessor accessor) {
- this.ormAccessor = accessor;
- }
-
- public void setOxmAccessor(AttributeAccessor accessor) {
- this.oxmAccessor = accessor;
- }
-
- public Class getAttributeClass() {
- return oxmAccessor.getAttributeClass();
- }
-
- public boolean isMethodAttributeAccessor() {
- return oxmAccessor.isMethodAttributeAccessor();
- }
-
- public String getAttributeName() {
- return oxmAccessor.getAttributeName();
- }
-}
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/jaxb/JAXBContext.java b/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/jaxb/JAXBContext.java
deleted file mode 100644
index 88c7acc..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/jaxb/JAXBContext.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation from Oracle TopLink
- ******************************************************************************/
-package org.eclipse.persistence.jaxb;
-
-import java.util.Iterator;
-
-import javax.xml.bind.Binder;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.SchemaOutputResolver;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.Validator;
-import javax.xml.namespace.QName;
-import java.util.HashMap;
-
-import org.eclipse.persistence.oxm.XMLContext;
-import org.eclipse.persistence.internal.sessions.AbstractSession;
-import org.eclipse.persistence.jaxb.compiler.Generator;
-import org.eclipse.persistence.jaxb.compiler.MarshalCallback;
-import org.eclipse.persistence.jaxb.compiler.UnmarshalCallback;
-
-/**
- * INTERNAL:
- * <p><b>Purpose:</b>Provide a TopLink implementation of the JAXBContext interface.
- * <p><b>Responsibilities:</b><ul>
- * <li>Create Marshaller instances</li>
- * <li>Create Unmarshaller instances</li>
- * <li>Create Binder instances</li>
- * <li>Create Introspector instances</li>
- * <li>Create Validator instances</li>
- * <li>Generate Schema Files</li>
- * <ul>
- * <p>This is the TopLink JAXB 2.0 implementation of javax.xml.bind.JAXBContext. This class
- * is created by the JAXBContextFactory and is used to create Marshallers, Unmarshallers, Validators,
- * Binders and Introspectors. A JAXBContext can also be used to create Schema Files.
- *
- * @see javax.xml.bind.JAXBContext
- * @see org.eclipse.persistence.jaxb.JAXBMarshaller
- * @see org.eclipse.persistence.jaxb.JAXBUnmarshaller
- * @see org.eclipse.persistence.jaxb.JAXBBinder
- * @see org.eclipse.persistence.jaxb.JAXBIntrospector
- *
- * @author mmacivor
- * @since Oracle TopLink 11.1.1.0.0
- */
-
-public class JAXBContext extends javax.xml.bind.JAXBContext {
- private XMLContext xmlContext;
- private org.eclipse.persistence.jaxb.compiler.Generator generator;
- private HashMap<Class, QName> generatedClassesToQName;
-
- public JAXBContext(XMLContext context) {
- super();
- xmlContext = context;
- }
-
- public JAXBContext(XMLContext context, Generator generator) {
- super();
- this.xmlContext = context;
- this.generator = generator;
- this.generatedClassesToQName = generator.getMappingsGenerator().getGeneratedClassesToQName();
- }
-
- public XMLContext getXMLContext() {
- return this.xmlContext;
- }
-
- public void generateSchema(SchemaOutputResolver outputResolver) {
- if(generator == null) {
- return;
- }
- generator.generateSchemaFiles(outputResolver, null);
- }
-
- public Marshaller createMarshaller() {
- // create a JAXBIntrospector and set it on the marshaller
- JAXBMarshaller marshaller = new JAXBMarshaller(xmlContext.createMarshaller(), new JAXBIntrospector(xmlContext));
- if (generator != null && generator.hasMarshalCallbacks()) {
- // initialize each callback in the map
- for (Iterator callIt = generator.getMarshalCallbacks().keySet().iterator(); callIt.hasNext(); ) {
- MarshalCallback cb = (MarshalCallback) generator.getMarshalCallbacks().get(callIt.next());
- // TODO: what classloader do we want to use here?
- cb.initialize(generator.getClass().getClassLoader());
- }
- marshaller.setMarshalCallbacks(generator.getMarshalCallbacks());
- }
- return marshaller;
- }
-
- public Unmarshaller createUnmarshaller() {
- JAXBUnmarshaller unmarshaller = new JAXBUnmarshaller(xmlContext.createUnmarshaller());
- if (generator != null && generator.hasUnmarshalCallbacks()) {
- // initialize each callback in the map
- for (Iterator callIt = generator.getUnmarshalCallbacks().keySet().iterator(); callIt.hasNext(); ) {
- UnmarshalCallback cb = (UnmarshalCallback) generator.getUnmarshalCallbacks().get(callIt.next());
- // TODO: what classloader do we want to use here?
- cb.initialize(generator.getClass().getClassLoader());
- }
- unmarshaller.setUnmarshalCallbacks(generator.getUnmarshalCallbacks());
- }
- unmarshaller.setGeneratedClassesToQName(this.generatedClassesToQName);
- return unmarshaller;
- }
-
- public Validator createValidator() {
- return new JAXBValidator(xmlContext.createValidator());
- }
-
- public Binder createBinder() {
- return new JAXBBinder(this.xmlContext);
- }
-
- public JAXBIntrospector createJAXBIntrospector() {
- return new JAXBIntrospector(xmlContext);
- }
-
- public void setGeneratedClassesToQName(HashMap<Class, QName> classesToQName) {
- this.generatedClassesToQName = classesToQName;
- }
-
- /**
- * ADVANCED:
- * Adjust the OXM metadata to take into accound ORM mapping metadata,
- */
- public void applyORMMetadata(AbstractSession ormSession) {
- this.xmlContext.applyORMMetadata(ormSession);
- }
-
-}
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/oxm/XMLContext.java b/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/oxm/XMLContext.java
deleted file mode 100644
index 5364e8a..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/oxm/XMLContext.java
+++ /dev/null
@@ -1,678 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation from Oracle TopLink
- ******************************************************************************/
-package org.eclipse.persistence.oxm;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.Vector;
-import java.util.Collection;
-import javax.xml.namespace.QName;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.exceptions.XMLMarshalException;
-import org.eclipse.persistence.internal.oxm.accessor.OrmAttributeAccessor;
-import org.eclipse.persistence.internal.oxm.XPathFragment;
-import org.eclipse.persistence.internal.oxm.documentpreservation.DescriptorLevelDocumentPreservationPolicy;
-import org.eclipse.persistence.internal.oxm.documentpreservation.NoDocumentPreservationPolicy;
-import org.eclipse.persistence.internal.security.PrivilegedAccessHelper;
-import org.eclipse.persistence.internal.sessions.AbstractSession;
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.mappings.AttributeAccessor;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.mappings.OneToOneMapping;
-import org.eclipse.persistence.oxm.documentpreservation.DocumentPreservationPolicy;
-import org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping;
-import org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping;
-import org.eclipse.persistence.oxm.platform.SAXPlatform;
-import org.eclipse.persistence.oxm.platform.XMLPlatform;
-import org.eclipse.persistence.oxm.schema.XMLSchemaReference;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Project;
-import org.eclipse.persistence.sessions.SessionEventListener;
-import org.eclipse.persistence.sessions.factories.SessionManager;
-import org.eclipse.persistence.sessions.factories.XMLSessionConfigLoader;
-
-/**
- * <p>
- * An XMLContext is created based on EclipseLink sessions or projects and can then
- * used to create instances of XMLMarshaller, XMLUnmarshaller and XMLValidator.
- *
- * <p>
- * There are constructors to create an XMLContext with a single EclipseLink project
- * or with a String which is a single EclipseLink session name or a ':' separated
- * list of EclipseLink session names.
- *
- * <p>
- * <em>Code Sample</em><br>
- * <code>
- * XMLContext context = new XMLContext("mySessionName");<br>
- * XMLMarshaller marshaller = context.createMarshaller();<br>
- * XMLUnmarshaller unmarshaller = context.createUnmarshaller();<br>
- * XMLValidator validator = context.createValidator();<br>
- * <code>
- *
- * <p>The XMLContext is thread-safe. If multiple threads accessing the same XMLContext object
- * request an XMLMarshaller, each will receive their own instance of XMLMarshaller, so any
- * state that the XMLMarshaller maintains will be unique to that process. The same is true
- * of instances of XMLUnmarshaller and XMLValidator.
- *
- * @see org.eclipse.persistence.oxm.XMLMarshaller
- * @see org.eclipse.persistence.oxm.XMLUnmarshaller
- * @see org.eclipse.persistence.oxm.XMLValidator
- *
- */
-public class XMLContext {
- private List sessions;
- private Map descriptorsByQName;
- private Map descriptorsByGlobalType;
- private boolean hasDocumentPreservation = false;
-
- /**
- * Create a new XMLContext based on the specified session name or list of
- * session names
- *
- * @param sessionNames
- * A single session name or multiple session names separated by a :
- */
- public XMLContext(String sessionNames) {
- this(sessionNames, PrivilegedAccessHelper.privilegedGetClassLoaderForClass(XMLContext.class));
- }
-
- /**
- * Create a new XMLContext based on the specified session name or list of
- * session names
- *
- * @param sessionNames
- * A single session name or multiple session names separated by a :
- * @param classLoader
- * classloader for loading sessions.xml
- */
- public XMLContext(String sessionNames, ClassLoader classLoader) {
- this(sessionNames, classLoader, null);
- }
-
- /**
- * Create a new XMLContext based on passed in session names and session meta
- * XML.
- *
- * @param sessionNames
- * A single session name or multiple session names separated by
- * a:
- * @param xmlResource
- * path to XML file containing session meta data to initialize
- * and load sessions.
- */
- public XMLContext(String sessionNames, String xmlResource) {
- this(sessionNames, PrivilegedAccessHelper.privilegedGetClassLoaderForClass(XMLContext.class), xmlResource);
- }
-
- /**
- * Create a new XMLContext based on passed in session names, classloader and
- * session meta XML.
- *
- * @param sessionNames
- * A single session name or multiple session names separated by a :
- * @param classLoader
- * classloader for loading sessions.xml
- * @param xmlResource
- * path to XML file containing session meta data to initialize
- * and load sessions.
- */
- public XMLContext(String sessionNames, ClassLoader classLoader, String xmlResource) {
- XMLSessionConfigLoader loader = null;
- if (xmlResource != null) {
- loader = new XMLSessionConfigLoader(xmlResource);
- } else {
- loader = new XMLSessionConfigLoader();
- }
- descriptorsByQName = new HashMap();
- descriptorsByGlobalType = new HashMap();
- StringTokenizer st = new StringTokenizer(sessionNames, ":");
- sessions = new ArrayList(st.countTokens());
- int index = 0;
- while (st.hasMoreTokens()) {
- sessions.add(buildSession(st.nextToken(), classLoader, loader));
- index++;
- }
- for (int x = index - 1; x >= 0; x--) {
- storeXMLDescriptorsByQName((DatabaseSession) sessions.get(x));
- }
- }
-
- /**
- * Create a new XMLContext based on the specified project
- *
- * @param project
- * An EclipseLink project
- */
- public XMLContext(Project project) {
- this(project, Thread.currentThread().getContextClassLoader());
- }
-
- public XMLContext(Project project, ClassLoader classLoader) {
- if ((project.getDatasourceLogin() == null) || !(project.getDatasourceLogin().getDatasourcePlatform() instanceof XMLPlatform)) {
- XMLPlatform platform = new SAXPlatform();
- platform.getConversionManager().setLoader(classLoader);
- project.setLogin(new XMLLogin(platform));
- }
- sessions = new ArrayList(1);
- DatabaseSession session = project.createDatabaseSession();
-
- // turn logging for this session off and leave the global session up
- // Note: setting level to SEVERE or WARNING will printout stacktraces for expected exceptions
- session.setLogLevel(SessionLog.OFF);
- // dont turn off global static logging
- //AbstractSessionLog.getLog().log(AbstractSessionLog.INFO, "ox_turn_global_logging_off", getClass());
- //AbstractSessionLog.getLog().setLevel(AbstractSessionLog.OFF);
- setupDocumentPreservationPolicy(session);
- session.login();
- sessions.add(session);
- descriptorsByQName = new HashMap();
- descriptorsByGlobalType = new HashMap();
- storeXMLDescriptorsByQName(session);
- }
-
- public XMLContext(Collection projects) {
- this(projects, Thread.currentThread().getContextClassLoader());
- }
-
- public XMLContext(Collection projects, ClassLoader classLoader) {
- Iterator iterator = projects.iterator();
- sessions = new ArrayList(projects.size());
- descriptorsByQName = new HashMap();
- descriptorsByGlobalType = new HashMap();
- while(iterator.hasNext()) {
- Project project = (Project)iterator.next();
- if ((project.getDatasourceLogin() == null) || !(project.getDatasourceLogin().getDatasourcePlatform() instanceof XMLPlatform)) {
- XMLPlatform platform = new SAXPlatform();
- platform.getConversionManager().setLoader(classLoader);
- project.setLogin(new XMLLogin(platform));
- }
- DatabaseSession session = project.createDatabaseSession();
-
- // turn logging for this session off and leave the global session up
- // Note: setting level to SEVERE or WARNING will printout stacktraces for expected exceptions
- session.setLogLevel(SessionLog.OFF);
- // dont turn off global static logging
- //AbstractSessionLog.getLog().log(AbstractSessionLog.INFO, "ox_turn_global_logging_off", getClass());
- //AbstractSessionLog.getLog().setLevel(AbstractSessionLog.OFF);
- setupDocumentPreservationPolicy(session);
- session.login();
- sessions.add(session);
- storeXMLDescriptorsByQName(session);
- }
- }
-
- private DatabaseSession buildSession(String sessionName, ClassLoader classLoader, XMLSessionConfigLoader sessionLoader) throws XMLMarshalException {
- DatabaseSession dbSession;
- if (classLoader != null) {
- dbSession = (DatabaseSession) SessionManager.getManager().getSession(sessionLoader, sessionName, classLoader, false, true);
- } else {
- dbSession = (DatabaseSession) SessionManager.getManager().getSession(sessionLoader, sessionName, PrivilegedAccessHelper.privilegedGetClassLoaderForClass(this.getClass()), false, false, false);
- }
- if ((dbSession.getDatasourceLogin() == null) || !(dbSession.getDatasourceLogin().getDatasourcePlatform() instanceof XMLPlatform)) {
- XMLPlatform platform = new SAXPlatform();
- dbSession.setLogin(new XMLLogin(platform));
- }
- DatabaseSession session = dbSession.getProject().createDatabaseSession();
- if (dbSession.getEventManager().hasListeners()) {
- List listeners = dbSession.getEventManager().getListeners();
- int listenersSize = listeners.size();
- for (int x = 0; x < listenersSize; x++) {
- session.getEventManager().addListener((SessionEventListener) listeners.get(x));
- }
- }
- session.setExceptionHandler(dbSession.getExceptionHandler());
- session.setLogLevel(SessionLog.OFF);
- setupDocumentPreservationPolicy(session);
- session.login();
- return session;
- }
-
- /**
- * INTERNAL: Add and initialize a new session to the list of sessions
- * associated with this XMLContext.
- */
- public void addSession(DatabaseSession sessionToAdd) {
- if ((sessionToAdd.getDatasourceLogin() == null) || !(sessionToAdd.getDatasourceLogin().getDatasourcePlatform() instanceof XMLPlatform)) {
- XMLPlatform platform = new SAXPlatform();
- sessionToAdd.setLogin(new XMLLogin(platform));
- }
- DatabaseSession session = sessionToAdd.getProject().createDatabaseSession();
- if (sessionToAdd.getEventManager().hasListeners()) {
- List listeners = sessionToAdd.getEventManager().getListeners();
- int listenersSize = listeners.size();
- for (int x = 0; x < listenersSize; x++) {
- session.getEventManager().addListener((SessionEventListener) listeners.get(x));
- }
- }
- session.setExceptionHandler(sessionToAdd.getExceptionHandler());
- session.setLogLevel(SessionLog.OFF);
- this.setupDocumentPreservationPolicy(session);
- session.login();
- sessions.add(session);
-
- storeXMLDescriptorsByQName(session);
-
- }
-
- /**
- * Create a new XMLUnmarshaller
- *
- * @return An XMLUnmarshaller based on this XMLContext
- */
- public XMLUnmarshaller createUnmarshaller() {
- XMLUnmarshaller unmarshaller = new XMLUnmarshaller(this);
- return unmarshaller;
- }
-
- /**
- * Create a new XMLBinder
- * @return an XMLBinder based on this XMLContext
- */
- public XMLBinder createBinder() {
- return new XMLBinder(this);
- }
-
- /**
- * Create a new XMLMarshaller
- *
- * @return An XMLMarshaller based on this XMLContext
- */
- public XMLMarshaller createMarshaller() {
- XMLMarshaller marshaller = new XMLMarshaller(this);
- return marshaller;
- }
-
- /**
- * Create a new XMLValidator
- *
- * @return An XMLValidator based on this XMLContext
- */
- public XMLValidator createValidator() {
- XMLValidator validator = new XMLValidator(this);
- return validator;
- }
-
- /**
- * INTERNAL: Return the session corresponding to this object. Since the
- * object may be mapped by more that one of the projects used to create the
- * XML Context, this method will return the first match.
- *
- * The session will be a unit of work if document preservation is not
- * enabled. This method will typically be used for unmarshalling
- * when a non-shared cache is desired.
- */
- public AbstractSession getReadSession(Object object) {
- if (null == object) {
- return null;
- }
- int numberOfSessions = sessions.size();
- for (int x = 0; x < numberOfSessions; x++) {
- AbstractSession next = ((AbstractSession) sessions.get(x));
- XMLDescriptor xmlDescriptor = (XMLDescriptor) next.getDescriptor(object);
- if (xmlDescriptor != null) {
- // we don't currently support document preservation
- // and non-shared cache (via unit of work)
- //if (!documentPreservationPolicy.shouldPreserveDocument()) {
- next = next.acquireUnitOfWork();
- //}
- return next;
- }
- }
- throw XMLMarshalException.descriptorNotFoundInProject(object.getClass().getName());
- }
-
- /**
- * INTERNAL:
- * Return the session corresponding to this class. Since the class
- * may be mapped by more that one of the projects used to create the XML
- * Context, this method will return the first match.
- *
- * The session will be a unit of work if document preservation is not
- * enabled. This method will typically be used for unmarshalling
- * when a non-shared cache is desired.
- */
- public AbstractSession getReadSession(Class clazz) {
- if (null == clazz) {
- return null;
- }
- int numberOfSessions = sessions.size();
- for (int x = 0; x < numberOfSessions; x++) {
- AbstractSession next = ((AbstractSession) sessions.get(x));
- XMLDescriptor xmlDescriptor = (XMLDescriptor) next.getDescriptor(clazz);
- if (xmlDescriptor != null) {
- // we don't currently support document preservation
- // and non-shared cache (via unit of work)
- //if (!documentPreservationPolicy.shouldPreserveDocument()) {
- next = next.acquireUnitOfWork();
- //}
- return next;
- }
- }
- throw XMLMarshalException.descriptorNotFoundInProject(clazz.getName());
- }
-
- /**
- * INTERNAL:
- * Return the session corresponding to this XMLDescriptor. Since
- * the class may be mapped by more that one of the projects used to create
- * the XML Context, this method will return the first match.
- *
- * The session will be a unit of work if document preservation is not
- * enabled. This method will typically be used for unmarshalling
- * when a non-shared cache is desired.
- */
- public AbstractSession getReadSession(XMLDescriptor xmlDescriptor) {
- if (null == xmlDescriptor) {
- return null;
- }
- int numberOfSessions = sessions.size();
- for (int x = 0; x < numberOfSessions; x++) {
- AbstractSession next = ((AbstractSession) sessions.get(x));
- if (next.getProject().getOrderedDescriptors().contains(xmlDescriptor)) {
- // we don't currently support document preservation
- // and non-shared cache (via unit of work)
- //if (!documentPreservationPolicy.shouldPreserveDocument()) {
- next = next.acquireUnitOfWork();
- //}
- return next;
- }
- }
- throw XMLMarshalException.descriptorNotFoundInProject(xmlDescriptor.getJavaClass().getName());
- }
-
- /**
- * INTERNAL: Return the EclipseLink session used to marshall.
- */
- public List getSessions() {
- return sessions;
- }
-
- /**
- * INTERNAL: <code>
- * XMLContext xmlContext = new XMLContext("path0:path1");<br>
- * DatabaseSession session = xmlContext.getSession(0); // returns session for path0<br>
- * </code>
- */
- public DatabaseSession getSession(int index) {
- if (null == sessions) {
- return null;
- }
- return (DatabaseSession) sessions.get(index);
- }
-
- /**
- * INTERNAL: Return the session corresponding to this object. Since the
- * object may be mapped by more that one of the projects used to create the
- * XML Context, this method will return the first match.
- */
- public AbstractSession getSession(Object object) {
- if (null == object) {
- return null;
- }
- int numberOfSessions = sessions.size();
- for (int x = 0; x < numberOfSessions; x++) {
- AbstractSession next = ((AbstractSession) sessions.get(x));
- if (next.getDescriptor(object) != null) {
- return next;
- }
- }
- throw XMLMarshalException.descriptorNotFoundInProject(object.getClass().getName());
- }
-
- /**
- * INTERNAL: Return the session corresponding to this class. Since the class
- * may be mapped by more that one of the projects used to create the XML
- * Context, this method will return the first match.
- */
- public AbstractSession getSession(Class clazz) {
- if (null == clazz) {
- return null;
- }
- int numberOfSessions = sessions.size();
- for (int x = 0; x < numberOfSessions; x++) {
- AbstractSession next = ((AbstractSession) sessions.get(x));
- if (next.getDescriptor(clazz) != null) {
- return next;
- }
- }
- throw XMLMarshalException.descriptorNotFoundInProject(clazz.getName());
- }
-
- /**
- * INTERNAL: Return the session corresponding to this XMLDescriptor. Since
- * the class may be mapped by more that one of the projects used to create
- * the XML Context, this method will return the first match.
- */
- public AbstractSession getSession(XMLDescriptor xmlDescriptor) {
- if (null == xmlDescriptor) {
- return null;
- }
- int numberOfSessions = sessions.size();
- for (int x = 0; x < numberOfSessions; x++) {
- AbstractSession next = ((AbstractSession) sessions.get(x));
- if (next.getProject().getOrderedDescriptors().contains(xmlDescriptor)) {
- return next;
- }
- }
- throw XMLMarshalException.descriptorNotFoundInProject(xmlDescriptor.getJavaClass().getName());
- }
-
- private void storeXMLDescriptorsByQName(DatabaseSession session) {
- Iterator iterator = session.getProject().getOrderedDescriptors().iterator();
- while (iterator.hasNext()) {
- XMLDescriptor xmlDescriptor = (XMLDescriptor) iterator.next();
- storeXMLDescriptorByQName(xmlDescriptor);
- }
- }
-
- /**
- * INTERNAL:
- */
- public void storeXMLDescriptorByQName(XMLDescriptor xmlDescriptor) {
- QName descriptorQName;
- String defaultRootName;
-
- Vector tableNames = xmlDescriptor.getTableNames();
- for (int i = 0; i < tableNames.size(); i++) {
- defaultRootName = (String) tableNames.get(i);
-
- if (null != defaultRootName) {
- int index = defaultRootName.indexOf(':');
- String defaultRootLocalName = defaultRootName.substring(index + 1);
- if (index > -1) {
- String defaultRootPrefix = defaultRootName.substring(0, index);
- String defaultRootNamespaceURI = xmlDescriptor.getNamespaceResolver().resolveNamespacePrefix(defaultRootPrefix);
- descriptorQName = new QName(defaultRootNamespaceURI, defaultRootLocalName);
- } else {
- if(xmlDescriptor.getNamespaceResolver() != null) {
- descriptorQName = new QName(xmlDescriptor.getNamespaceResolver().getDefaultNamespaceURI(), defaultRootLocalName);
- } else {
- descriptorQName = new QName(defaultRootLocalName);
- }
- }
- if (!xmlDescriptor.hasInheritance() || xmlDescriptor.getInheritancePolicy().isRootParentDescriptor()) {
- descriptorsByQName.put(descriptorQName, xmlDescriptor);
- } else {
- //this means we have a descriptor that is a child in an inheritance hierarchy
- XMLDescriptor existingDescriptor = (XMLDescriptor) descriptorsByQName.get(descriptorQName);
- if (existingDescriptor == null) {
- descriptorsByQName.put(descriptorQName, xmlDescriptor);
- }
- }
- }
- }
-
- XMLSchemaReference xmlSchemaReference = xmlDescriptor.getSchemaReference();
- if (null != xmlSchemaReference) {
- String schemaContext = xmlSchemaReference.getSchemaContext();
- if ((xmlSchemaReference.getType() == XMLSchemaReference.COMPLEX_TYPE) || (xmlSchemaReference.getType() == XMLSchemaReference.SIMPLE_TYPE)) {
- if ((null != schemaContext) && (schemaContext.lastIndexOf('/') == 0)) {
- schemaContext = schemaContext.substring(1, schemaContext.length());
- XPathFragment typeFragment = new XPathFragment(schemaContext);
- if (null != xmlDescriptor.getNamespaceResolver()) {
- typeFragment.setNamespaceURI(xmlDescriptor.getNamespaceResolver().resolveNamespacePrefix(typeFragment.getPrefix()));
- }
- this.descriptorsByGlobalType.put(typeFragment, xmlDescriptor);
- } else {
- QName qname = xmlSchemaReference.getSchemaContextAsQName();
- if (qname != null) {
- if (xmlDescriptor.isWrapper() && xmlDescriptor.getJavaClassName().contains("ObjectWrapper")) {
- return;
- }
- XPathFragment typeFragment = new XPathFragment();
- typeFragment.setLocalName(qname.getLocalPart());
- typeFragment.setNamespaceURI(qname.getNamespaceURI());
- this.descriptorsByGlobalType.put(typeFragment, xmlDescriptor);
- }
- }
- }
- }
- }
-
- /**
- * INTERNAL: Return the XMLDescriptor with the default root mapping matchin
- * the QName paramater.
- */
- public XMLDescriptor getDescriptor(QName qName) {
- return (XMLDescriptor) descriptorsByQName.get(qName);
- }
-
- public void addDescriptorByQName(QName qName, XMLDescriptor descriptor) {
- descriptorsByQName.put(qName, descriptor);
- }
-
- /**
- * INTERNAL: Return the XMLDescriptor mapped to the global type matching the
- * XPathFragment parameter.
- */
- public XMLDescriptor getDescriptorByGlobalType(XPathFragment xPathFragment) {
- return (XMLDescriptor) this.descriptorsByGlobalType.get(xPathFragment);
- }
-
- /**
- * INTERNAL:
- * Return the DocumentPreservationPolicy associated with this session
- * @param session
- * @return
- */
- public DocumentPreservationPolicy getDocumentPreservationPolicy(AbstractSession session) {
- XMLLogin login = (XMLLogin) session.getDatasourceLogin();
- return login.getDocumentPreservationPolicy();
- }
-
- public void setupDocumentPreservationPolicy(DatabaseSession session) {
- XMLLogin login = (XMLLogin) session.getDatasourceLogin();
- if (login.getDocumentPreservationPolicy() == null) {
- Iterator iterator = session.getProject().getOrderedDescriptors().iterator();
- while (iterator.hasNext()) {
- XMLDescriptor xmlDescriptor = (XMLDescriptor) iterator.next();
- if (xmlDescriptor.shouldPreserveDocument()) {
- login.setDocumentPreservationPolicy(new DescriptorLevelDocumentPreservationPolicy());
- break;
- }
- }
- }
- if (login.getDocumentPreservationPolicy() == null) {
- login.setDocumentPreservationPolicy(new NoDocumentPreservationPolicy());
- }
-
- login.getDocumentPreservationPolicy().initialize(this);
-
- if (login.getDocumentPreservationPolicy().shouldPreserveDocument() && !hasDocumentPreservation) {
- hasDocumentPreservation = true;
- }
- }
-
- /**
- * INTERNAL:
- * Return true if any session held onto by this context has a document preservation
- * policy that requires unmarshalling from a Node.
- */
- public boolean hasDocumentPreservation() {
- return this.hasDocumentPreservation;
- }
-
- /**
- * ADVANCED:
- * Adjust the OXM metadata to take into accound ORM mapping metadata,
- */
- public void applyORMMetadata(AbstractSession ormSession) {
- //Iterate over the ORM descriptors and check for matching OXM descriptors
- Iterator ormDescriptors = ormSession.getDescriptors().values().iterator();
- while(ormDescriptors.hasNext()) {
- ClassDescriptor ormDescriptor = (ClassDescriptor)ormDescriptors.next();
- Class javaClass = ormDescriptor.getJavaClass();
- AbstractSession oxmSession = null;
- try {
- oxmSession = this.getSession(javaClass);
- } catch(XMLMarshalException ex) {
- //if we couldn't find a session for this class, we
- //don't have an OX descriptor for it.
- }
- if(oxmSession != null) {
- ClassDescriptor oxmDescriptor = oxmSession.getDescriptor(javaClass);
- //If we have an oxmDescriptor for this ORM descriptor, iterate over
- //mappings, and update the required OXM mappings attribute accessors
- Iterator<DatabaseMapping> ormMappings = ormDescriptor.getMappings().iterator();
- while(ormMappings.hasNext()) {
- DatabaseMapping ormMapping = ormMappings.next();
- DatabaseMapping oxmMapping = oxmDescriptor.getMappingForAttributeName(ormMapping.getAttributeName());
- if(oxmMapping != null) {
- AttributeAccessor oxmAccessor = oxmMapping.getAttributeAccessor();
- OrmAttributeAccessor newAccessor = new OrmAttributeAccessor(ormMapping.getAttributeAccessor(), oxmAccessor);
- if(ormMapping.isOneToOneMapping() && ((OneToOneMapping)ormMapping).usesIndirection()) {
- newAccessor.setValueHolderProperty(true);
- }
- newAccessor.setChangeTracking(ormDescriptor.getObjectChangePolicy().isAttributeChangeTrackingPolicy());
- oxmMapping.setAttributeAccessor(newAccessor);
-
- //check to see if we need to deal with containerAccessor
- AttributeAccessor containerAccessor = null;
- Class containerClass = null;
- if(oxmMapping instanceof XMLCompositeObjectMapping) {
- containerAccessor = ((XMLCompositeObjectMapping)oxmMapping).getContainerAccessor();
- containerClass = ((XMLCompositeObjectMapping)oxmMapping).getReferenceClass();
- } else if(oxmMapping instanceof XMLCompositeCollectionMapping) {
- containerAccessor = ((XMLCompositeCollectionMapping)oxmMapping).getContainerAccessor();
- containerClass = ((XMLCompositeCollectionMapping)oxmMapping).getReferenceClass();
- }
- if(containerAccessor != null) {
- ClassDescriptor containerDescriptor = ormSession.getDescriptor(containerClass);
- if(containerDescriptor != null) {
- DatabaseMapping ormContainerMapping = containerDescriptor.getMappingForAttributeName(containerAccessor.getAttributeName());
- if(ormContainerMapping != null) {
- //Check for indirection on the container mapping
- OrmAttributeAccessor ormAccessor = new OrmAttributeAccessor(ormContainerMapping.getAttributeAccessor(), containerAccessor);
- ormAccessor.setChangeTracking(containerDescriptor.getObjectChangePolicy().isAttributeChangeTrackingPolicy());
- ormAccessor.setValueHolderProperty(ormContainerMapping instanceof OneToOneMapping && ((OneToOneMapping)ormContainerMapping).usesIndirection());
- if(oxmMapping instanceof XMLCompositeObjectMapping) {
- ((XMLCompositeObjectMapping)oxmMapping).setContainerAccessor(ormAccessor);
- } else if(oxmMapping instanceof XMLCompositeCollectionMapping) {
- ((XMLCompositeCollectionMapping)oxmMapping).setContainerAccessor(ormAccessor);
- }
-
- }
- }
- }
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/sdo/helper/jaxb/JAXBListWrapper.java b/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/sdo/helper/jaxb/JAXBListWrapper.java
deleted file mode 100644
index 7aaa973..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/sdo/helper/jaxb/JAXBListWrapper.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 1998, 2008 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
-* which accompanies this distribution.
-* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
-* and the Eclipse Distribution License is available at
-* http://www.eclipse.org/org/documents/edl-v10.php.
-*
-* Contributors:
-* mmacivor - Jan 27/2009 - 1.1 - Initial implementation
-******************************************************************************/
-package org.eclipse.persistence.sdo.helper.jaxb;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.persistence.descriptors.changetracking.ChangeTracker;
-import org.eclipse.persistence.internal.queries.ContainerPolicy;
-import org.eclipse.persistence.internal.sessions.AbstractSession;
-import org.eclipse.persistence.jaxb.JAXBContext;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping;
-import org.eclipse.persistence.sdo.SDOChangeSummary;
-import org.eclipse.persistence.sdo.SDOProperty;
-import org.eclipse.persistence.sdo.helper.ListWrapper;
-
-import commonj.sdo.DataObject;
-
-public class JAXBListWrapper extends ListWrapper {
-
- private JAXBValueStore jaxbValueStore;
- private DatabaseMapping mapping;
- private ContainerPolicy containerPolicy;
- private AbstractSession session;
- private Object elements;
-
- public JAXBListWrapper(JAXBValueStore theJAXBValueStore, SDOProperty theProperty) {
- super(theJAXBValueStore.getDataObject(), theProperty);
-
- this.jaxbValueStore = theJAXBValueStore;
- JAXBContext jaxbContext = (JAXBContext) jaxbValueStore.getJAXBHelperContext().getJAXBContext();
- this.session = jaxbContext.getXMLContext().getSession(jaxbValueStore.getEntity().getClass());
- this.mapping = jaxbValueStore.getJAXBMappingForProperty(theProperty);
- this.containerPolicy = mapping.getContainerPolicy();
- this.elements = mapping.getAttributeValueFromObject(jaxbValueStore.getEntity());
- if(this.elements == null) {
- this.elements = containerPolicy.containerInstance();
- mapping.setAttributeValueInObject(jaxbValueStore.getEntity(), elements);
- }
- }
-
- public JAXBListWrapper(JAXBValueStore theJAXBValueStore, SDOProperty theProperty, List list) {
- this(theJAXBValueStore, theProperty);
- this.elements = list;
- }
-
- @SuppressWarnings("unused")
- private List getEmptyList() {
- if(containerPolicy == null) {
- return null;
- }
- return (List)containerPolicy.containerInstance();
- }
-
- public boolean add(Object item, boolean updateSequence) {
- // Not allowed to add null if the property is non-nullable
- if (item == null && (property != null && !property.isNullable())) {
- throw new UnsupportedOperationException("Property [" + property.getName() + "] is non-nullable");
- }
-
- // update element arrays before we modify original object
- // copyElements();
-
- Object itemToAdd = item;
- if(!this.property.getType().isDataType()) {
- itemToAdd = this.jaxbValueStore.getJAXBHelperContext().unwrap((DataObject)item);
- }
-
- boolean result = this.containerPolicy.addInto(itemToAdd, elements, session);
-
- // update containment
- updateContainment(item, updateSequence);
-
- return result;
- }
-
- public void add(int index, Object item, boolean updateSequence) {
- // Not allowed to add null if the property is non-nullable
- if (item == null && (property != null && !property.isNullable())) {
- throw new UnsupportedOperationException("Property [" + property.getName() + "] is non-nullable");
- }
-
- // fail-fast range checking
- if ((index < 0) || (index > size())) {
- return;
- }
-
- // update element arrays before we modify original object
- copyElements();
-
- // delegate to superclass
- Object itemToAdd = item;
- if(!property.getType().isDataType()) {
- itemToAdd = jaxbValueStore.getJAXBHelperContext().unwrap((DataObject)item);
- }
- //ContainerPolicy doesn't support adding with index.
- Vector v = containerPolicy.vectorFor(elements, session);
- v.add(index, itemToAdd);
- containerPolicy.clear(elements);
- for(Object next:v) {
- containerPolicy.addInto(next, elements, session);
- }
-
- // update containment
- updateContainment(item, updateSequence);
- }
-
- protected void copyElements() {
- // update element arrays before we modify original object
- if (isLogging() && (!((SDOChangeSummary)dataObject.getChangeSummary()).isDirty(this))) {
- //getElements will return a new Vector containing the elements. No need to update the main collection.
- ((SDOChangeSummary)dataObject.getChangeSummary()).getOriginalElements().put(this, getCurrentElements());
- }
- }
-
- private boolean isLogging() {
- return ((dataObject != null) && (dataObject.getChangeSummary() != null) && dataObject.getChangeSummary().isLogging());
- }
-
- public List getCurrentElements() {
- if(property.getType().isDataType()) {
- return containerPolicy.vectorFor(elements, session);
- } else {
- if(property.isContainment()) {
- return jaxbValueStore.getJAXBHelperContext().wrap(containerPolicy.vectorFor(elements, session), property, jaxbValueStore.getDataObject());
- } else {
- return jaxbValueStore.getJAXBHelperContext().wrap(containerPolicy.vectorFor(elements, session));
- }
- }
- }
-
- public void setCurrentElements(List newElements) {
- if(newElements == null || newElements.size() == 0) {
- this.elements = containerPolicy.containerInstance();
- }
- this.elements = containerPolicy.containerInstance(newElements.size());
- List elementsToAdd = newElements;
- if(!property.getType().isDataType()) {
- elementsToAdd = jaxbValueStore.getJAXBHelperContext().unwrap(newElements);
- }
- for(int i = 0; i < newElements.size(); i++) {
- if(!property.getType().isDataType()) {
- containerPolicy.addInto(elementsToAdd.get(i), this.elements, session);
- }
- }
- this.mapping.setAttributeValueInObject(jaxbValueStore.getEntity(), elements);
- }
-
- public void undoChanges(SDOChangeSummary cs) {
- // ignore logging state
- if (null == cs) {
- return;
- }
- if (cs.isDirty(this)) {
- // swap elements, discard current state
- setCurrentElements((List)cs.getOriginalElements().get(this));
- cs.getOriginalElements().remove(this);
- }
- }
-
- public boolean remove(Object item, boolean fromDelete, boolean updateSequence) {
- // update element arrays before we modify original object
- copyElements();
- // pass the remove containment (fromDelete) flag back to the recursive delete/detach call to dataObject
- // fromDelete will always be false when called within ListWrapper
- removeContainment(item, fromDelete, updateSequence);
- // remove the first occurrence of any duplicates
- Object toRemove = item;
- if(!property.getType().isDataType()) {
- toRemove = jaxbValueStore.getJAXBHelperContext().unwrap((DataObject)item);
- }
- return containerPolicy.removeFrom(toRemove, elements, session);
- }
-
- public boolean addAll(Collection items, boolean updateSequence) {
- // Not allowed to add null if the property is non-nullable
- if (items.contains(null) && (property != null && !property.isNullable())) {
- throw new UnsupportedOperationException("Property [" + property.getName() + "] is non-nullable");
- }
-
- // update element arrays before we modify original object
- copyElements();
-
- // add new elements before we have updated containment on the items - duplicates will be removed
- boolean modified = false;
- if(items != null && !(items.size() == 0)) {
- modified = true;
- Iterator itemsIterator = items.iterator();
- while(itemsIterator.hasNext()) {
- Object next = itemsIterator.next();
- if(!(property.getType().isDataType())) {
- next = jaxbValueStore.getJAXBHelperContext().unwrap((DataObject)next);
- }
- containerPolicy.addInto(next, elements, session);
- }
- }
-
- dataObject._getCurrentValueStore().setManyProperty(property, this);
-
- /**
- * Corner case: Duplicate DataObjects
- * The effect of updateContainment on duplicates will be the removal of all but one of the duplicates
- * in the items collection that was added.
- * For sequences we must remove duplicates from items to match updateContainment for containment dataObjects
- */
- dataObject.updateContainment(property, items, updateSequence);
-
- // create new settings outside of updateContainment as we do earlier in currentElements.add
- updateSequence(property, items, updateSequence);
-
- return modified;
- }
-
- public boolean addAll(int position, Collection items, boolean updateSequence) {
- // fail-fast range checking
- if ((position < 0) || (position > size())) {
- return false;
- }
- if ((items == null) || (items.size() == 0)) {
- return false;
- }
-
- // Not allowed to add null if the property is non-nullable
- if (items.contains(null) && (property != null && !property.isNullable())) {
- throw new UnsupportedOperationException("Property [" + property.getName() + "] is non-nullable");
- }
-
- boolean modified = true;
- // update element arrays before we modify original object
- copyElements();
-
- //need to use Vector for indexed operations
- Vector v = containerPolicy.vectorFor(elements, session);
- Collection unwrappedItems = items;
- if(!property.getType().isDataType()) {
- unwrappedItems = jaxbValueStore.getJAXBHelperContext().unwrap((Collection<DataObject>)items);
- }
- v.addAll(position, unwrappedItems);
-
- containerPolicy.clear(elements);
- for(Object next:v) {
- containerPolicy.addInto(next, elements, session);
- }
-
- // update containment
- dataObject.updateContainment(property, items);
-
- // create new settings outside of updateContainment as we do earlier in currentElements.add
- updateSequence(property, items, updateSequence);
-
- return modified;
- }
-
- public int size() {
- return containerPolicy.sizeFor(elements);
- }
-
- public boolean isEmpty() {
- return containerPolicy.isEmpty(elements);
- }
-
- public boolean contains(Object item) {
- if(property.getType().isDataType()) {
- return containerPolicy.contains(item, elements, session);
- } else {
- return containerPolicy.contains(jaxbValueStore.getJAXBHelperContext().unwrap((DataObject)item), elements, session);
- }
- }
-
- public boolean containsAll(Collection items) {
- for(Object next:items) {
- if(!(contains(next))) {
- return false;
- }
- }
- return true;
- }
-
- public Object remove(int index, boolean updateSequence) {
- // fail-fast range checking
- if ((index < 0) || (index >= size())) {
- return null;
- }
-
- // update element arrays before we modify original object
- copyElements();
-
- // Update containment of object and container, do not recursively remove containment
- Object toRemove = get(index);
- int occurrence = getOccurrenceIndex(toRemove);
- removeContainment(occurrence, toRemove, false, updateSequence);
-
- // may need to unwrap
- if(!property.getType().isDataType()) {
- toRemove = jaxbValueStore.getJAXBHelperContext().unwrap((DataObject)toRemove);
- }
- return containerPolicy.removeFrom(toRemove, elements, session);
- }
-
- public Object get(int index) {
- Object toReturn = containerPolicy.vectorFor(elements, session).elementAt(index);
- if(!(property.getType().isDataType())) {
- if(property.isContainment()) {
- toReturn = jaxbValueStore.getJAXBHelperContext().wrap(toReturn, property, jaxbValueStore.getDataObject());
- } else {
- toReturn = jaxbValueStore.getJAXBHelperContext().wrap(toReturn);
- }
- }
- return toReturn;
- }
-
- private int getOccurrenceIndex(Object element) {
- int occurrence = 0;
- boolean skipFirstOccurrence = true;
- Vector currentElements = containerPolicy.vectorFor(elements, session);
- for (int position = 0, size = size(); position < size; position++) {
- Object searchIndexObject = currentElements.get(position);
- // match only objects that are duplicates of this current one
- if (element == searchIndexObject) {
- //skip counting the first occurrence
- if (skipFirstOccurrence) {
- skipFirstOccurrence = false;
- } else {
- occurrence++;
- }
- }
- }
- return occurrence;
- }
-
- public ListIterator listIterator() {
- List currentElements = containerPolicy.vectorFor(elements, session);
- if(!property.getType().isDataType()) {
- currentElements = jaxbValueStore.getJAXBHelperContext().wrap(currentElements);
- }
- return currentElements.listIterator();
- }
-
- public ListIterator listIterator(int position) {
- List currentElements = containerPolicy.vectorFor(elements, session);
- if(!property.getType().isDataType()) {
- currentElements = jaxbValueStore.getJAXBHelperContext().wrap(currentElements);
- }
- return currentElements.listIterator(position);
- }
-
- public int indexOf(Object item) {
- if(property.getType().isDataType()) {
- return containerPolicy.vectorFor(elements, session).indexOf(item);
- } else {
- return containerPolicy.vectorFor(elements, session).indexOf(jaxbValueStore.getJAXBHelperContext().unwrap((DataObject)item));
- }
- }
-
- public int lastIndexOf(Object item) {
- if(property.getType().isDataType()) {
- return containerPolicy.vectorFor(elements, session).lastIndexOf(item);
- } else {
- return containerPolicy.vectorFor(elements, session).lastIndexOf(jaxbValueStore.getJAXBHelperContext().unwrap((DataObject)item));
- }
- }
-
- public Object writeReplace() {
- if(property.getType().isDataType()) {
- return containerPolicy.vectorFor(elements, session);
- } else {
- return jaxbValueStore.getJAXBHelperContext().wrap(containerPolicy.vectorFor(elements, session));
- }
- }
-
- public Iterator iterator() {
- if(property.getType().isDataType()) {
- return containerPolicy.vectorFor(elements, session).iterator();
- } else {
- return jaxbValueStore.getJAXBHelperContext().wrap(containerPolicy.vectorFor(elements, session)).iterator();
- }
- }
-
- protected void updateContainment(Object item, boolean updateSequence) {
- if(mapping.isAbstractCompositeCollectionMapping() && null != item) {
- XMLCompositeCollectionMapping compositeMapping = (XMLCompositeCollectionMapping) mapping;
- if(compositeMapping.getContainerAccessor() != null) {
- Object itemEntity = jaxbValueStore.getJAXBHelperContext().unwrap((DataObject) item);
- compositeMapping.getContainerAccessor().setAttributeValueInObject(itemEntity, jaxbValueStore.getEntity());
- }
- }
- super.updateContainment(item, updateSequence);
- }
-
-}
\ No newline at end of file
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/sdo/helper/jaxb/JAXBValueStore.java b/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/sdo/helper/jaxb/JAXBValueStore.java
deleted file mode 100644
index 2d8353d..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/sdo/helper/jaxb/JAXBValueStore.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 1998, 2008 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
-* which accompanies this distribution.
-* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
-* and the Eclipse Distribution License is available at
-* http://www.eclipse.org/org/documents/edl-v10.php.
-*
-* Contributors:
-* bdoughan - Jan 27/2009 - 1.1 - Initial implementation
-******************************************************************************/
-package org.eclipse.persistence.sdo.helper.jaxb;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.persistence.descriptors.changetracking.ChangeTracker;
-import org.eclipse.persistence.exceptions.SDOException;
-import org.eclipse.persistence.internal.helper.DatabaseField;
-import org.eclipse.persistence.internal.oxm.MappingNodeValue;
-import org.eclipse.persistence.internal.oxm.TreeObjectBuilder;
-import org.eclipse.persistence.internal.oxm.XPathFragment;
-import org.eclipse.persistence.internal.oxm.XPathNode;
-import org.eclipse.persistence.internal.queries.ContainerPolicy;
-import org.eclipse.persistence.internal.sessions.AbstractSession;
-import org.eclipse.persistence.jaxb.JAXBContext;
-import org.eclipse.persistence.mappings.ContainerMapping;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.oxm.XMLDescriptor;
-import org.eclipse.persistence.oxm.XMLField;
-import org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping;
-import org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping;
-import org.eclipse.persistence.oxm.mappings.XMLDirectMapping;
-import org.eclipse.persistence.oxm.mappings.XMLObjectReferenceMapping;
-import org.eclipse.persistence.sdo.SDODataObject;
-import org.eclipse.persistence.sdo.SDOProperty;
-import org.eclipse.persistence.sdo.SDOType;
-import org.eclipse.persistence.sdo.ValueStore;
-import org.eclipse.persistence.sdo.helper.ListWrapper;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.Property;
-
-/**
- * The JAXBValueStore enables a DataObject to access data from a POJO.
- * The link between an SDO property and a POJO property is through their
- * XML representation. For the POJO property this corresponds to its
- * JAXB mapping.
- */
-public class JAXBValueStore implements ValueStore {
-
- private JAXBHelperContext jaxbHelperContext;
- private Object entity;
- private XMLDescriptor descriptor;
- private SDODataObject dataObject;
- private Map<Property, ListWrapper> listWrappers;
-
- public JAXBValueStore(JAXBHelperContext aJAXBHelperContext, SDOType sdoType) {
- this.jaxbHelperContext = aJAXBHelperContext;
- QName xsdQName = sdoType.getXsdType();
- if(null == xsdQName) {
- xsdQName = sdoType.getQName();
- }
- listWrappers = new WeakHashMap<Property, ListWrapper>();
- XPathFragment xPathFragment = new XPathFragment(xsdQName.getLocalPart());
- xPathFragment.setNamespaceURI(xsdQName.getNamespaceURI());
- JAXBContext jaxbContext = (JAXBContext) jaxbHelperContext.getJAXBContext();
- this.descriptor = jaxbContext.getXMLContext().getDescriptorByGlobalType(xPathFragment);
- if (null == this.descriptor) {
- this.descriptor = jaxbContext.getXMLContext().getDescriptor(xsdQName);
- if (null == this.descriptor) {
- throw SDOException.sdoJaxbNoDescriptorForType(sdoType.getQName(), xsdQName);
- }
- }
- this.entity = descriptor.getInstantiationPolicy().buildNewInstance();
- }
-
- public JAXBValueStore(JAXBHelperContext aJAXBHelperContext, Object anEntity) {
- this.jaxbHelperContext = aJAXBHelperContext;
- this.listWrappers = new WeakHashMap<Property, ListWrapper>();
- JAXBContext jaxbContext = (JAXBContext) jaxbHelperContext.getJAXBContext();
- this.descriptor = (XMLDescriptor) jaxbContext.getXMLContext().getSession(anEntity).getDescriptor(anEntity);
- this.entity = anEntity;
- }
-
- /**
- * Return the DataObject associated with this value store.
- */
- SDODataObject getDataObject() {
- return dataObject;
- }
-
- /**
- * Return the POJO associated with this value store.
- */
- Object getEntity() {
- return entity;
- }
-
- /**
- * Return the XMLDescriptor associated with this value store.
- * This is the XMLDescriptor for the associated POJO.
- */
- XMLDescriptor getEntityDescriptor() {
- return descriptor;
- }
-
- /**
- * Return the JAXBHelperContext. This is the JAXBHelperContext
- * used to create the DataObject.
- */
- JAXBHelperContext getJAXBHelperContext() {
- return jaxbHelperContext;
- }
-
- /**
- * Initialize the value store with its associated DataObject.
- */
- public void initialize(DataObject aDataObject) {
- this.dataObject = (SDODataObject) aDataObject;
- }
-
- /**
- * Get the value from the wrapped POJO, wrapping in DataObjects as
- * necessary.
- */
- public Object getDeclaredProperty(int propertyIndex) {
- SDOProperty declaredProperty = (SDOProperty) dataObject.getType().getDeclaredProperties().get(propertyIndex);
- DatabaseMapping mapping = this.getJAXBMappingForProperty(declaredProperty);
- Object value = mapping.getAttributeAccessor().getAttributeValueFromObject(entity);
- if (null == value || declaredProperty.getType().isDataType()) {
- if (declaredProperty.isMany()) {
- return new JAXBListWrapper(this, declaredProperty);
- } else {
- return value;
- }
- } else if (declaredProperty.isMany()) {
- ListWrapper listWrapper = listWrappers.get(declaredProperty);
- if (null != listWrapper) {
- return listWrapper;
- }
- listWrapper = new JAXBListWrapper(this, declaredProperty);
- listWrappers.put(declaredProperty, listWrapper);
- return listWrapper;
- } else {
- if(declaredProperty.isContainment()) {
- return jaxbHelperContext.wrap(value, declaredProperty, dataObject);
- } else {
- return jaxbHelperContext.wrap(value);
- }
- }
- }
-
- /**
- * Set the value on the underlying POJO, unwrapping values as necessary.
- */
- public void setDeclaredProperty(int propertyIndex, Object value) {
- SDOProperty declaredProperty = (SDOProperty) dataObject.getType().getDeclaredProperties().get(propertyIndex);
- DatabaseMapping mapping = this.getJAXBMappingForProperty(declaredProperty);
-
- Object newValue = value;
- Object oldValue = mapping.getAttributeAccessor().getAttributeValueFromObject(entity);
-
- if (declaredProperty.getType().isDataType()) {
- if (!declaredProperty.isMany()) {
- AbstractSession session = ((JAXBContext) jaxbHelperContext.getJAXBContext()).getXMLContext().getSession(entity);
- XMLDirectMapping directMapping = (XMLDirectMapping) mapping;
- if (directMapping.hasConverter()) {
- newValue = directMapping.getConverter().convertDataValueToObjectValue(newValue, session);
- } else {
- DatabaseField field = mapping.getField();
- newValue = session.getDatasourcePlatform().getConversionManager().convertObject(newValue, descriptor.getObjectBuilder().getFieldClassification(field));
- }
- }
- mapping.setAttributeValueInObject(entity, newValue);
- } else if (declaredProperty.isMany()) {
- // Get a ListWrapper and set it's current elements
- ListWrapper listWrapper = (ListWrapper) getDeclaredProperty(propertyIndex);
- listWrapper.setCurrentElements((List) newValue);
- } else {
- // OLD VALUE
- if (mapping.isAbstractCompositeObjectMapping()) {
- XMLCompositeObjectMapping compositeMapping = (XMLCompositeObjectMapping) mapping;
- if (oldValue != null && compositeMapping.getContainerAccessor() != null) {
- compositeMapping.getContainerAccessor().setAttributeValueInObject(oldValue, null);
- }
- }
-
- // NEW VALUE
- newValue = jaxbHelperContext.unwrap((DataObject) value);
- mapping.getAttributeAccessor().setAttributeValueInObject(entity, newValue);
- if (mapping.isAbstractCompositeObjectMapping()) {
- XMLCompositeObjectMapping compositeMapping = (XMLCompositeObjectMapping) mapping;
- if (value != null && compositeMapping.getContainerAccessor() != null) {
- compositeMapping.getContainerAccessor().setAttributeValueInObject(newValue, entity);
- }
- }
- }
-
- }
-
- /**
- * For isMany=false properties return true if not null. For collection properties
- * return true if the collection is not empty.
- */
- public boolean isSetDeclaredProperty(int propertyIndex) {
- SDOProperty declaredProperty = (SDOProperty) dataObject.getType().getDeclaredProperties().get(propertyIndex);
- DatabaseMapping mapping = this.getJAXBMappingForProperty(declaredProperty);
- if (declaredProperty.isMany()) {
- Collection collection = (Collection) mapping.getAttributeAccessor().getAttributeValueFromObject(entity);
- if (null == collection) {
- return false;
- }
- return !collection.isEmpty();
- } else {
- return null != mapping.getAttributeAccessor().getAttributeValueFromObject(entity);
- }
- }
-
- /**
- * For isMany=false properties set the value to null. For isMany=true set
- * the value to an empty container of the appropriate type.
- */
- public void unsetDeclaredProperty(int propertyIndex) {
- SDOProperty declaredProperty = (SDOProperty) dataObject.getType().getDeclaredProperties().get(propertyIndex);
- DatabaseMapping mapping = this.getJAXBMappingForProperty(declaredProperty);
- if (declaredProperty.isMany()) {
- ContainerMapping containerMapping = (ContainerMapping) mapping;
- ContainerPolicy containerPolicy = containerMapping.getContainerPolicy();
-
- // OLD VALUE
- if (mapping.isAbstractCompositeCollectionMapping()) {
- XMLCompositeCollectionMapping compositeMapping = (XMLCompositeCollectionMapping) mapping;
- if (compositeMapping.getContainerAccessor() != null) {
-
- Object oldContainer = mapping.getAttributeValueFromObject(entity);
- if (oldContainer != null) {
- AbstractSession session = ((JAXBContext) jaxbHelperContext.getJAXBContext()).getXMLContext().getSession(entity);
- Object iterator = containerPolicy.iteratorFor(oldContainer);
- while (containerPolicy.hasNext(iterator)) {
- Object oldValue = containerPolicy.next(iterator, session);
- compositeMapping.getContainerAccessor().setAttributeValueInObject(oldValue, null);
- }
- }
- }
- }
-
- // NEW VALUE
- Object container = containerPolicy.containerInstance();
- mapping.getAttributeAccessor().setAttributeValueInObject(entity, container);
- } else {
- // OLD VALUE
- Object oldValue = mapping.getAttributeAccessor().getAttributeValueFromObject(entity);
- if (mapping.isAbstractCompositeObjectMapping()) {
- XMLCompositeObjectMapping compositeMapping = (XMLCompositeObjectMapping) mapping;
- if (compositeMapping.getContainerAccessor() != null) {
- if (oldValue != null) {
- compositeMapping.getContainerAccessor().setAttributeValueInObject(oldValue, null);
- }
- }
- }
-
- // NEW VALUE
- mapping.getAttributeAccessor().setAttributeValueInObject(entity, null);
- }
- }
-
- public Object getOpenContentProperty(Property property) {
- throw new UnsupportedOperationException();
- }
-
- public void setOpenContentProperty(Property property, Object value) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isSetOpenContentProperty(Property property) {
- throw new UnsupportedOperationException();
- }
-
- public void unsetOpenContentProperty(Property property) {
- throw new UnsupportedOperationException();
- }
-
- public void setManyProperty(Property property, Object value) {
- DatabaseMapping mapping = this.getJAXBMappingForProperty((SDOProperty) property);
- ContainerMapping containerMapping = (ContainerMapping) mapping;
- ContainerPolicy containerPolicy = containerMapping.getContainerPolicy();
- AbstractSession session = ((JAXBContext) jaxbHelperContext.getJAXBContext()).getXMLContext().getSession(entity);
- Collection collection = (Collection) value;
- if (!property.getType().isDataType()) {
- collection = getJAXBHelperContext().unwrap(collection);
- }
-
- Iterator collectionIterator = collection.iterator();
- Object container = containerMapping.getContainerPolicy().containerInstance();
- while (collectionIterator.hasNext()) {
- Object collectionValue = collectionIterator.next();
- containerPolicy.addInto(collectionValue, container, session);
- }
- mapping.setAttributeValueInObject(entity, container);
- }
-
- public ValueStore copy() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the JAXB mapping for the SDO property. They are matched
- * on their XML schema representation.
- */
- DatabaseMapping getJAXBMappingForProperty(SDOProperty sdoProperty) {
- DatabaseMapping sdoMapping = sdoProperty.getXmlMapping();
- XMLField field;
- if (sdoMapping instanceof XMLObjectReferenceMapping) {
- XMLObjectReferenceMapping referenceMapping = (XMLObjectReferenceMapping) sdoMapping;
- field = (XMLField) referenceMapping.getFields().get(0);
- } else {
- field = (XMLField) sdoMapping.getField();
- }
- TreeObjectBuilder treeObjectBuilder = (TreeObjectBuilder) descriptor.getObjectBuilder();
- XPathNode xPathNode = treeObjectBuilder.getRootXPathNode();
- XPathFragment xPathFragment = field.getXPathFragment();
- while (xPathNode != null && xPathFragment != null) {
- if (xPathFragment.isAttribute()) {
- if (sdoProperty.isMany() && !sdoProperty.isContainment() && !sdoProperty.getType().isDataType()) {
- xPathFragment = null;
- break;
- }
- Map attributeChildrenMap = xPathNode.getAttributeChildrenMap();
- if (null == attributeChildrenMap) {
- xPathNode = null;
- } else {
- xPathNode = (XPathNode) xPathNode.getAttributeChildrenMap().get(xPathFragment);
- }
- } else {
- Map nonAttributeChildrenMap = xPathNode.getNonAttributeChildrenMap();
- if (null == nonAttributeChildrenMap) {
- xPathNode = null;
- } else {
- xPathNode = (XPathNode) xPathNode.getNonAttributeChildrenMap().get(xPathFragment);
- }
- }
- xPathFragment = xPathFragment.getNextFragment();
- if (xPathFragment != null && xPathFragment.nameIsText()) {
- if (sdoProperty.isMany() && !sdoProperty.isContainment()) {
- xPathFragment = null;
- break;
- }
- }
- }
- if (null == xPathFragment && xPathNode != null) {
- if (xPathNode.getNodeValue().isMappingNodeValue()) {
- MappingNodeValue mappingNodeValue = (MappingNodeValue) xPathNode.getNodeValue();
- return mappingNodeValue.getMapping();
- }
- }
- throw SDOException.sdoJaxbNoMappingForProperty(sdoProperty.getName(), field.getXPath());
- }
-
-}
\ No newline at end of file
diff --git a/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/sdo/internal/jpa/ChangeSetBuilder.java b/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/sdo/internal/jpa/ChangeSetBuilder.java
deleted file mode 100644
index b3d6d9c..0000000
--- a/das/trunk/org.eclipse.persistence.sdo.das/src/org/eclipse/persistence/sdo/internal/jpa/ChangeSetBuilder.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * bdoughan - JPA DAS INCUBATOR - Enhancement 258057
- * http://wiki.eclipse.org/EclipseLink/Development/SDO-JPA
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.sdo.internal.jpa;
-
-import org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet;
-import org.eclipse.persistence.sessions.DatabaseSession;
-
-import commonj.sdo.DataObject;
-
-/**
- * <b>Purpose</b>: Converts SDO DataObject with ChangeSummary into EclipseLink
- * ChangeSets.
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-public class ChangeSetBuilder {
-
- public static UnitOfWorkChangeSet buildChangeSet(DataObject dataobject,
- DatabaseSession jaxbSession, DatabaseSession jpaSession) {
- return null;
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/.classpath b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/.classpath
deleted file mode 100644
index 3a6773b..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
- <classpathentry kind="var" path="ORACLE_JDBC_LIB"/>
- <classpathentry combineaccessrules="false" kind="src" path="/javax.persistence 1.99"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.asm"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.core"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.oracle"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.jpa"/>
- <classpathentry excluding="**/.svn/**" kind="src" path="src"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/.project b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/.project
deleted file mode 100644
index 000e0bc..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>eclipselink.core.test.dynamic</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/.settings/org.eclipse.jdt.core.prefs b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index f15f917..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,60 +0,0 @@
-#Mon Dec 08 13:12:29 EST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/META-INF/dynamic-comics-map.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/META-INF/dynamic-comics-map.xml
deleted file mode 100644
index f47e2a4..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/META-INF/dynamic-comics-map.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<object-persistence
- version="Eclipse Persistence Services - 1.0.2 (Build 20081024)" 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>comics</name>
- <class-mapping-descriptors>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>model.Issue</class>
- <alias>Issue</alias>
- <primary-key>
- <field table="ISSUE" name="ID" xsi:type="column" />
- </primary-key>
- <events xsi:type="event-policy" />
- <querying xsi:type="query-policy" />
- <attribute-mappings>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>comments</attribute-name>
- <field table="ISSUE" name="COMMENTS" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>condition</attribute-name>
- <field table="ISSUE" name="CONDITION" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>copies</attribute-name>
- <field table="ISSUE" name="COPIES" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>id</attribute-name>
- <field table="ISSUE" name="ID" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>number</attribute-name>
- <field table="ISSUE" name="NUM" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="one-to-one-mapping">
- <attribute-name>title</attribute-name>
- <reference-class>model.Title</reference-class>
- <foreign-key>
- <field-reference>
- <source-field table="ISSUE" name="TTITLE_ID"
- xsi:type="column" />
- <target-field table="TITLE" name="ID" xsi:type="column" />
- </field-reference>
- </foreign-key>
- <foreign-key-fields>
- <field table="ISSUE" name="TTITLE_ID" xsi:type="column" />
- </foreign-key-fields>
- <indirection xsi:type="value-holder-indirection-policy" />
- <selection-query xsi:type="read-object-query" />
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>independent</descriptor-type>
- <instantiation />
- <copying xsi:type="instantiation-copy-policy" />
- <tables>
- <table name="ISSUE" />
- </tables>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>model.Publisher</class>
- <alias>Publisher</alias>
- <primary-key>
- <field table="PUBLISHER" name="ID" xsi:type="column" />
- </primary-key>
- <events xsi:type="event-policy" />
- <querying xsi:type="query-policy" />
- <attribute-mappings>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>id</attribute-name>
- <field table="PUBLISHER" name="ID" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>name</attribute-name>
- <field table="PUBLISHER" name="NAME" xsi:type="column" />
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>independent</descriptor-type>
- <instantiation />
- <copying xsi:type="instantiation-copy-policy" />
- <tables>
- <table name="PUBLISHER" />
- </tables>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>model.Title</class>
- <alias>Title</alias>
- <primary-key>
- <field table="TITLE" name="ID" xsi:type="column" />
- </primary-key>
- <events xsi:type="event-policy" />
- <querying xsi:type="query-policy" />
- <attribute-mappings>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>format</attribute-name>
- <field table="TITLE" name="FORMAT" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>id</attribute-name>
- <field table="TITLE" name="ID" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>name</attribute-name>
- <field table="TITLE" name="NAME" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="one-to-one-mapping">
- <attribute-name>publisher</attribute-name>
- <reference-class>model.Publisher</reference-class>
- <foreign-key>
- <field-reference>
- <source-field table="TITLE" name="PUB_ID" xsi:type="column" />
- <target-field table="PUBLISHER" name="ID" xsi:type="column" />
- </field-reference>
- </foreign-key>
- <foreign-key-fields>
- <field table="TITLE" name="PUB_ID" xsi:type="column" />
- </foreign-key-fields>
- <selection-query xsi:type="read-object-query" />
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>independent</descriptor-type>
- <instantiation />
- <copying xsi:type="instantiation-copy-policy" />
- <tables>
- <table name="TITLE" />
- </tables>
- </class-mapping-descriptor>
- </class-mapping-descriptors>
-</object-persistence>
\ No newline at end of file
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/META-INF/sessions.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/META-INF/sessions.xml
deleted file mode 100644
index aaae311..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/META-INF/sessions.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<sessions version="1.0.2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <session xsi:type="server-session">
- <name>dynamic-comics</name>
- <event-listener-classes/>
- <logging xsi:type="eclipselink-log">
- <log-level>fine</log-level>
- <logging-options>
- <log-exception-stacktrace>false</log-exception-stacktrace>
- <print-thread>false</print-thread>
- <print-session>false</print-session>
- <print-connection>false</print-connection>
- <print-date>false</print-date>
- </logging-options>
- </logging>
- <session-customizer-class>org.eclipse.persistence.dynamic.DynamicHelper$SessionCustomizer</session-customizer-class>
- <primary-project xsi:type="xml">META-INF/dynamic-comics-map.xml</primary-project>
- <login xsi:type="database-login">
- <platform-class>org.eclipse.persistence.platform.database.OraclePlatform</platform-class>
- <user-name>scott</user-name>
- <password>tiger</password>
- <sequencing>
- <default-sequence xsi:type="table-sequence">
- <name>Default</name>
- </default-sequence>
- </sequencing>
- <driver-class>oracle.jdbc.OracleDriver</driver-class>
- <connection-url>jdbc:oracle:thin:@localhost:1521:ORCL</connection-url>
- <batch-writing>true</batch-writing>
- <struct-converters/>
- </login>
- <connection-pools>
- <read-connection-pool>
- <name>ReadConnectionPool</name>
- <min-connections>1</min-connections>
- <exclusive>false</exclusive>
- </read-connection-pool>
- <write-connection-pool>
- <name>default</name>
- <min-connections>1</min-connections>
- </write-connection-pool>
- </connection-pools>
- <connection-policy/>
- </session>
-</sessions>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/models/dynamic/employee/EmployeeDynamicMappings.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/models/dynamic/employee/EmployeeDynamicMappings.java
deleted file mode 100644
index cb302ed..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/models/dynamic/employee/EmployeeDynamicMappings.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.models.dynamic.employee;
-
-import java.sql.Date;
-import java.util.Calendar;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.internal.dynamic.DynamicTypeImpl;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-import org.eclipse.persistence.mappings.OneToOneMapping;
-import org.eclipse.persistence.sessions.DatabaseSession;
-
-/**
- * Factory for the creation of the dynamic {@link DynamicTypeImpl}'s required
- * for the employee example.
- *
- * @author dclarke
- * @since EclipseLink - Dynamic Incubator (1.1.0-branch)
- */
-public class EmployeeDynamicMappings {
-
- public static void createTypes(DatabaseSession session, String packageName, boolean createMissingTables) {
- String packagePrefix = packageName.endsWith(".") ? packageName : packageName + ".";
-
- DynamicHelper helper = new DynamicHelper(session);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> employeeClass = dcl.createDynamicClass(packagePrefix + "Employee");
- Class<?> addressClass = dcl.createDynamicClass(packagePrefix + "Address");
- Class<?> phoneClass = dcl.createDynamicClass(packagePrefix + "PhoneNumber");
- Class<?> periodClass = dcl.createDynamicClass(packagePrefix + "EmploymentPeriod");
- Class<?> projectClass = dcl.createDynamicClass(packagePrefix + "Project");
- Class<?> smallProjectClass = dcl.createDynamicClass(packagePrefix + "SmallProject", projectClass);
- Class<?> largeProjectClass = dcl.createDynamicClass(packagePrefix + "LargeProject", projectClass);
-
- DynamicTypeBuilder employee = new DynamicTypeBuilder(employeeClass, null, "D_EMPLOYEE", "D_SALARY");
- DynamicTypeBuilder address = new DynamicTypeBuilder(addressClass, null, "D_ADDRESS");
- DynamicTypeBuilder phone = new DynamicTypeBuilder(phoneClass, null, "D_PHONE");
- DynamicTypeBuilder period = new DynamicTypeBuilder(periodClass, null);
- DynamicTypeBuilder project = new DynamicTypeBuilder(projectClass, null, "D_PROJECT");
- DynamicTypeBuilder smallProject = new DynamicTypeBuilder(smallProjectClass, project.getType(), "D_PROJECT");
- DynamicTypeBuilder largeProject = new DynamicTypeBuilder(largeProjectClass, project.getType(), "D_LPROJECT");
-
- configureAddress(address);
- configureEmployee(employee, address, phone, period, project);
- configurePhone(phone, employee);
- configurePeriod(period);
- configureProject(project, smallProject, largeProject, employee);
- configureSmallProject(smallProject, project);
- configureLargeProject(largeProject, project);
-
- employee.addManyToManyMapping("projects", project.getType(), "D_PROJ_EMP");
-
- helper.addTypes(true, true, employee.getType(), address.getType(), phone.getType(), period.getType(), project.getType(), smallProject.getType(), largeProject.getType());
- }
-
- private static void configurePhone(DynamicTypeBuilder phone, DynamicTypeBuilder employee) {
- phone.setPrimaryKeyFields("PHONE_TYPE", "EMP_ID");
-
- phone.addDirectMapping("type", String.class, "PHONE_TYPE");
- phone.addDirectMapping("ownerId", int.class, "EMP_ID").readOnly();
- phone.addDirectMapping("areaCode", String.class, "AREA_CODE");
- phone.addDirectMapping("number", String.class, "PNUMBER");
-
- phone.addOneToOneMapping("owner", employee.getType(), "EMP_ID");
- }
-
- private static void configureAddress(DynamicTypeBuilder address) {
- address.setPrimaryKeyFields("ADDR_ID");
-
- address.addDirectMapping("id", int.class, "ADDR_ID");
- address.addDirectMapping("street", String.class, "STREET");
- address.addDirectMapping("city", String.class, "CITY");
- address.addDirectMapping("province", String.class, "PROV");
- address.addDirectMapping("postalCode", String.class, "P_CODE");
- address.addDirectMapping("country", String.class, "COUNTRY");
-
- address.configureSequencing("ADDR_SEQ", "ADDR_ID");
- }
-
- private static void configureEmployee(DynamicTypeBuilder employee, DynamicTypeBuilder address, DynamicTypeBuilder phone, DynamicTypeBuilder period, DynamicTypeBuilder project) {
- employee.setPrimaryKeyFields("EMP_ID");
-
- employee.addDirectMapping("id", int.class, "D_EMPLOYEE.EMP_ID");
- employee.addDirectMapping("firstName", String.class, "D_EMPLOYEE.F_NAME");
- employee.addDirectMapping("lastName", String.class, "D_EMPLOYEE.L_NAME");
- employee.addDirectMapping("gender", String.class, "D_EMPLOYEE.GENDER");
- employee.addDirectMapping("salary", int.class, "D_SALARY.SALARY");
-
- OneToOneMapping addressMapping = employee.addOneToOneMapping("address", address.getType(), "ADDR_ID");
- addressMapping.setCascadeAll(true);
- addressMapping.setIsPrivateOwned(true);
-
- employee.addOneToOneMapping("manager", employee.getType(), "MANAGER_ID");
-
- OneToManyMapping phoneMapping = employee.addOneToManyMapping("phoneNumbers", phone.getType(), "EMP_ID");
- phoneMapping.setCascadeAll(true);
- phoneMapping.setIsPrivateOwned(true);
-
- employee.addAggregateObjectMapping("period", period.getType(), true);
- employee.addOneToManyMapping("managedEmployees", employee.getType(), "MANAGER_ID");
-
- employee.configureSequencing("EMP_SEQ", "EMP_ID");
- }
-
- private static void configurePeriod(DynamicTypeBuilder period) {
- period.addDirectMapping("startDate", Date.class, "START_DATE");
- period.addDirectMapping("endDate", Date.class, "END_DATE");
- }
-
- private static void configureProject(DynamicTypeBuilder project, DynamicTypeBuilder smallProject, DynamicTypeBuilder largeProject, DynamicTypeBuilder employee) {
- project.setPrimaryKeyFields("PROJ_ID");
-
- project.addDirectMapping("id", int.class, "PROJ_ID");
- project.addDirectMapping("name", String.class, "NAME");
- project.addDirectMapping("description", String.class, "DESCRIP");
-
- project.addOneToOneMapping("teamLeader", employee.getType(), "EMP_ID");
-
- ClassDescriptor descriptor = project.getType().getDescriptor();
-
- descriptor.getInheritancePolicy().setClassIndicatorFieldName("PROJ_TYPE");
- descriptor.getInheritancePolicy().addClassIndicator(smallProject.getType().getJavaClass(), "S");
- descriptor.getInheritancePolicy().addClassIndicator(largeProject.getType().getJavaClass(), "L");
- descriptor.getInheritancePolicy().addClassIndicator(project.getType().getJavaClass(), "P");
-
- project.configureSequencing("PROJ_SEQ", "PROJ_ID");
- }
-
- private static void configureLargeProject(DynamicTypeBuilder largeProject, DynamicTypeBuilder project) {
- largeProject.setPrimaryKeyFields("PROJ_ID");
-
- ClassDescriptor descriptor = largeProject.getType().getDescriptor();
- descriptor.getInheritancePolicy().setClassIndicatorFieldName("PROJ_TYPE");
- descriptor.getInheritancePolicy().setParentClass(project.getType().getJavaClass());
-
- largeProject.addDirectMapping("budget", double.class, "BUDGET");
- largeProject.addDirectMapping("milestone", Calendar.class, "MILESTONE");
- }
-
- private static void configureSmallProject(DynamicTypeBuilder smallProject, DynamicTypeBuilder project) {
- smallProject.setPrimaryKeyFields("PROJ_ID");
-
- ClassDescriptor descriptor = smallProject.getType().getDescriptor();
- descriptor.getInheritancePolicy().setParentClass(project.getType().getJavaClass());
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/models/dynamic/employee/Queries.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/models/dynamic/employee/Queries.java
deleted file mode 100644
index 2d04ba7..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/models/dynamic/employee/Queries.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.models.dynamic.employee;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.expressions.Expression;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.queries.*;
-import org.eclipse.persistence.sessions.Session;
-
-/**
- * Simple query examples for the XML mapped Employee domain model.
- *
- * @author dclarke
- * @since EclipseLink - Dynamic Incubator (1.1.0-branch)
- */
-public class Queries {
-
- /**
- * Simple example using dynamic JP QL to retrieve all Employee instances
- * sorted by lastName and firstName.
- */
- public List<DynamicEntity> readAllEmployees(DynamicHelper helper, Session session) {
- ReadAllQuery query = helper.newReadAllQuery("Employee");
- query.addAscendingOrdering("id");
- return (List<DynamicEntity>) session.executeQuery(query);
- }
-
- public List<DynamicEntity> readAllEmployeesWithAddress(DynamicHelper helper, Session session) {
- ReadAllQuery query = helper.newReadAllQuery("Employee");
- query.addJoinedAttribute("address");
- query.addAscendingOrdering("lastName");
- query.addAscendingOrdering("firstName");
- return (List<DynamicEntity>) session.executeQuery(query);
- }
-
- public List<DynamicEntity> readAllEmployeesWithAddressAndPhones(DynamicHelper helper, Session session) {
- ReadAllQuery query = helper.newReadAllQuery( "Employee");
- ExpressionBuilder eb = query.getExpressionBuilder();
- query.addJoinedAttribute("address");
- Expression managerExp = eb.get("manager");
- query.addJoinedAttribute(managerExp);
- query.addJoinedAttribute(managerExp.get("address"));
- query.addBatchReadAttribute(managerExp.get("phoneNumbers"));
- query.addAscendingOrdering("lastName");
- query.addAscendingOrdering("firstName");
-
- List<DynamicEntity> emps = (List<DynamicEntity>) session.executeQuery(query);
-
- for (DynamicEntity emp : emps) {
- emp.<DynamicEntity> get("manager").<Collection> get("phoneNumbers").size();
- }
-
- return emps;
- }
-
- public static int minimumEmployeeId(DynamicHelper helper, Session session) {
- ReportQuery query = helper.newReportQuery("Employee", new ExpressionBuilder());
- query.addMinimum("id");
- query.setShouldReturnSingleValue(true);
- return ((Number) session.executeQuery(query)).intValue();
- }
-
- public DynamicEntity minimumEmployee(DynamicHelper helper, Session session) {
- ReportQuery minIdQuery = helper.newReportQuery("Employee", new ExpressionBuilder());
- minIdQuery.addMinimum("id");
-
- ReadObjectQuery query = helper.newReadObjectQuery( "Employee");
- ExpressionBuilder eb = query.getExpressionBuilder();
- query.setSelectionCriteria(eb.get("id").in(minIdQuery));
-
- return (DynamicEntity) session.executeQuery(query);
- }
-
- public List<DynamicEntity> findUsingNativeReadAllQuery(DynamicHelper helper, Session session) {
- ReadAllQuery query = helper.newReadAllQuery("Employee");
- ExpressionBuilder eb = query.getExpressionBuilder();
- query.setSelectionCriteria(eb.get("gender").equal("Male"));
-
- return (List<DynamicEntity>) session.executeQuery(query);
- }
-
- public DynamicEntity minEmployeeWithAddressAndPhones(Session session) {
- Class<?> employeeClass = session.getClassDescriptorForAlias("Employee").getJavaClass();
- Class<?> phoneClass = session.getClassDescriptorForAlias("PhoneNumber").getJavaClass();
-
- ReportQuery minIdQuery = new ReportQuery(phoneClass, new ExpressionBuilder());
- minIdQuery.addMinimum("id");
-
- ReadObjectQuery query = new ReadObjectQuery(employeeClass);
- ExpressionBuilder eb = query.getExpressionBuilder();
-
- query.setSelectionCriteria(eb.get("id").in(minIdQuery));
- query.addJoinedAttribute("address");
-
- return (DynamicEntity) session.executeQuery(query);
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/models/dynamic/employee/Sample.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/models/dynamic/employee/Sample.java
deleted file mode 100644
index ed3461b..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/models/dynamic/employee/Sample.java
+++ /dev/null
@@ -1,716 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.models.dynamic.employee;
-
-import java.sql.Date;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.expressions.Expression;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.queries.DeleteAllQuery;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.UnitOfWork;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink - Dynamic Incubator (1.1.0-branch)
- */
-@SuppressWarnings("deprecation")
-public class Sample {
- private DatabaseSession session;
- public DynamicEntity[] employees;
- public DynamicEntity[] smallProjects;
- public DynamicEntity[] largeProjects;
-
- public Sample(DatabaseSession session) {
- this.session = session;
-
- this.employees = new DynamicEntity[] { basicEmployeeExample1(), basicEmployeeExample2(), basicEmployeeExample3(), basicEmployeeExample4(), basicEmployeeExample5(), basicEmployeeExample6(), basicEmployeeExample7(), basicEmployeeExample8(), basicEmployeeExample9(), basicEmployeeExample10(), basicEmployeeExample11(), basicEmployeeExample12() };
-
- this.smallProjects = new DynamicEntity[] { basicSmallProjectExample1(), basicSmallProjectExample2(), basicSmallProjectExample3(), basicSmallProjectExample4(), basicSmallProjectExample5(), basicSmallProjectExample7(), basicSmallProjectExample8(), basicSmallProjectExample9(), basicSmallProjectExample10() };
-
- this.largeProjects = new DynamicEntity[] { basicLargeProjectExample1(), basicLargeProjectExample2(), basicLargeProjectExample3(), basicLargeProjectExample4(), basicLargeProjectExample5() };
-
- // Setup management hierarchy
- addManagedEmployees(0, new int[] { 2, 3, 4 });
- addManagedEmployees(1, new int[] { 5, 0 });
- addManagedEmployees(2, new int[] {});
- addManagedEmployees(3, new int[] {});
- addManagedEmployees(4, new int[] {});
- addManagedEmployees(5, new int[] {});
- addManagedEmployees(6, new int[] {});
- addManagedEmployees(7, new int[] {});
- addManagedEmployees(8, new int[] {});
- addManagedEmployees(9, new int[] { 7, 8, 10, 11 });
- addManagedEmployees(10, new int[] { 6 });
- addManagedEmployees(11, new int[] { 1 });
-
- // Setup Employee-Project associations
- addProjects(0, new int[] { 0, 1, 2 }, new int[] {});
- addProjects(1, new int[] { 3, 4, 0 }, new int[] {});
- addProjects(2, new int[] { 3 }, new int[] { 3, 4 });
- addProjects(4, new int[] { 3, 1 }, new int[] { 2, 4 });
- addProjects(5, new int[] {}, new int[] { 1 });
- addProjects(6, new int[] {}, new int[] { 1 });
-
- // Setup LargeProject leads
- this.largeProjects[0].set("teamLeader", this.employees[1]);
- this.largeProjects[3].set("teamLeader", this.employees[2]);
- this.largeProjects[4].set("teamLeader", this.employees[2]);
-
- }
-
- private DynamicEntity newInstance(String entityAlias) {
- ClassDescriptor descriptor = this.session.getDescriptorForAlias(entityAlias);
- return (DynamicEntity) descriptor.getInstantiationPolicy().buildNewInstance();
- }
-
- private Class getDynamicClass(String entityAlias) {
- ClassDescriptor descriptor = this.session.getDescriptorForAlias(entityAlias);
- return descriptor.getJavaClass();
- }
-
- private DynamicEntity addPhoneNumber(DynamicEntity employee, String type, String areaCode, String number) {
- DynamicEntity phone = newInstance("PhoneNumber");
- phone.set("type", type);
- phone.set("areaCode", areaCode);
- phone.set("number", number);
- phone.set("owner", employee);
- employee.<Collection> get("phoneNumbers").add(phone);
- return phone;
- }
-
- private void setPeriod(DynamicEntity employee, Date startDate, Date endDate) {
- DynamicEntity period = newInstance("EmploymentPeriod");
- period.set("startDate", startDate);
- period.set("endDate", endDate);
- employee.set("period", period);
- }
-
- public DynamicEntity basicEmployeeExample1() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Bob");
- employee.set("lastName", "Smith");
- employee.set("gender", "Male");
- employee.set("salary", 35000);
-
- setPeriod(employee, new Date(1993, 0, 1), new Date(1996, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Toronto");
- address.set("postalCode", "L5J2B5");
- address.set("province", "ONT");
- address.set("street", "1450 Acme Cr., Suite 4");
- address.set("country", "Canada");
- employee.set("address", address);
-
- // employee.add("responsibilities", "Water the office plants.");
- // employee.add("responsibilities", "Maintain the kitchen facilities.");
- addPhoneNumber(employee, "Work", "613", "5558812");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample10() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Jill");
- employee.set("lastName", "May");
- employee.set("gender", "Female");
-
- setPeriod(employee, new Date(1991, 10, 111), null);
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Calgary");
- address.set("postalCode", "J5J2B5");
- address.set("province", "AB");
- address.set("street", "1111 Mooseland Rd.");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.set("salary", 56232);
- addPhoneNumber(employee, "Work", "613", "5558812");
- addPhoneNumber(employee, "Work Fax", "613", "5555943");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample11() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Sarah-Lou");
- employee.set("lastName", "Smitty");
- employee.set("gender", "Female");
-
- setPeriod(employee, new Date(1993, 0, 1), new Date(1996, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Arnprior");
- address.set("postalCode", "W1A2B5");
- address.set("province", "ONT");
- address.set("street", "1 Hawthorne Drive");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.set("salary", 75000);
- addPhoneNumber(employee, "Work Fax", "613", "5555943");
- addPhoneNumber(employee, "Home", "613", "5551234");
- addPhoneNumber(employee, "Cellular", "416", "5551111");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample12() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Jim-Bob");
- employee.set("lastName", "Jefferson");
- employee.set("gender", "Male");
-
- setPeriod(employee, new Date(1995, 0, 12), new Date(2001, 11, 31));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Yellowknife");
- address.set("postalCode", "Y5J2N5");
- address.set("province", "YK");
- address.set("street", "1112 Gold Rush Rd.");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.set("salary", 50000);
- addPhoneNumber(employee, "Home", "613", "5551234");
- addPhoneNumber(employee, "Cellular", "416", "5551111");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample2() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "John");
- employee.set("lastName", "Way");
- employee.set("gender", "Male");
- employee.set("salary", 53000);
-
- setPeriod(employee, new Date(1991, 10, 11), null);
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Ottawa");
- address.set("postalCode", "K5J2B5");
- address.set("province", "ONT");
- address.set("street", "12 Merivale Rd., Suite 5");
- address.set("country", "Canada");
- employee.set("address", address);
-
- // employee.add("responsibilities",
- // "Hire people when more people are required.");
- // employee.add("responsibilities",
- // "Lay off employees when less people are required.");
- addPhoneNumber(employee, "Work", "613", "5558812");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample3() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Charles");
- employee.set("lastName", "Chanley");
- employee.set("gender", "Male");
- employee.set("salary", 43000);
-
- setPeriod(employee, new Date(1995, 0, 1), new Date(2001, 11, 31));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Montreal");
- address.set("postalCode", "Q2S5Z5");
- address.set("province", "QUE");
- address.set("street", "1 Canadien Place");
- address.set("country", "Canada");
- employee.set("address", address);
-
- // employee.add("responsibilities",
- // "Perform code reviews as required.");
- addPhoneNumber(employee, "Pager", "976", "5556666");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample4() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Emanual");
- employee.set("lastName", "Smith");
- employee.set("gender", "Male");
- employee.set("salary", 49631);
-
- setPeriod(employee, new Date(2001, 11, 31), new Date(1995, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Vancouver");
- address.set("postalCode", "N5J2N5");
- address.set("province", "BC");
- address.set("street", "20 Mountain Blvd., Floor 53, Suite 6");
- address.set("country", "Canada");
- employee.set("address", address);
-
- // employee.add("responsibilities",
- // "Have to fix the Database problem.");
- addPhoneNumber(employee, "Work Fax", "613", "5555943");
- addPhoneNumber(employee, "Cellular", "416", "5551111");
- addPhoneNumber(employee, "Pager", "976", "5556666");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample5() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Sarah");
- employee.set("lastName", "Way");
- employee.set("gender", "Female");
- employee.set("salary", 87000);
-
- setPeriod(employee, new Date(2001, 6, 31), new Date(1995, 4, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Prince Rupert");
- address.set("postalCode", "K3K5D5");
- address.set("province", "BC");
- address.set("street", "3254 Parkway Place");
- address.set("country", "Canada");
- employee.set("address", address);
-
- // employee.add("responsibilities", "Write code documentation.");
- addPhoneNumber(employee, "Work", "613", "5558812");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
- addPhoneNumber(employee, "Home", "613", "5551234");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample6() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Marcus");
- employee.set("lastName", "Saunders");
- employee.set("gender", "Male");
- employee.set("salary", 54300);
-
- setPeriod(employee, new Date(2001, 11, 31), new Date(1995, 0, 12));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Perth");
- address.set("postalCode", "Y3Q2N9");
- address.set("province", "ONT");
- address.set("street", "234 Caledonia Lane");
- address.set("country", "Canada");
- employee.set("address", address);
-
- // employee.add("responsibilities", "Write user specifications.");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
- addPhoneNumber(employee, "Work", "613", "5558812");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample7() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Nancy");
- employee.set("lastName", "White");
- employee.set("gender", "Female");
- employee.set("salary", 31000);
-
- setPeriod(employee, new Date(1996, 0, 1), new Date(1993, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Metcalfe");
- address.set("postalCode", "Y4F7V6");
- address.set("province", "ONT");
- address.set("street", "2 Anderson Rd.");
- address.set("country", "Canada");
- employee.set("address", address);
-
- addPhoneNumber(employee, "Home", "613", "5551234");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample8() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Fred");
- employee.set("lastName", "Jones");
- employee.set("gender", "Male");
- employee.set("salary", 500000);
-
- setPeriod(employee, new Date(2001, 11, 31), new Date(1995, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Victoria");
- address.set("postalCode", "Z5J2N5");
- address.set("province", "BC");
- address.set("street", "382 Hyde Park Blvd.");
- address.set("country", "Canada");
- employee.set("address", address);
-
- addPhoneNumber(employee, "Cellular", "416", "5551111");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample9() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Betty");
- employee.set("lastName", "Jones");
- employee.set("gender", "Female");
- employee.set("salary", 500001);
-
- setPeriod(employee, new Date(2001, 11, 31), new Date(1995, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Smith Falls");
- address.set("postalCode", "C6C6C6");
- address.set("province", "ONT");
- address.set("street", "89 Chocolate Drive");
- address.set("country", "Canada");
- employee.set("address", address);
-
- addPhoneNumber(employee, "Work", "613", "5558812");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- private void setCalendar(DynamicEntity entity, String name, int year, int month, int day, int hour, int minute, int seconds) {
- Calendar cal = entity.<Calendar> get(name);
-
- if (cal == null) {
- cal = Calendar.getInstance();
- entity.set(name, cal);
- }
- cal.set(year, month, day, hour, minute, seconds);
- }
-
- public DynamicEntity basicLargeProjectExample1() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "Sales Reporting");
- largeProject.set("description", "A reporting application to report on the corporations database through TopLink.");
- largeProject.set("budget", (double) 5000);
- setCalendar(largeProject, "milestone", 1991, 10, 11, 12, 0, 0);
-
- return largeProject;
- }
-
- public DynamicEntity basicLargeProjectExample2() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "Light Reporter");
- largeProject.set("description", "A lightweight application to report on the corporations database through TopLink.");
- largeProject.set("budget", 100.98);
- setCalendar(largeProject, "milestone", 1999, 11, 25, 11, 40, 44);
-
- return largeProject;
- }
-
- public DynamicEntity basicLargeProjectExample3() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "TOPEmployee Management");
- largeProject.set("description", "A management application to report on the corporations database through TopLink.");
- largeProject.set("budget", 4000.98);
- setCalendar(largeProject, "milestone", 1997, 10, 12, 1, 0, 0);
-
- return largeProject;
- }
-
- public DynamicEntity basicLargeProjectExample4() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "Enterprise System");
- largeProject.set("description", "A enterprise wide application to report on the corporations database through TopLink.");
- largeProject.set("budget", 40.98);
- setCalendar(largeProject, "milestone", 1996, 8, 6, 6, 40, 44);
-
- return largeProject;
- }
-
- public DynamicEntity basicLargeProjectExample5() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "Problem Reporting System");
- largeProject.set("description", "A PRS application to report on the corporations database through TopLink.");
- largeProject.set("budget", 101.98);
- setCalendar(largeProject, "milestone", 1997, 9, 6, 1, 40, 44);
-
- return largeProject;
- }
-
- public DynamicEntity basicSmallProjectExample1() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Enterprise");
- smallProject.set("description", "A enterprise wide application to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample10() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Staff Query Tool");
- smallProject.set("description", "A tool to help staff query various things.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample2() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Sales Reporter");
- smallProject.set("description", "A reporting application using JDK to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample3() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "TOP-Employee Manager");
- smallProject.set("description", "A management application to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample4() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Problem Reporter");
- smallProject.set("description", "A PRS application to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample5() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Feather Reporter");
- smallProject.set("description", "An extremely lightweight application to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample6() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Makework");
- smallProject.set("description", "A makework project.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample7() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Marketing Query Tool");
- smallProject.set("description", "A tool to help marketing query various things.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample8() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Shipping Query Tool");
- smallProject.set("description", "A tool to help shipping query various things.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample9() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Accounting Query Tool");
- smallProject.set("description", "A tool to help accounting query various things.");
- return smallProject;
- }
-
- private void addManagedEmployees(int managerIndex, int[] employeeIndeces) {
- DynamicEntity manager = this.employees[managerIndex];
-
- if (manager.<Collection> get("managedEmployees").isEmpty()) {
- for (int index = 0; index < employeeIndeces.length; index++) {
- manager.<Collection> get("managedEmployees").add(this.employees[employeeIndeces[index]]);
- }
- }
- }
-
- private void addProjects(int empIndex, int[] smallProjIndeces, int[] largeProjIndeces) {
- DynamicEntity employee = this.employees[empIndex];
-
- for (int index = 0; index < smallProjIndeces.length; index++) {
- employee.<Collection> get("projects").add(this.smallProjects[smallProjIndeces[index]]);
- }
-
- for (int index = 0; index < largeProjIndeces.length; index++) {
- employee.<Collection> get("projects").add(this.largeProjects[largeProjIndeces[index]]);
- }
- }
-
- /**
- * Register all of the population in the provided EntityManager to be
- * persisted This method should only be called from within a test case. It
- * asserts that the provided EntityManager is in a transaction and that the
- * database tables are empty.
- */
- public void persistAll(Session session) {
- UnitOfWork uow = session.acquireUnitOfWork();
-
- // Verify that the database tables are empty
- assertCount(session, "Employee", 0);
- assertCount(session, "Address", 0);
- assertCount(session, "PhoneNumber", 0);
- assertCount(session, "Project", 0);
-
- for (int index = 0; index < this.employees.length; index++) {
- uow.registerNewObject(this.employees[index]);
- }
- for (int index = 0; index < this.smallProjects.length; index++) {
- uow.registerNewObject(this.smallProjects[index]);
- }
- for (int index = 0; index < this.largeProjects.length; index++) {
- uow.registerNewObject(this.largeProjects[index]);
- }
-
- uow.commit();
- verifyCounts(session);
- }
-
- public void verifyCounts(Session session) {
- assertCount(session, "Employee", this.employees.length);
- assertCount(session, "Address", this.employees.length);
- assertCount(session, "Project", this.smallProjects.length + this.largeProjects.length);
- }
-
- /**
- * Verify that the provided entity type has no rows in the database using a
- * native ReportQuery.
- *
- * @param entityClass
- * @param count
- */
- public void assertCount(Session session, String entityAlias, int count) {
- Class entityClass = getDynamicClass(entityAlias);
- ReportQuery query = new ReportQuery(entityClass, new ExpressionBuilder());
- query.addCount();
- query.setShouldReturnSingleValue(true);
-
- int dbCount = ((Number) session.executeQuery(query)).intValue();
- Assert.assertEquals("Incorrect quantity found of " + entityClass, count, dbCount);
- }
-
- /**
- * Verify that the provided list of Employee instances matches the sample
- * population.
- *
- * @param employees
- */
- public void assertSame(List<DynamicEntity> dbEmps) {
- Assert.assertEquals("Incorrect quantity of employees", this.employees.length, dbEmps.size());
- Collections.sort(dbEmps, new DynamicEntityComparator());
-
- List<DynamicEntity> sampleEmps = new ArrayList<DynamicEntity>();
- for (int index = 0; index < this.employees.length; index++) {
- sampleEmps.add(this.employees[index]);
- }
- Collections.sort(sampleEmps, new DynamicEntityComparator());
-
- for (int index = 0; index < this.employees.length; index++) {
- DynamicEntity emp = sampleEmps.get(index);
- DynamicEntity dbEmp = dbEmps.get(index);
-
- Assert.assertEquals("First name does not match on employees[" + index + "]", emp.<String> get("firstName"), dbEmp.<String> get("firstName"));
- Assert.assertEquals("Last name does not match on employees[" + index + "]", emp.<String> get("lastName"), dbEmp.<String> get("lastName"));
- Assert.assertEquals("Salary does not match on employees[" + index + "]", emp.<Integer> get("salary"), dbEmp.<Integer> get("salary"));
- }
- }
-
- /**
- * Simple comparator used to order the employees for use within assertSame
- */
- class DynamicEntityComparator implements Comparator<DynamicEntity> {
-
- public int compare(DynamicEntity emp1, DynamicEntity emp2) {
- return emp1.<Integer> get("id") - emp2.<Integer> get("id");
- }
-
- }
-
- /**
- * Extract the id's from the sample Employee instances.
- *
- * @param em
- * @return
- */
- public int[] getEmployeeIds(Session session) {
- int[] ids = new int[this.employees.length];
-
- for (int index = 0; index < this.employees.length; index++) {
- ids[index] = this.employees[index].<Integer> get("id");
- }
-
- return ids;
- }
-
- /**
- * Reset the database so that only the sample population exists.
- *
- * @param em
- */
- public void resetDatabase(DatabaseSession session) {
- DeleteAllQuery deleteEmpsQuery = new DeleteAllQuery(getDynamicClass("Employee"));
- ExpressionBuilder eb = deleteEmpsQuery.getExpressionBuilder();
- deleteEmpsQuery.setSelectionCriteria(eb.get("id").notIn(getEmployeeIds(session)));
- deleteEmpsQuery.setFlushOnExecute(true);
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.executeQuery(deleteEmpsQuery);
- uow.commit();
- }
-
- public void resetSalary(UnitOfWork uow) {
- DynamicHelper helper = new DynamicHelper(this.session);
-
- for (int index = 0; index < this.employees.length; index++) {
- DynamicEntity emp = this.employees[index];
-
- ReadObjectQuery query = helper.newReadObjectQuery("Employee");
- ExpressionBuilder eb = query.getExpressionBuilder();
- Expression fnExp = eb.get("firstName").equal(emp.get("firstName"));
- Expression lnExp = eb.get("lastName").equal(emp.get("lastName"));
- query.setSelectionCriteria(fnExp.and(lnExp));
-
- DynamicEntity dbEmp = (DynamicEntity) session.executeQuery(query);
- dbEmp.set("salary", this.employees[index].<Integer> get("salary"));
- }
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/models/dynamic/employee/Transactions.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/models/dynamic/employee/Transactions.java
deleted file mode 100644
index 4b20f2b..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/models/dynamic/employee/Transactions.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.models.dynamic.employee;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.queries.ObjectLevelReadQuery;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.UnitOfWork;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink - Dynamic Incubator (1.1.0-branch)
- */
-public class Transactions {
-
- /**
- * New entities with new related related entities can be persisted using
- * <code>EntityManager.persist(newEntity)</code>. The cascade setting on the
- * mappings determine how the related entities are handled. In this case
- * Employee has its relationship to Address and PhoneNumber configured with
- * cascade-all so the associated new entities will also be persisted.
- */
- public DynamicEntity createUsingPersist(DynamicHelper helper, Session session) {
- DynamicEntity emp = helper.newDynamicEntity("Employee");
- emp.set("firstName", "Sample");
- emp.set("lastName", "Employee");
- emp.set("gender", "Male");
- emp.set("salary", 123456);
-
- DynamicEntity address = helper.newDynamicEntity("Address");
- emp.set("address", address);
-
- DynamicEntity phone = helper.newDynamicEntity("PhoneNumber");
- phone.set("type", "Mobile");
- phone.set("areaCode", "613");
- phone.set("number", "555-1212");
- phone.set("owner", emp);
- emp.<Collection<DynamicEntity>> get("phoneNumbers").add(phone);
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(emp);
- uow.commit();
-
- return emp;
- }
-
- /**
- *
- */
- public DynamicEntity createUsingMerge(DynamicHelper helper, Session session) {
-
- DynamicEntity emp = helper.newDynamicEntity("Employee");
- emp.set("firstName", "Sample");
- emp.set("lastName", "Employee");
- emp.set("gender", "Male");
- emp.set("salary", 123456);
-
- DynamicEntity address = helper.newDynamicEntity("Address");
- emp.set("address", address);
-
- DynamicEntity phone = helper.newDynamicEntity("PhoneNumber");
- phone.set("type", "Mobile");
- phone.set("areaCode", "613");
- phone.set("number", "555-1212");
- phone.set("owner", emp);
- emp.<Collection<DynamicEntity>> get("phoneNumbers").add(phone);
-
- UnitOfWork uow = session.acquireUnitOfWork();
- // When merging the managed instance is returned from the call.
- // Further usage within the transaction must be done with this managed
- // entity.
- emp = (DynamicEntity) uow.registerNewObject(emp);
- uow.commit();
-
- return emp;
- }
-
- /**
- *
- * @param em
- * @throws Exception
- */
- public void pessimisticLocking(DynamicHelper helper, Session session) throws Exception {
-
- // Find the Employee with the minimum ID
- int minId = Queries.minimumEmployeeId(helper, session);
-
- UnitOfWork uow = session.acquireUnitOfWork();
-
- // Lock Employee
- ReadObjectQuery query = helper.newReadObjectQuery("Employee");
- query.setSelectionCriteria(query.getExpressionBuilder().get("id").equal(minId));
- query.setLockMode(ObjectLevelReadQuery.LOCK);
-
- DynamicEntity emp = (DynamicEntity) uow.executeQuery(query);
-
- emp.set("salary", emp.<Integer> get("salary") - 1);
-
- uow.commit();
- }
-
- /**
- * This example illustrates the use of a query returning an entity and data
- * from a related entity within a transaction. The returned entities are
- * managed and thus any changes are reflected in the database upon flush.
- *
- * @param em
- * @throws Exception
- */
- public void updateEmployeeWithCity(DynamicHelper helper, Session session) throws Exception {
- UnitOfWork uow = session.acquireUnitOfWork();
-
- List<DynamicEntity> emps = new Queries().readAllEmployeesWithAddress(helper, uow);
- DynamicEntity emp = emps.get(0);
- emp.set("salary", emp.<Integer> get("salary") + 1);
-
- uow.writeChanges();
-
- uow.release();
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/AllTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/AllTests.java
deleted file mode 100644
index 5fd7460..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/AllTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { DynamicClassLoaderTests.class,
- DynamicHelperTests.class,
- EntityTypeFromDescriptor.class,
- EntityTypeFromScratch.class,
- org.eclipse.persistence.testing.tests.dynamic.simple.AllTests.class,
- org.eclipse.persistence.testing.tests.dynamic.orm.comics.AllTests.class,
- org.eclipse.persistence.testing.tests.dynamic.orm.projectxml.AllTests.class,
- org.eclipse.persistence.testing.tests.dynamic.employee.AllTests.class})
-public class AllTests {
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/DynamicClassLoaderTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/DynamicClassLoaderTests.java
deleted file mode 100644
index 1af33fe..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/DynamicClassLoaderTests.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic;
-
-import static junit.framework.Assert.*;
-
-import java.io.ObjectStreamException;
-import java.io.Serializable;
-import java.lang.reflect.Constructor;
-
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicClassWriter;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.exceptions.DynamicException;
-import org.eclipse.persistence.internal.dynamic.*;
-import org.eclipse.persistence.internal.helper.ConversionManager;
-import org.eclipse.persistence.internal.helper.SerializationHelper;
-import org.junit.Test;
-
-public class DynamicClassLoaderTests {
-
- @Test
- public void constructor() throws Exception {
- DynamicClassLoader dcl = new DynamicClassLoader(null);
-
- assertNull(dcl.getParent());
-
- dcl.createDynamicClass("java.lang.String");
-
- try {
- dcl.createDynamicClass("test.MyClass");
- } catch (NoClassDefFoundError e) {
- return;
- }
- fail("Expected NoClassDefFoundError not thrown");
- }
-
- @Test
- public void loadClass_DynamicEntityImpl() throws Exception {
- DynamicClassLoader dcl = new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
-
- dcl.addClass("test.MyClass");
- Class dynamicClass = dcl.loadClass("test.MyClass");
-
- assertNotNull(dynamicClass);
- assertEquals("test.MyClass", dynamicClass.getName());
- assertSame(DynamicEntityImpl.class, dynamicClass.getSuperclass());
- assertSame(dynamicClass, dcl.loadClass("test.MyClass"));
-
- ConversionManager.setDefaultLoader(dcl);
- ConversionManager.getDefaultManager().setLoader(dcl);
-
- assertSame(dynamicClass, ConversionManager.getDefaultManager().convertClassNameToClass("test.MyClass"));
- assertSame(dynamicClass, ConversionManager.getDefaultManager().convertObject("test.MyClass", Class.class));
- assertSame(dynamicClass, ConversionManager.getDefaultLoader().loadClass("test.MyClass"));
- assertSame(dynamicClass, ConversionManager.loadClass("test.MyClass"));
-
- InstantiationException instEx = null;
- try {
- dynamicClass.newInstance();
- } catch (InstantiationException ie) {
- instEx = ie;
- }
- assertNotNull("InstantiationException not thrown as expected for default constructor", instEx);
-
- Constructor[] constructors = dynamicClass.getConstructors();
- assertEquals(1, constructors.length);
- assertEquals(1, constructors[0].getParameterTypes().length);
- assertEquals(DynamicTypeImpl.class, constructors[0].getParameterTypes()[0]);
-
- Constructor<DynamicEntity> constructor = dynamicClass.getDeclaredConstructor(new Class[] { DynamicTypeImpl.class });
- assertNotNull(constructor);
- constructor = dynamicClass.getConstructor(new Class[] { DynamicTypeImpl.class });
- assertNotNull(constructor);
- }
-
- @Test
- public void createDynamicClass_DynamicEntityImpl() throws Exception {
- DynamicClassLoader dcl = new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
-
- Class dynamicClass = dcl.createDynamicClass("test.MyClass");
-
- assertNotNull(dynamicClass);
- assertEquals("test.MyClass", dynamicClass.getName());
- assertSame(DynamicEntityImpl.class, dynamicClass.getSuperclass());
- assertSame(dynamicClass, dcl.loadClass("test.MyClass"));
-
- ConversionManager.setDefaultLoader(dcl);
- ConversionManager.getDefaultManager().setLoader(dcl);
-
- assertSame(dynamicClass, ConversionManager.getDefaultManager().convertClassNameToClass("test.MyClass"));
- assertSame(dynamicClass, ConversionManager.getDefaultManager().convertObject("test.MyClass", Class.class));
- assertSame(dynamicClass, ConversionManager.getDefaultLoader().loadClass("test.MyClass"));
- assertSame(dynamicClass, ConversionManager.loadClass("test.MyClass"));
-
- InstantiationException instEx = null;
- try {
- dynamicClass.newInstance();
- } catch (InstantiationException ie) {
- instEx = ie;
- }
- assertNotNull("InstantiationException not thrown as expected for default constructor", instEx);
-
- Constructor[] constructors = dynamicClass.getConstructors();
- assertEquals(1, constructors.length);
- assertEquals(1, constructors[0].getParameterTypes().length);
- assertEquals(DynamicTypeImpl.class, constructors[0].getParameterTypes()[0]);
-
- Constructor<DynamicEntity> constructor = dynamicClass.getDeclaredConstructor(new Class[] { DynamicTypeImpl.class });
- assertNotNull(constructor);
- constructor = dynamicClass.getConstructor(new Class[] { DynamicTypeImpl.class });
- assertNotNull(constructor);
- }
-
- @Test
- public void createDynamicClass_Twice() throws Exception {
- DynamicClassLoader dcl = new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
-
- assertNull(dcl.getClassWriter("test.MyClass"));
- Class dynamicClass = dcl.createDynamicClass("test.MyClass");
-
- assertNotNull(dynamicClass);
- assertEquals("test.MyClass", dynamicClass.getName());
-
- DynamicClassWriter writer = dcl.getClassWriter("test.MyClass");
- assertNotNull(writer);
-
- Class dynamicClass2 = dcl.createDynamicClass("test.MyClass");
-
- assertSame(dynamicClass, dynamicClass2);
-
- DynamicClassWriter writer2 = dcl.getClassWriter("test.MyClass");
- assertNotNull(writer);
- assertSame(writer, writer2);
- }
-
- @Test
- public void defaultWriter() throws Exception {
- DynamicClassLoader dcl = new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
-
- assertEquals(DynamicClassWriter.class, dcl.getDefaultWriter().getClass());
- }
-
- @Test
- public void loadClass_DefaultConstructor() throws Exception {
- DynamicClassLoader dcl = new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
-
- dcl.addClass("test.MyClass", DefaultConstructor.class);
- Class dynamicClass = dcl.loadClass("test.MyClass");
-
- assertNotNull(dynamicClass);
- assertSame(dynamicClass, dcl.loadClass("test.MyClass"));
- assertSame(DefaultConstructor.class, dynamicClass.getSuperclass());
-
- DefaultConstructor entity = (DefaultConstructor) dynamicClass.newInstance();
-
- assertNotNull(entity);
- }
-
- @Test
- public void loadClass_StringConstructor() throws Exception {
- DynamicClassLoader dcl = new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
-
- dcl.addClass("test.MyClass", StringConstructor.class);
- Class dynamicClass = dcl.loadClass("test.MyClass");
-
- assertNotNull(dynamicClass);
- assertSame(dynamicClass, dcl.loadClass("test.MyClass"));
- assertSame(StringConstructor.class, dynamicClass.getSuperclass());
-
- InstantiationException instEx = null;
- try {
- dynamicClass.newInstance();
- } catch (InstantiationException ie) {
- instEx = ie;
- }
- assertNotNull("InstantiationException not thrown as expected for default constructor", instEx);
-
- Constructor[] constructors = dynamicClass.getConstructors();
- assertEquals(1, constructors.length);
- assertEquals(1, constructors[0].getParameterTypes().length);
- assertEquals(String.class, constructors[0].getParameterTypes()[0]);
- }
-
- @Test
- public void loadClass_WriteReplace() throws Exception {
- DynamicClassLoader dcl = new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
-
- dcl.addClass("test.MyClass", WriteReplace.class);
- Class dynamicClass = dcl.loadClass("test.MyClass");
-
- assertNotNull(dynamicClass);
- assertEquals("test.MyClass", dynamicClass.getName());
- assertSame(WriteReplace.class, dynamicClass.getSuperclass());
- assertSame(dynamicClass, dcl.loadClass("test.MyClass"));
-
- WriteReplace entity = (WriteReplace) dynamicClass.newInstance();
-
- assertNotNull(entity);
-
- byte[] entityBytes = SerializationHelper.serialize(entity);
- byte[] stringBytes = SerializationHelper.serialize(entity.getClass().getName());
-
- assertEquals(stringBytes.length, entityBytes.length);
- for (int index = 0; index < stringBytes.length; index++) {
- assertEquals(stringBytes[index], entityBytes[index]);
- }
-
- Object deserializedValue = SerializationHelper.deserialize(entityBytes);
-
- assertNotNull(deserializedValue);
- assertEquals(String.class, deserializedValue.getClass());
- assertEquals(dynamicClass.getName(), deserializedValue);
- }
-
- @Test
- public void createDynamicClass_WriteReplace() throws Exception {
- DynamicClassLoader dcl = new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
-
- Class dynamicClass = dcl.createDynamicClass("test.MyClass", WriteReplace.class);
-
- assertNotNull(dynamicClass);
- assertEquals("test.MyClass", dynamicClass.getName());
- assertSame(WriteReplace.class, dynamicClass.getSuperclass());
- assertSame(dynamicClass, dcl.loadClass("test.MyClass"));
-
- WriteReplace entity = (WriteReplace) dynamicClass.newInstance();
-
- assertNotNull(entity);
-
- byte[] entityBytes = SerializationHelper.serialize(entity);
- byte[] stringBytes = SerializationHelper.serialize(entity.getClass().getName());
-
- assertEquals(stringBytes.length, entityBytes.length);
- for (int index = 0; index < stringBytes.length; index++) {
- assertEquals(stringBytes[index], entityBytes[index]);
- }
-
- Object deserializedValue = SerializationHelper.deserialize(entityBytes);
-
- assertNotNull(deserializedValue);
- assertEquals(String.class, deserializedValue.getClass());
- assertEquals(dynamicClass.getName(), deserializedValue);
- }
-
- @Test
- public void duplicateAddClassWithSameParent() throws Exception {
- DynamicClassLoader dcl = new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
-
- dcl.addClass("test.MyClass", DefaultConstructor.class);
- Class dynamicClass = dcl.loadClass("test.MyClass");
-
- assertNotNull(dynamicClass);
- assertSame(dynamicClass, dcl.loadClass("test.MyClass"));
- assertSame(DefaultConstructor.class, dynamicClass.getSuperclass());
- DynamicClassWriter firstWriter = dcl.getClassWriter("test.MyClass");
-
- DefaultConstructor entity = (DefaultConstructor) dynamicClass.newInstance();
-
- assertNotNull(entity);
- assertNotNull("DCL does not contain expected writer", dcl.getClassWriter("test.MyClass"));
-
- dcl.addClass("test.MyClass", DefaultConstructor.class);
- DynamicClassWriter secondWriter = dcl.getClassWriter("test.MyClass");
-
- assertSame(firstWriter, secondWriter);
- }
-
- /**
- * Verify that a second request to create a class with the same name and
- * different parents fails.
- */
- @Test
- public void duplicateAddClassWithDifferentParent() throws Exception {
- DynamicClassLoader dcl = new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
-
- dcl.addClass("test.MyClass", DefaultConstructor.class);
- Class dynamicClass = dcl.loadClass("test.MyClass");
-
- assertNotNull(dynamicClass);
- assertSame(dynamicClass, dcl.loadClass("test.MyClass"));
- assertSame(DefaultConstructor.class, dynamicClass.getSuperclass());
-
- DefaultConstructor entity = (DefaultConstructor) dynamicClass.newInstance();
-
- assertNotNull(entity);
- assertNotNull("DCL does not contain expected writer", dcl.getClassWriter("test.MyClass"));
-
- try {
- dcl.addClass("test.MyClass", WriteReplace.class);
- } catch (DynamicException de) {
- String errorMessage = de.getMessage();
- int errorCode = de.getErrorCode();
-
- assertTrue("Incorrect dynamic exception", errorMessage.startsWith("\r\nException Description: Duplicate addClass request with incompatible writer:"));
- assertEquals("Unexpected error code", 0, errorCode);
- return;
- }
- fail("No DynamicException thrown for duplicate addClass with different parent");
- }
-
- public static class DefaultConstructor {
- }
-
- public static class StringConstructor {
- public StringConstructor(String arg) {
-
- }
- }
-
- public static class WriteReplace implements Serializable {
- protected Object writeReplace() throws ObjectStreamException {
- return getClass().getName();
- }
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/DynamicHelperTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/DynamicHelperTests.java
deleted file mode 100644
index 7e691e6..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/DynamicHelperTests.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic;
-
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
-
-import java.util.List;
-
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.queries.ReadAllQuery;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.UnitOfWork;
-import org.junit.Test;
-
-/**
- * Set of tests verifying that the DynamicHelper functions as expected.
- */
-public class DynamicHelperTests {
-
- @Test
- public void createQuery_ValidReadAllQuery() throws Exception {
- DatabaseSession session = createEmployeeSession();
-
- ReadAllQuery query = new DynamicHelper(session).newReadAllQuery("Employee");
-
- assertNotNull(query);
-
- List<DynamicEntity> emps = (List<DynamicEntity>) session.executeQuery(query);
- assertNotNull(emps);
- session.logout();
- }
-
- @Test
- public void createQuery_ValidReadObjectQuery() throws Exception {
- DatabaseSession session = createEmployeeSession();
-
- ReadObjectQuery query = new DynamicHelper(session).newReadObjectQuery("Employee");
-
- assertNotNull(query);
-
- DynamicEntity emp = (DynamicEntity) session.executeQuery(query);
- assertNotNull(emp);
-
- session.logout();
- }
-
- @Test
- public void createQuery_ValidReportQuery() throws Exception {
- DatabaseSession session = createEmployeeSession();
-
- ReportQuery query = new DynamicHelper(session).newReportQuery("Employee", new ExpressionBuilder());
- query.addCount();
- query.setShouldReturnSingleValue(true);
-
- assertNotNull(query);
-
- Number count = (Number) session.executeQuery(query);
- assertNotNull(count);
- assertTrue(count.intValue() > 0);
- }
-
- @Test
- public void nullArgs() {
- try {
- new DynamicHelper(null).newReadAllQuery(null);
- } catch (NullPointerException e) {
- return;
- }
-
- fail("NullPointerException expected");
- }
-
- protected DatabaseSession createEmployeeSession() throws Exception {
- DatabaseSession session = DynamicTestHelper.createEmptySession();
- DynamicHelper helper = new DynamicHelper(session);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> empClass = dcl.createDynamicClass(getClass().getName() + ".Employee");
-
- DynamicTypeBuilder typeBuilder = new DynamicTypeBuilder(empClass, null, "D_EMPLOYEE");
- typeBuilder.setPrimaryKeyFields("EMP_ID");
- typeBuilder.addDirectMapping("id", int.class, "EMP_ID");
- typeBuilder.addDirectMapping("firstName", String.class, "F_NAME");
- typeBuilder.addDirectMapping("lastName", String.class, "L_NAME");
-
- helper.addTypes(true, true, typeBuilder.getType());
-
- DynamicType empType = helper.getType("Employee");
- assertNotNull("No type found for Employee", empType);
-
- ReportQuery countQuery = helper.newReportQuery("Employee", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int empCount = ((Number) session.executeQuery(countQuery)).intValue();
-
- if (empCount == 0) {
- UnitOfWork uow = session.acquireUnitOfWork();
- DynamicEntity emp = empType.newDynamicEntity();
- emp.set("id", 1);
- emp.set("firstName", "John");
- emp.set("lastName", "Doe");
- uow.registerNewObject(emp);
- uow.commit();
- }
-
- return session;
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/DynamicTestHelper.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/DynamicTestHelper.java
deleted file mode 100644
index 782d143..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/DynamicTestHelper.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Properties;
-
-import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform;
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.sessions.*;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { DynamicClassLoaderTests.class, DynamicHelperTests.class, EntityTypeFromDescriptor.class, EntityTypeFromScratch.class, org.eclipse.persistence.testing.tests.dynamic.orm.comics.AllTests.class, org.eclipse.persistence.testing.tests.dynamic.orm.projectxml.AllTests.class })
-public class DynamicTestHelper {
-
- /**
- * Configure and return a {@link DatabaseLogin} based on test.properties
- *
- * db.driver=oracle.jdbc.OracleDriver
- * db.url=jdbc:oracle:thin:@tlsvrdb5.ca.oracle.com:1521:toplink db.user=user
- * db.pwd=password
- * db.platform=org.eclipse.persistence.platform.database.oracle
- * .Oracle11Platform
- *
- * @return
- */
- public static DatabaseLogin getTestLogin() {
- DatabaseLogin login = new DatabaseLogin();
- Properties props = new Properties();
-
- try {
- FileInputStream in = new FileInputStream("./test.properties");
- props.load(in);
- in.close();
-
- if (props.containsKey("db.platform")) {
- Class<DatabasePlatform> platformClass = (Class<DatabasePlatform>) Class.forName(props.getProperty("db.platform"));
- login.setPlatform(platformClass.newInstance());
- } else {
- login.setPlatform(new DatabasePlatform());
- }
- } catch (IOException e) {
- throw new RuntimeException("DynamicTestHelper.getTestLogin()::", e);
- } catch (InstantiationException e) {
- throw new RuntimeException("DynamicTestHelper.getTestLogin()::", e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException("DynamicTestHelper.getTestLogin()::", e);
- } catch (ClassNotFoundException e) {
- throw new RuntimeException("DynamicTestHelper.getTestLogin()::", e);
- }
-
- login.setConnectionString(props.getProperty("db.url"));
- login.setUserName(props.getProperty("db.user"));
- login.setPassword(props.getProperty("db.pwd"));
-
- return login;
- }
-
- public static DatabaseSession createEmptySession() {
- Project project = new Project(getTestLogin());
- DatabaseSession session = project.createDatabaseSession();
- session.getSessionLog().setLevel(SessionLog.FINE);
- return session;
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/EclipseLinkORMTest.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/EclipseLinkORMTest.java
deleted file mode 100644
index 5a6fc91..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/EclipseLinkORMTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package org.eclipse.persistence.testing.tests.dynamic;
-
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.server.Server;
-import org.eclipse.persistence.testing.util.QuerySQLTracker;
-import org.junit.After;
-import org.junit.AfterClass;
-
-public class EclipseLinkORMTest {
-
- protected static DatabaseSession sharedSession;
-
- private Session session;
-
- protected DatabaseSession getSharedSession() {
- if (sharedSession == null) {
- sharedSession = createSharedSession();
- sharedSession.getSessionLog().setLevel(SessionLog.FINE);
- sharedSession.getSessionLog().setShouldPrintConnection(false);
- sharedSession.getSessionLog().setShouldPrintDate(false);
- sharedSession.getSessionLog().setShouldPrintSession(false);
- sharedSession.getSessionLog().setShouldPrintThread(false);
- QuerySQLTracker.install(sharedSession);
- if (!sharedSession.isConnected()) {
- sharedSession.login();
- }
- }
-
- return sharedSession;
- }
-
- protected Session getSession() {
- if (this.session == null || !this.session.isConnected()) {
- this.session = getSharedSession();
-
- if (this.session.isServerSession()) {
- this.session = ((Server) this.session).acquireClientSession();
- }
- }
-
- return this.session;
- }
-
- protected DatabaseSession createSharedSession() {
- if (sharedSession != null) {
- if (sharedSession.isConnected()) {
- sharedSession.logout();
- }
- }
- try {
- sharedSession = DynamicTestHelper.createEmptySession();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
- return sharedSession;
- }
-
- protected QuerySQLTracker getQuerySQLTracker(Session session) {
- return QuerySQLTracker.getTracker(session);
- }
-
- @After
- public void cleanupClosedSharedSession() {
- if (this.session != null && this.session.isClientSession()) {
- this.session.release();
- }
- this.session = null;
-
- if (sharedSession != null) {
- if (!sharedSession.isConnected()) {
- sharedSession = null;
- } else {
- QuerySQLTracker.getTracker(sharedSession).reset();
- }
- }
- }
-
- @AfterClass
- public static void closeSharedSession() throws Exception {
- if (sharedSession != null && sharedSession.isConnected()) {
- sharedSession.logout();
- sharedSession = null;
- }
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/EntityTypeFromDescriptor.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/EntityTypeFromDescriptor.java
deleted file mode 100644
index 45ec4fa..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/EntityTypeFromDescriptor.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic;
-
-import static junit.framework.Assert.*;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.descriptors.RelationalDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.exceptions.DescriptorException;
-import org.eclipse.persistence.exceptions.IntegrityException;
-import org.eclipse.persistence.internal.dynamic.*;
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.mappings.foundation.AbstractDirectMapping;
-import org.eclipse.persistence.sessions.*;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-import org.junit.Test;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-public class EntityTypeFromDescriptor {
-
- @Test
- public void entityTypeFromDescriptor() throws Exception {
- DatabaseSession session = new Project(buildDatabaseLogin()).createDatabaseSession();
- session.getSessionLog().setLevel(SessionLog.FINE);
- session.login();
-
- DynamicClassLoader dcl = DynamicClassLoader.lookup(session);
-
- ClassDescriptor descriptor = buildMyEntityDescriptor();
- assertFalse(descriptor.isAggregateDescriptor());
-
- DynamicTypeImpl entityType = (DynamicTypeImpl) new DynamicTypeBuilder(dcl, descriptor, null).getType();
-
- assertFalse(descriptor.isAggregateDescriptor());
- assertEquals(MyEntity.class, entityType.getJavaClass());
-
- session.addDescriptor(entityType.getDescriptor());
- new SchemaManager(session).replaceDefaultTables();
-
- DynamicEntity entity = entityType.newDynamicEntity();
- entity.set("id", 1);
- entity.set("name", "Name");
-
- session.insertObject(entity);
-
- session.logout();
-
- }
-
- /**
- * Verify that the descriptor for a dynamic type fails without the
- * additional configuration which is applied to the descriptor during the
- * EntityType creation.
- */
- @Test
- public void invalidDescriptorWithoutEntityType() throws Exception {
- RelationalDescriptor descriptor = buildMyEntityDescriptor();
-
- DatabaseSession session = new Project(buildDatabaseLogin()).createDatabaseSession();
- session.getSessionLog().setLevel(SessionLog.FINE);
- session.addDescriptor(descriptor);
-
- try {
- session.login();
- } catch (IntegrityException ie) {
- assertEquals(descriptor.getMappings().size() + 1, ie.getIntegrityChecker().getCaughtExceptions().size());
-
- // Verify NoSuchField errors for each mapping
- for (int index = 0; index < descriptor.getMappings().size(); index++) {
- DescriptorException ex = (DescriptorException) ie.getIntegrityChecker().getCaughtExceptions().get(index);
- assertEquals(DescriptorException.NO_SUCH_FIELD_WHILE_INITIALIZING_ATTRIBUTES_IN_INSTANCE_VARIABLE_ACCESSOR, ex.getErrorCode());
- }
- DescriptorException de = (DescriptorException) ie.getIntegrityChecker().getCaughtExceptions().lastElement();
- assertEquals(DescriptorException.NO_SUCH_METHOD_WHILE_INITIALIZING_INSTANTIATION_POLICY, de.getErrorCode());
-
- return;
- }
-
- fail("Expected IntegrityException not thrown");
- }
-
- private RelationalDescriptor buildMyEntityDescriptor() {
- RelationalDescriptor descriptor = new RelationalDescriptor();
-
- descriptor.setJavaClass(MyEntity.class);
- descriptor.setTableName("MY_ENTITY");
- descriptor.addPrimaryKeyFieldName("ID");
-
- AbstractDirectMapping mapping = (AbstractDirectMapping) descriptor.addDirectMapping("id", "ID");
- mapping.setAttributeClassification(int.class);
- mapping = (AbstractDirectMapping) descriptor.addDirectMapping("name", "NAME");
- mapping.setAttributeClassification(String.class);
-
- return descriptor;
- }
-
- /**
- * Return
- */
- private DatabaseLogin buildDatabaseLogin() {
- DatabaseLogin login = new DatabaseLogin();
-
- login.useOracleThinJDBCDriver();
- login.setDatabaseURL("localhost:1521:ORCL");
- login.setUserName("scott");
- login.setPassword("tiger");
-
- // TODO - override with values from system properties
-
- return login;
- }
-
- /**
- * Simple concrete subclass of DynamicEntityImpl to test the functionality
- * of EntityType independently of the {@link DynamicClassLoader}
- * functionality which typically generates subclasses.
- */
- public static class MyEntity extends DynamicEntityImpl {
-
- protected MyEntity(DynamicTypeImpl type) {
- super(type);
- }
-
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/EntityTypeFromScratch.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/EntityTypeFromScratch.java
deleted file mode 100644
index 01b4176..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/EntityTypeFromScratch.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic;
-
-import static junit.framework.Assert.assertEquals;
-
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.internal.dynamic.DynamicEntityImpl;
-import org.eclipse.persistence.internal.dynamic.DynamicTypeImpl;
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.sessions.DatabaseLogin;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Project;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-import org.junit.Test;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-public class EntityTypeFromScratch {
-
- @Test
-public void entityTypeFromDescriptor() throws Exception {
- DynamicTypeImpl entityType = buildMyEntityType();
-
- assertEquals(MyEntity.class, entityType.getJavaClass());
-
- DatabaseSession session = new Project(buildDatabaseLogin()).createDatabaseSession();
- session.getSessionLog().setLevel(SessionLog.FINE);
- session.login();
-
- session.addDescriptor(entityType.getDescriptor());
- new SchemaManager(session).replaceDefaultTables();
-
- DynamicEntity entity = entityType.newDynamicEntity();
- entity.set("id", 1);
- entity.set("name", "Name");
-
- session.insertObject(entity);
-
- session.logout();
-
-}
-
-private DynamicTypeImpl buildMyEntityType() {
- DynamicTypeBuilder factory = new DynamicTypeBuilder(MyEntity.class, null, "MY_ENTITY");
- factory.setPrimaryKeyFields("ID");
- factory.addDirectMapping("id", int.class, "ID");
- factory.addDirectMapping("name", String.class, "NAME");
-
- return (DynamicTypeImpl) factory.getType();
-}
-
- /**
- * Return
- */
- private DatabaseLogin buildDatabaseLogin() {
- DatabaseLogin login = new DatabaseLogin();
-
- login.useOracleThinJDBCDriver();
- login.setDatabaseURL("localhost:1521:ORCL");
- login.setUserName("scott");
- login.setPassword("tiger");
-
- // TODO - override with values from system properties
-
- return login;
- }
-
- /**
- * Simple concrete subclass of DynamicEntityImpl to test the functionality
- * of EntityType independently of the {@link DynamicClassLoader}
- * functionality which typically generates subclasses.
- */
- public static class MyEntity extends DynamicEntityImpl {
-
- protected MyEntity(DynamicTypeImpl type) {
- super(type);
- }
-
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/employee/AllTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/employee/AllTests.java
deleted file mode 100644
index b73a649..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/employee/AllTests.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.employee;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { MappingConfigTests.class, QueryTests.class, TransactionTests.class })
-public class AllTests {
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/employee/MappingConfigTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/employee/MappingConfigTests.java
deleted file mode 100644
index 43e8d9b..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/employee/MappingConfigTests.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.employee;
-
-import static org.junit.Assert.*;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.mappings.*;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.testing.models.dynamic.employee.EmployeeDynamicMappings;
-import org.eclipse.persistence.testing.tests.dynamic.EclipseLinkORMTest;
-import org.junit.Test;
-
-/**
- * Set of tests to ensure the mappings are properly populated from the provided
- * annotations/xml.
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-public class MappingConfigTests extends EclipseLinkORMTest {
-
- @Test
- public void verifySharedSession() throws Exception {
-
- assertNotNull(getSharedSession());
- assertTrue(getSharedSession().isConnected());
- assertTrue(getSharedSession().isDatabaseSession());
-
- //assertTrue(getSharedSession().getName().startsWith("file"));
- //assertTrue(getSharedSession().getName().endsWith("empty"));
- }
-
- @Test
- public void verifyEmployeeDescriptor() throws Exception {
- Session session = getSession();
- ClassDescriptor descriptor = session.getDescriptorForAlias("Employee");
-
- assertNotNull(descriptor);
- assertEquals("Employee", descriptor.getAlias());
- assertNull(descriptor.getInheritancePolicyOrNull());
-
- // Address Mapping
- OneToOneMapping addrMapping = (OneToOneMapping) descriptor.getMappingForAttributeName("address");
- assertNotNull(addrMapping);
- assertTrue(addrMapping.isPrivateOwned());
- assertSame(session.getDescriptorForAlias("Address"), addrMapping.getReferenceDescriptor());
-
- // PhoenNumber Mapping
- OneToManyMapping phoneMapping = (OneToManyMapping) descriptor.getMappingForAttributeName("phoneNumbers");
- assertNotNull(phoneMapping);
- assertTrue(phoneMapping.isPrivateOwned());
- assertSame(session.getDescriptorForAlias("PhoneNumber"), phoneMapping.getReferenceDescriptor());
-
- // Manager Mapping
- OneToOneMapping managerMapping = (OneToOneMapping) descriptor.getMappingForAttributeName("manager");
- assertNotNull(managerMapping);
- assertFalse(managerMapping.isPrivateOwned());
- assertSame(descriptor, managerMapping.getReferenceDescriptor());
-
- // Managed Employees Mapping
- OneToManyMapping managedEmployeesMapping = (OneToManyMapping) descriptor.getMappingForAttributeName("managedEmployees");
- assertNotNull(managedEmployeesMapping);
- assertFalse(managedEmployeesMapping.isPrivateOwned());
- assertSame(descriptor, managedEmployeesMapping.getReferenceDescriptor());
-
- // Projects Mapping
- ManyToManyMapping projectsMapping = (ManyToManyMapping) descriptor.getMappingForAttributeName("projects");
- assertNotNull(projectsMapping);
- assertFalse(projectsMapping.isPrivateOwned());
- assertSame(session.getDescriptorForAlias("Project"), projectsMapping.getReferenceDescriptor());
- }
-
- @Test
- public void verifyAddressDescriptor() throws Exception {
- Session session = getSession();
- ClassDescriptor descriptor = session.getDescriptorForAlias("Address");
-
- assertNotNull(descriptor);
- assertEquals("Address", descriptor.getAlias());
- assertNull(descriptor.getInheritancePolicyOrNull());
- }
-
- @Test
- public void verifyPhoneNumberDescriptor() {
- Session session = getSession();
- ClassDescriptor descriptor = session.getDescriptorForAlias("PhoneNumber");
-
- assertNotNull(descriptor);
- assertEquals("PhoneNumber", descriptor.getAlias());
- assertNull(descriptor.getInheritancePolicyOrNull());
- }
-
- @Test
- public void verifyProjectDescriptor() {
- Session session = getSession();
- ClassDescriptor descriptor = session.getDescriptorForAlias("Project");
-
- assertNotNull(descriptor);
- assertEquals("Project", descriptor.getAlias());
- assertNotNull(descriptor.getInheritancePolicyOrNull());
- }
-
- @Test
- public void verifySmallProjectDescriptor() {
- Session session = getSession();
- ClassDescriptor descriptor = session.getDescriptorForAlias("SmallProject");
-
- assertNotNull(descriptor);
- assertEquals("SmallProject", descriptor.getAlias());
- assertNotNull(descriptor.getInheritancePolicyOrNull());
- }
-
- @Test
- public void verifyLargeProjectDescriptor() {
- Session session = getSession();
- ClassDescriptor descriptor = session.getDescriptorForAlias("LargeProject");
-
- assertNotNull(descriptor);
- assertEquals("LargeProject", descriptor.getAlias());
- assertNotNull(descriptor.getInheritancePolicyOrNull());
- }
-
- @Override
- protected DatabaseSession createSharedSession() {
- DatabaseSession shared = super.createSharedSession();
-
- if (shared.getDescriptors().isEmpty()) {
- EmployeeDynamicMappings.createTypes(shared, "model.dynamic.employee", false);
- }
-
- return shared;
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/employee/QueryTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/employee/QueryTests.java
deleted file mode 100644
index 7152a16..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/employee/QueryTests.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.employee;
-
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.List;
-
-import javax.persistence.PersistenceContext;
-
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.testing.models.dynamic.employee.*;
-import org.eclipse.persistence.testing.tests.dynamic.EclipseLinkORMTest;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-import org.junit.Test;
-
-/**
- * Simple query examples for the XML mapped Employee domain model.
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-@PersistenceContext(unitName = "empty")
-public class QueryTests extends EclipseLinkORMTest {
-
- private Queries examples = new Queries();
-
- private Sample samples;
-
- public Queries getQueries() {
- return this.examples;
- }
-
- public Sample getSamples() {
- if (this.samples == null) {
- this.samples = new Sample(getSharedSession());
- }
- return this.samples;
- }
-
- /**
- * Simple example using dynamic JP QL to retrieve all Employee instances
- * sorted by lastName and firstName.
- */
- @Test
- public void readAllEmployees() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- List<DynamicEntity> emps = getQueries().readAllEmployees(helper, session);
-
- getSamples().assertSame(emps);
- session.release();
- }
-
- @Test
- public void readAllEmployeesWithAddress() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- List<DynamicEntity> emps = getQueries().readAllEmployeesWithAddress(helper, session);
- assertNotNull(emps);
- }
-
- @Test
- public void joinFetchHint() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- List<DynamicEntity> emps = getQueries().readAllEmployeesWithAddress(helper, session);
- assertNotNull(emps);
- }
-
- @Test
- public void minEmployeeId() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- int minId = Queries.minimumEmployeeId(helper, session);
-
- assertTrue(minId > 0);
- }
-
- @Test
- public void testReadAllExressions() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- List<DynamicEntity> emps = getQueries().findUsingNativeReadAllQuery(helper, session);
-
- assertNotNull(emps);
- }
-
- @Override
- protected DatabaseSession createSharedSession() {
- DatabaseSession shared = super.createSharedSession();
-
- if (shared.getDescriptors().isEmpty()) {
- EmployeeDynamicMappings.createTypes(shared, "model.dynamic.employee", false);
- }
- new SchemaManager(shared).replaceDefaultTables();
- this.samples = new Sample(shared);
- this.samples.persistAll(shared);
-
- return shared;
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/employee/TransactionTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/employee/TransactionTests.java
deleted file mode 100644
index 74f247e..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/employee/TransactionTests.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.employee;
-
-import static junit.framework.Assert.*;
-
-import javax.persistence.PersistenceContext;
-
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.sessions.*;
-import org.eclipse.persistence.testing.models.dynamic.employee.*;
-import org.eclipse.persistence.testing.tests.dynamic.EclipseLinkORMTest;
-import org.eclipse.persistence.tools.schemaframework.DynamicSchemaManager;
-import org.junit.Test;
-
-@PersistenceContext(unitName = "empty")
-public class TransactionTests extends EclipseLinkORMTest {
-
- Transactions transactions = new Transactions();
- Queries queries = new Queries();
- private static Sample samplePopulation;
-
- @Test
- public void pessimisticLocking() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- transactions.pessimisticLocking(helper, getSession());
- }
-
- @Test
- public void createUsingPersist() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicEntity emp = transactions.createUsingPersist(helper, session);
-
- assertNotNull(emp);
- assertTrue(emp.<Integer> get("id") > 0);
-
- UnitOfWork uow = session.acquireUnitOfWork();
- DynamicEntity empWC = (DynamicEntity) uow.readObject(emp);
- // Delete assuming private owned relationships;
- uow.deleteObject(empWC);
- uow.commit();
-
- getSample().verifyCounts(session);
- }
-
- @Test
- public void createUsingMerge() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicEntity emp = transactions.createUsingMerge(helper, session);
-
- assertNotNull(emp);
- assertTrue(emp.<Integer> get("id") > 0);
-
- UnitOfWork uow = session.acquireUnitOfWork();
- DynamicEntity empWC = (DynamicEntity) uow.readObject(emp);
- // Delete assuming private owned relationships;
- uow.deleteObject(empWC);
- uow.commit();
-
- getSample().verifyCounts(session);
- }
-
- @Test
- public void mergeDetached_UOW() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- // get shared copy
- DynamicEntity emp = this.queries.minimumEmployee(helper, session);
- assertNotNull(emp);
-
- // Create detached copy using separate UOW
- UnitOfWork detachUOW = session.acquireUnitOfWork();
- DynamicEntity detachedEmp = (DynamicEntity) detachUOW.readObject(emp);
- detachUOW.release();
-
- detachedEmp.set("salary", emp.<Integer> get("salary") + 1);
-
- getQuerySQLTracker(session).reset();
- assertEquals(0, getQuerySQLTracker(session).getTotalSQLUPDATECalls());
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.deepMergeClone(detachedEmp);
- uow.writeChanges();
- assertEquals(1, getQuerySQLTracker(session).getTotalSQLUPDATECalls());
-
- uow.release();
- }
-
- @Test
- public void mergeDetached_Copy() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- // get shared copy
- DynamicEntity emp = this.queries.minimumEmployee(helper, session);
- assertNotNull(emp);
-
- // Create detached copy using session.copyObject
- ObjectCopyingPolicy policy = new ObjectCopyingPolicy();
- policy.setShouldResetPrimaryKey(false);
- policy.setDepth(2);
- DynamicEntity detachedEmp = (DynamicEntity) session.copyObject(emp, policy);
-
- detachedEmp.set("salary", emp.<Integer> get("salary") + 1);
-
- getQuerySQLTracker(session).reset();
- assertEquals(0, getQuerySQLTracker(session).getTotalSQLUPDATECalls());
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.deepMergeClone(detachedEmp);
- uow.writeChanges();
- assertEquals(1, getQuerySQLTracker(session).getTotalSQLUPDATECalls());
-
- uow.release();
- }
-
- public Sample getSample() {
- if (samplePopulation == null) {
- samplePopulation = new Sample(getSharedSession());
- }
- return samplePopulation;
- }
-
- @Override
- protected DatabaseSession createSharedSession() {
- DatabaseSession shared = super.createSharedSession();
-
- EmployeeDynamicMappings.createTypes(shared, "example.model.employee", true);
-
- DynamicSchemaManager dsm = new DynamicSchemaManager(shared);
- dsm.replaceDefaultTables(true, true);
-
- getSample().persistAll(shared);
-
- return shared;
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/AllTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/AllTests.java
deleted file mode 100644
index 06ad76b..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/AllTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.orm.comics;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { ConfigTests.class, CreateAndInitDatabase.class, QueryTests.class })
-public class AllTests {
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/ConfigTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/ConfigTests.java
deleted file mode 100644
index f4d23b7..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/ConfigTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.orm.comics;
-
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.Test;
-
-
-public class ConfigTests {
-
- @Test
- public void verifyDescriptorClasses() {
- Server server = SessionHelper.getComicsSession();
-
- assertNotNull(server);
-
- ClassDescriptor descriptor = server.getClassDescriptorForAlias("Issue");
- assertNotNull(descriptor);
- assertTrue(DynamicEntity.class.isAssignableFrom(descriptor.getJavaClass()));
-
- descriptor = server.getClassDescriptorForAlias("Publisher");
- assertNotNull(descriptor);
- assertTrue(DynamicEntity.class.isAssignableFrom(descriptor.getJavaClass()));
-
- descriptor = server.getClassDescriptorForAlias("Title");
- assertNotNull(descriptor);
- assertTrue(DynamicEntity.class.isAssignableFrom(descriptor.getJavaClass()));
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/CreateAndInitDatabase.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/CreateAndInitDatabase.java
deleted file mode 100644
index 2164bb0..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/CreateAndInitDatabase.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * shsmith,dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.orm.comics;
-
-import static junit.framework.Assert.assertEquals;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.UnitOfWork;
-import org.eclipse.persistence.sessions.server.Server;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-import org.junit.Test;
-
-public class CreateAndInitDatabase {
-
- private static final String DATA_HOME = "org/eclipse/persistence/testing/tests/dynamic/orm/comics/";
-
- @Test
- public void populate() throws Exception {
- Server server = null;
- Session session = null;
- UnitOfWork uow = null;
-
- try {
- server = SessionHelper.getComicsSession();
- DynamicHelper helper = new DynamicHelper(server);
- session = server.acquireClientSession();
-
- uow = session.acquireUnitOfWork();
-
- URL publisherFileURL = getClass().getClassLoader().getResource(DATA_HOME + "publisher.tab");
- Map<Integer, DynamicEntity> publishers = loadPublishers(server, publisherFileURL);
- persist(uow, publishers);
-
- URL titleFileURL = getClass().getClassLoader().getResource(DATA_HOME + "title.tab");
- Map<Integer, DynamicEntity> titles = loadTitles(server, titleFileURL, publishers);
- persist(uow, titles);
-
- URL issueFileURL = getClass().getClassLoader().getResource(DATA_HOME + "issue.tab");
- Map<Integer, DynamicEntity> issues = loadIssues(server, issueFileURL, titles);
- persist(uow, issues);
-
- SchemaManager sm = new SchemaManager(server);
- sm.replaceDefaultTables();
- sm.replaceSequences();
-
- uow.commit();
-
- ReportQuery countQuery = new ReportQuery(helper.getType("Publisher").getJavaClass(), new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- assertEquals(publishers.size(), ((Number) session.executeQuery(countQuery)).intValue());
-
- countQuery = new ReportQuery(helper.getType("Title").getJavaClass(), new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- assertEquals(titles.size(), ((Number) session.executeQuery(countQuery)).intValue());
-
- countQuery = new ReportQuery(helper.getType("Issue").getJavaClass(), new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- assertEquals(issues.size(), ((Number) session.executeQuery(countQuery)).intValue());
- } finally {
- if (uow != null && uow.isActive()) {
- uow.release();
- }
- if (session != null) {
- session.release();
- }
- if (server != null) {
- server.release();
- }
- }
- }
-
- private static void persist(UnitOfWork uow, Map<Integer, DynamicEntity> entities) {
- for (DynamicEntity entity : entities.values()) {
- uow.registerNewObject(entity);
- }
- }
-
- private static Map<Integer, DynamicEntity> loadIssues(Server server, URL fileURL, Map<Integer, DynamicEntity> titles) throws Exception {
- DynamicHelper helper = new DynamicHelper(server);
- DynamicType type = helper.getType("Issue");
- Map<Integer, DynamicEntity> issues = new HashMap<Integer, DynamicEntity>();
-
- BufferedReader reader = null;
-
- try {
- reader = new BufferedReader(new InputStreamReader(fileURL.openStream()));
- String nextLine = null;
- while ((nextLine = reader.readLine()) != null) {
- DynamicEntity issue = buildIssue(type, nextLine, titles);
- issues.put(issue.<Integer> get("id"), issue);
- }
- } finally {
- if (reader != null) {
- reader.close();
- }
- }
- return issues;
- }
-
- private static DynamicEntity buildIssue(DynamicType issueType, String line, Map<Integer, DynamicEntity> titles) {
- // TITLE,ISSUE_NUMBER,STORY_ARC,CONDITION,COMMENTS,COPIES,ID,TITLE_ID
- String[] columns = line.split("\t");
- DynamicEntity issue = issueType.newDynamicEntity();
- issue.set("number", Integer.valueOf(columns[1]));
- issue.set("condition", columns[3]);
- issue.set("comments", columns[4]);
- String numCopiesString = columns[5];
- if (numCopiesString.length() > 0) {
- issue.set("copies", Integer.valueOf(numCopiesString));
- }
- issue.set("id", Integer.valueOf(columns[6]));
- issue.set("title", titles.get(Integer.valueOf(columns[7])));
- return issue;
- }
-
- private static Map<Integer, DynamicEntity> loadPublishers(Server server, URL fileURL) throws Exception {
- DynamicHelper helper = new DynamicHelper(server);
- DynamicType type = helper.getType("Publisher");
- Map<Integer, DynamicEntity> publishers = new HashMap<Integer, DynamicEntity>();
-
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(fileURL.openStream()));
- String nextLine = null;
- while ((nextLine = reader.readLine()) != null) {
- DynamicEntity publisher = buildPublisher(type, nextLine);
- publishers.put(publisher.<Integer> get("id"), publisher);
- }
- } finally {
- if (reader != null) {
- reader.close();
- }
- }
- return publishers;
- }
-
- private static DynamicEntity buildPublisher(DynamicType publisherType, String line) {
- // NAME ID
- String[] columns = line.split("\t");
- assert columns.length == 2;
- DynamicEntity publisher = publisherType.newDynamicEntity();
- publisher.set("name", columns[0]);
- publisher.set("id", Integer.valueOf(columns[1]));
- return publisher;
- }
-
- private static Map<Integer, DynamicEntity> loadTitles(Server server, URL fileURL, Map<Integer, DynamicEntity> publishers) throws Exception {
- DynamicHelper helper = new DynamicHelper(server);
- DynamicType type = helper.getType("Title");
- Map<Integer, DynamicEntity> titles = new HashMap<Integer, DynamicEntity>();
-
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(fileURL.openStream()));
- String nextLine = null;
- while ((nextLine = reader.readLine()) != null) {
- DynamicEntity title = buildTitle(type, nextLine, publishers);
- titles.put(title.<Integer> get("id"), title);
- }
- } finally {
- if (reader != null) {
- reader.close();
- }
- }
- return titles;
- }
-
- private static DynamicEntity buildTitle(DynamicType type, String line, Map<Integer, DynamicEntity> publishers) {
- // NAME,PUBLISHER,FORMAT,SUBSCRIBED,ID,PUBLISHER_ID
- String[] columns = line.split("\t");
-
- DynamicEntity title = type.newDynamicEntity();
- title.set("name", columns[0]);
- title.set("format", columns[2]);
- title.set("id", Integer.valueOf(columns[4]));
- title.set("publisher", publishers.get(Integer.valueOf(columns[5])));
- return title;
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/QueryTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/QueryTests.java
deleted file mode 100644
index d31242c..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/QueryTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.orm.comics;
-
-import org.eclipse.persistence.sessions.Session;
-import org.junit.Test;
-
-public class QueryTests {
-
- @Test
- public void readAll() {
- Session session = SessionHelper.getComicsSession().acquireClientSession();
-
- session.readAllObjects(session.getDescriptorForAlias("Issue").getJavaClass());
- session.readAllObjects(session.getDescriptorForAlias("Publisher").getJavaClass());
- session.readAllObjects(session.getDescriptorForAlias("Title").getJavaClass());
-
- session.release();
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/SessionHelper.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/SessionHelper.java
deleted file mode 100644
index 98f7978..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/SessionHelper.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.eclipse.persistence.testing.tests.dynamic.orm.comics;
-
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.sessions.factories.SessionManager;
-import org.eclipse.persistence.sessions.factories.XMLSessionConfigLoader;
-import org.eclipse.persistence.sessions.server.Server;
-
-public class SessionHelper {
-
- private static final String SESSION_NAME = "dynamic-comics";
-
- public static Server getComicsSession() {
- if (!SessionManager.getManager().getSessions().containsKey(SESSION_NAME)) {
-
- DynamicClassLoader dcl = new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
-
- new DynamicTypeBuilder(dcl.createDynamicClass("model.Issue"), null);
- new DynamicTypeBuilder(dcl.createDynamicClass("model.Publisher"), null);
- new DynamicTypeBuilder(dcl.createDynamicClass("model.Title"), null);
-
- XMLSessionConfigLoader loader = new XMLSessionConfigLoader();
- loader.setClassLoader(dcl);
- loader.setSessionName(SESSION_NAME);
-
- Server session = (Server) SessionManager.getManager().getSession(loader);
-
- return session;
- }
- return (Server) SessionManager.getManager().getSession(SESSION_NAME);
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/issue.tab b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/issue.tab
deleted file mode 100644
index 4c4c30c..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/issue.tab
+++ /dev/null
@@ -1,4201 +0,0 @@
-Sandman Mystery Theatre 5 Near Mint 1 96 20
-Sandman Mystery Theatre 6 Near Mint 1 97 20
-Sandman Mystery Theatre 7 Near Mint 1 98 20
-Cerebus 104 Near Mint Flaming Carrot 1 99 123
-Hardware 1 Near Mint 1 100 22
-Hardware 2 Near Mint 1 101 22
-Legionnaires 3 Near Mint 2 102 11
-Maxx, The 1 Near Mint 1 103 2
-Maxx, The 2 Near Mint 1 104 2
-Maxx, The 3 Near Mint 1 105 2
-Maxx, The 4 Near Mint 1 106 2
-Maxx, The 5 Near Mint 1 107 2
-Justice League Task Force 1 Near Mint 1 108 24
-Justice League Task Force 2 Near Mint 1 109 24
-Justice Society of America 9 Near Mint 1 110 25
-Justice Society of America 10 Near Mint 1 111 25
-Books of Magic (mini-series) 1 Near Mint 1 112 434
-Books of Magic (mini-series) 2 Near Mint 1 113 434
-Books of Magic (mini-series) 3 Near Mint 1 114 434
-Books of Magic (mini-series) 4 Near Mint 1 115 434
-Enigma 1 Near Mint 1 116 26
-Enigma 2 Near Mint 1 117 26
-Enigma 3 Near Mint 1 118 26
-DC Special 11 Fine "Monsters are Coming", Kirby reprints 1 119 27
-Justice League Quarterly 4 Near Mint 1 120 289
-Superman (vol. 2) 10 Near Mint 1 121 165
-Superman, The Adventures of 460 Near Mint Eradicator 1 122 51
-Superman, The Adventures of 461 Near Mint Eradicator 1 123 51
-Superman, The Adventures of 480 Near Mint Eradicator 1 124 51
-Justice League America 69 Near Mint 1 125 12
-Justice League America 70 Near Mint 2 126 12
-Vertigo Preview 1 Near Mint 1 127 29
-Spawn 8 Near Mint 1 128 30
-Spawn 9 Near Mint 1 129 30
-Spawn 10 Near Mint 1 130 30
-Spawn 11 Near Mint 1 131 30
-Spawn 12 Near Mint 1 132 30
-Stanley and His Monster 3 Near Mint 1 133 31
-Stanley and His Monster 4 Near Mint 1 134 31
-Trencher 1 Near Mint 1 135 32
-Trencher 2 Near Mint 1 136 32
-Trencher 3 Near Mint 1 137 32
-Trinity 1 Near Mint 1 138 34
-Trinity 2 Near Mint 1 139 34
-Swamp Thing (Annual) 5 Near Mint 1 140 35
-Sandman 10 Near Mint 1 141 10
-Sandman 11 Near Mint 1 142 10
-Sandman 12 Near Mint 1 143 10
-Sandman 13 Near Mint 1 144 10
-Sandman 14 Near Mint 1 145 10
-Secrets of the Legion of Super-Heroes 3 Near Mint 1 146 36
-Legionnaires 2 Near Mint 1 147 11
-Legionnaires 4 Near Mint 1 148 11
-Legionnaires 5 Near Mint 1 149 11
-Legionnaires 6 Near Mint 1 150 11
-Legionnaires 7 Near Mint 1 151 11
-Martian Manhunter: American Secrets 1 Near Mint 1 152 38
-Martian Manhunter: American Secrets 2 Near Mint 1 153 38
-Martian Manhunter: American Secrets 3 Near Mint 1 154 38
-Ray, The 1 Near Mint 1 155 40
-Ray, The 2 Near Mint 1 156 40
-Ray, The 3 Near Mint 1 157 40
-Ray, The 4 Near Mint 1 158 40
-Ray, The 5 Near Mint 1 159 40
-Ray, The 6 Near Mint 1 160 40
-Last One, The 1 Near Mint 1 161 41
-Last One, The 2 Near Mint 1 162 41
-Last One, The 3 Near Mint 1 163 41
-Last One, The 4 Near Mint 1 164 41
-Hellblazer 11 Near Mint 1 165 15
-Heckler, The 1 Near Mint Kieth Giffen 1 166 42
-Heckler, The 2 Near Mint Kieth Giffen 1 167 42
-Heckler, The 3 Near Mint Kieth Giffen 1 168 42
-Heckler, The 4 Near Mint Kieth Giffen 1 169 42
-Heckler, The 5 Near Mint Kieth Giffen 1 170 42
-Heckler, The 6 Near Mint Kieth Giffen 1 171 42
-Justice Society of America (mini-series) 1 Near Mint 1 172 43
-Justice Society of America (mini-series) 2 Near Mint 1 173 43
-Justice Society of America (mini-series) 3 Near Mint 1 174 43
-Justice Society of America (mini-series) 4 Near Mint 1 175 43
-Justice Society of America (mini-series) 5 Near Mint 1 176 43
-Justice Society of America (mini-series) 6 Near Mint 1 177 43
-Justice Society of America (mini-series) 7 Near Mint 1 178 43
-Justice Society of America (mini-series) 8 Near Mint 1 179 43
-Akira 19 Near Mint 1 265 58
-Akira 20 Near Mint 1 266 58
-Akira 21 Near Mint 1 267 58
-Akira 22 Near Mint 1 268 58
-Akira 23 Near Mint 1 269 58
-Akira 24 Near Mint 1 270 58
-Akira 25 Near Mint 1 271 58
-Akira 26 Near Mint 1 272 58
-Akira 27 Near Mint 1 273 58
-Akira 28 Near Mint 1 274 58
-Akira 29 Near Mint 1 275 58
-Akira 30 Near Mint 1 276 58
-Akira 31 Near Mint 1 277 58
-Akira 32 Near Mint 1 278 58
-Akira 33 Near Mint 1 279 58
-Ambush Bug Nothing Special 1 Near Mint 1 280 284
-Animal Man 49 Near Mint 1 281 59
-Animal Man 50 Near Mint 1 282 59
-Animal Man 51 Near Mint 1 283 59
-Batman Shadow of the Bat 1 Near Mint 1 284 60
-Batman Shadow of the Bat 2 Near Mint 1 285 60
-Batman Shadow of the Bat 3 Near Mint 1 286 60
-Batman Shadow of the Bat 4 Near Mint 1 287 60
-Cosmic Boy 1 Near Mint 1 288 61
-Cosmic Boy 2 Near Mint 1 289 61
-Cosmic Boy 3 Near Mint 1 290 61
-Cosmic Boy 4 Near Mint 1 291 61
-Dare 1 Near Mint 1 292 62
-Dare 2 Near Mint 1 293 62
-Dare 3 Near Mint 1 294 62
-Dare 4 Near Mint 1 295 62
-Doom Force 1 Near Mint 1 296 63
-Doom Patrol 39 Near Mint 1 297 252
-Doom Patrol 40 Near Mint 1 298 252
-Doom Patrol 41 Near Mint 1 299 252
-Doom Patrol 42 Near Mint 1 300 252
-Doom Patrol 43 Near Mint 1 301 252
-Doom Patrol 44 Near Mint 1 302 252
-Doom Patrol 45 Near Mint 1 303 252
-Doom Patrol 46 Near Mint 1 304 252
-Doom Patrol 47 Near Mint 1 305 252
-Doom Patrol 48 Near Mint 1 306 252
-Doom Patrol 49 Near Mint 1 307 252
-Doom Patrol 50 Near Mint 1 308 252
-Doom Patrol 51 Near Mint 1 309 252
-Doom Patrol 52 Near Mint 1 310 252
-Doom Patrol 53 Near Mint 1 311 252
-Doom Patrol 54 Near Mint 1 312 252
-Doom Patrol 55 Near Mint 1 313 252
-Doom Patrol 56 Near Mint 1 314 252
-Doom Patrol 57 Near Mint 1 315 252
-Doom Patrol 58 Near Mint 1 316 252
-Doom Patrol 59 Near Mint 1 317 252
-Doom Patrol 60 Near Mint 1 318 252
-Doom Patrol 61 Near Mint 1 319 252
-Doom Patrol 62 Near Mint 1 320 252
-Doom Patrol 63 Near Mint 1 321 252
-Doom Patrol 64 Near Mint 1 322 252
-Doom Patrol 65 Near Mint 1 323 252
-Doom Patrol 66 Near Mint 1 324 252
-Eclipso 1 Near Mint 1 325 64
-Green Lantern, Ganthet's Tale 1 Near Mint 1 326 65
-Gotham by Gaslight 1 Near Mint 1 327 66
-Green Lantern (vol. 1) 142 Near Mint 1 328 67
-Green Lantern (vol. 1) 143 Near Mint 1 329 67
-Green Lantern (vol. 1) 161 Near Mint 1 330 67
-Green Lantern, Mosaic 1 Near Mint 1 331 68
-Green Lantern, Mosaic 2 Near Mint 1 332 68
-Guy Gardner 1 Near Mint 1 333 69
-Invasion 1 Near Mint 1 334 70
-Invasion 2 Near Mint 1 335 70
-Invasion 3 Near Mint 2 336 70
-Justice League Europe (Annual) 2 Near Mint 1 337 71
-Justice Society of America 1 Near Mint 1 338 25
-Justice Society of America 2 Near Mint 1 339 25
-Justice Society of America 3 Near Mint 1 340 25
-Justice Society of America 4 Near Mint 1 341 25
-Justice Society of America 5 Near Mint 1 342 25
-Justice Society of America 6 Near Mint 1 343 25
-Kamandi 14 Near Mint Kirby 1 344 72
-Kamandi 15 Near Mint Kirby 1 345 72
-L.E.G.I.O.N. 1 Near Mint 1 346 146
-L.E.G.I.O.N. 2 Near Mint 1 347 146
-L.E.G.I.O.N. 3 Near Mint 1 348 146
-L.E.G.I.O.N. 4 Near Mint 1 349 146
-L.E.G.I.O.N. 5 Near Mint 1 350 146
-L.E.G.I.O.N. 6 Near Mint 1 351 146
-L.E.G.I.O.N. 7 Near Mint 1 352 146
-L.E.G.I.O.N. 8 Near Mint 1 353 146
-L.E.G.I.O.N. 9 Near Mint 1 354 146
-L.E.G.I.O.N. 10 Near Mint 1 355 146
-L.E.G.I.O.N. 11 Near Mint 1 356 146
-L.E.G.I.O.N. 12 Near Mint 1 357 146
-L.E.G.I.O.N. 13 Near Mint 1 358 146
-L.E.G.I.O.N. 14 Near Mint 1 359 146
-L.E.G.I.O.N. 15 Near Mint 1 360 146
-L.E.G.I.O.N. 16 Near Mint 1 361 146
-L.E.G.I.O.N. 17 Near Mint 1 362 146
-L.E.G.I.O.N. 18 Near Mint 1 363 146
-L.E.G.I.O.N. 19 Near Mint 1 364 146
-L.E.G.I.O.N. 20 Near Mint 1 365 146
-L.E.G.I.O.N. 21 Near Mint 1 366 146
-L.E.G.I.O.N. 22 Near Mint 1 367 146
-L.E.G.I.O.N. 23 Near Mint 1 368 146
-L.E.G.I.O.N. 24 Near Mint 1 369 146
-L.E.G.I.O.N. 25 Near Mint 1 370 146
-L.E.G.I.O.N. 26 Near Mint 1 371 146
-L.E.G.I.O.N. 27 Near Mint 1 372 146
-L.E.G.I.O.N. 28 Near Mint 1 373 146
-L.E.G.I.O.N. 29 Near Mint 1 374 146
-L.E.G.I.O.N. 30 Near Mint 1 375 146
-L.E.G.I.O.N. 31 Near Mint 1 376 146
-L.E.G.I.O.N. 32 Near Mint 1 377 146
-L.E.G.I.O.N. 33 Near Mint 1 378 146
-L.E.G.I.O.N. 34 Near Mint 1 379 146
-L.E.G.I.O.N. 35 Near Mint 1 380 146
-L.E.G.I.O.N. 36 Near Mint 1 381 146
-L.E.G.I.O.N. 37 Near Mint 1 382 146
-L.E.G.I.O.N. 38 Near Mint 1 383 146
-L.E.G.I.O.N. 39 Near Mint 1 384 146
-L.E.G.I.O.N. 40 Near Mint 1 385 146
-L.E.G.I.O.N. 41 Near Mint 1 386 146
-L.E.G.I.O.N. 42 Near Mint 1 387 146
-L.E.G.I.O.N. 43 Near Mint 1 388 146
-L.E.G.I.O.N. 44 Near Mint 1 389 146
-L.E.G.I.O.N. 45 Near Mint 1 390 146
-L.E.G.I.O.N. 46 Near Mint 1 391 146
-L.E.G.I.O.N. 47 Near Mint 1 392 146
-L.E.G.I.O.N. 48 Near Mint 1 393 146
-L.E.G.I.O.N. 49 Near Mint 1 394 146
-L.E.G.I.O.N. 50 Near Mint 1 395 146
-L.E.G.I.O.N. 51 Near Mint 1 396 146
-L.E.G.I.O.N. 52 Near Mint 1 397 146
-L.E.G.I.O.N. 53 Near Mint 1 398 146
-L.E.G.I.O.N. 54 Near Mint 1 399 146
-L.E.G.I.O.N. 55 Near Mint 1 400 146
-L.E.G.I.O.N. 56 Near Mint 1 401 146
-L.E.G.I.O.N. 57 Near Mint 1 402 146
-L.E.G.I.O.N. 58 Near Mint 1 403 146
-L.E.G.I.O.N. 59 Near Mint 1 404 146
-L.E.G.I.O.N. 60 Near Mint 1 405 146
-L.E.G.I.O.N. 61 Near Mint 1 406 146
-L.E.G.I.O.N. 62 Near Mint 1 407 146
-L.E.G.I.O.N. 63 Near Mint 1 408 146
-L.E.G.I.O.N. 64 Near Mint 1 409 146
-L.E.G.I.O.N. (Annual) 1 Near Mint 1 410 73
-L.E.G.I.O.N. (Annual) 2 Near Mint 1 411 73
-L.E.G.I.O.N. (Annual) 3 Near Mint 1 412 73
-L.E.G.I.O.N. (Annual) 4 Near Mint 1 413 73
-L.E.G.I.O.N. (Annual) 5 Near Mint 1 414 73
-Legion of Super-Heroes (vol. 3) 2 Near Mint 2 415 147
-Legion of Super-Heroes (vol. 3) 3 Near Mint 2 416 147
-Legion of Super-Heroes (vol. 3) 4 Near Mint 1 417 147
-Legion of Super-Heroes (vol. 3) 5 Near Mint 1 418 147
-Legion of Super-Heroes (vol. 3) 6 Near Mint 1 419 147
-Legion of Super-Heroes (vol. 3) 7 Near Mint 1 420 147
-Legion of Super-Heroes (vol. 3) 8 Near Mint 1 421 147
-Legion of Super-Heroes (vol. 3) 9 Near Mint 1 422 147
-Legion of Super-Heroes (vol. 3) 10 Near Mint 1 423 147
-Legion of Super-Heroes (vol. 3) 11 Near Mint 1 424 147
-Legion of Super-Heroes (vol. 3) 13 Near Mint 2 425 147
-Legion of Super-Heroes (vol. 3) 19 Near Mint 1 426 147
-Legion of Super-Heroes (vol. 3) 20 Near Mint 1 427 147
-Legion of Super-Heroes (vol. 3) 25 Near Mint 1 428 147
-Legion of Super-Heroes (vol. 3) 26 Near Mint 1 429 147
-Legion of Super-Heroes (vol. 3) 27 Near Mint 1 430 147
-Legion of Super-Heroes (vol. 3) 28 Near Mint 1 431 147
-Legion of Super-Heroes (vol. 3) 40 Near Mint 1 432 147
-Legion of Super-Heroes (vol. 3) 41 Near Mint 1 433 147
-Legion of Super-Heroes (vol. 3) 42 Near Mint 1 434 147
-Legion of Super-Heroes (vol. 3) 43 Near Mint 1 435 147
-Legion of Super-Heroes (vol. 3) 44 Near Mint 1 436 147
-Kamandi at Earth's End 1 Near Mint 1 180 44
-Kamandi at Earth's End 2 Near Mint 1 181 44
-Kid Eternity (mini-series) 1 Near Mint 1 182 45
-Kid Eternity (mini-series) 2 Near Mint 1 183 45
-Kid Eternity (mini-series) 3 Near Mint 1 184 45
-Armageddon Inferno 4 Near Mint 1 185 46
-Armageddon 2001 1 Near Mint 1 186 47
-Armageddon 2001 2 Near Mint 1 187 47
-Blackhawk 1 Near Mint 1 188 48
-Blackhawk 2 Near Mint 1 189 48
-Blackhawk 3 Near Mint 1 190 48
-Darkstars 1 Near Mint 2 191 3
-Darkstars 20 Near Mint 1 192 3
-Darkstars 21 Near Mint 1 193 3
-Death, The High Cost of Living 1 Near Mint 1 194 23
-Death, The High Cost of Living 2 Near Mint 1 195 23
-Green Lantern (vol. 2) 44 Trinity Near Mint Part 2 1 196 49
-Green Lantern (vol. 2) 45 Trinity Near Mint Part 5 1 197 49
-Green Lantern (vol. 2) 46 Reign of the Supermen Near Mint 1 198 49
-World of Krypton 1 Near Mint 1 199 50
-World of Krypton 2 Near Mint 1 200 50
-World of Krypton 3 Near Mint 1 201 50
-World of Krypton 4 Near Mint 1 202 50
-Action Comics (Annual) 5 Near Mint 1 203 258
-Action Comics (Annual) 6 Near Mint 1 204 258
-Giant Size Man-Thing 5 Near Mint 1 205 52
-Green Lantern (vol. 2) 1 Near Mint 1 206 49
-Green Lantern (vol. 2) 2 Near Mint 1 207 49
-Green Lantern (vol. 2) 3 Near Mint 1 208 49
-Green Lantern (vol. 2) 4 Near Mint 1 209 49
-Green Lantern (vol. 2) 5 Near Mint 1 210 49
-Green Lantern (vol. 2) 6 Near Mint 1 211 49
-Green Lantern (vol. 2) 7 Near Mint 1 212 49
-Green Lantern (vol. 2) 8 Near Mint 1 213 49
-Green Lantern (vol. 2) 9 Near Mint 1 214 49
-Green Lantern (vol. 2) 10 Near Mint 1 215 49
-Green Lantern (vol. 2) 11 Near Mint 1 216 49
-Green Lantern (vol. 2) 12 Near Mint 1 217 49
-Green Lantern (vol. 2) 13 Near Mint 1 218 49
-Green Lantern (vol. 2) 14 Near Mint 1 219 49
-Green Lantern (vol. 2) 15 Near Mint 1 220 49
-Green Lantern (vol. 2) 16 Near Mint 1 221 49
-Green Lantern (vol. 2) 17 Near Mint 1 222 49
-Green Lantern (vol. 2) 18 Near Mint 1 223 49
-Green Lantern (vol. 2) 19 Near Mint 1 224 49
-Green Lantern (vol. 2) 20 Near Mint 1 225 49
-Green Lantern (vol. 2) 21 Near Mint 1 226 49
-Green Lantern (vol. 2) 22 Near Mint 1 227 49
-Green Lantern (vol. 2) 23 Near Mint 1 228 49
-Green Lantern (vol. 2) 24 Near Mint 1 229 49
-Legends 2 Near Mint 1 230 53
-Legends 4 Near Mint 1 231 53
-Legends 5 Near Mint 1 232 53
-Superman, The Man of Steel (Annual) 2 Near Mint 1 233 55
-Superman, The Man of Steel (Annual) 3 Near Mint 1 234 55
-Action Comics 583 Near Mint Last Superman Story by Alan Moore 1 235 142
-Action Comics 664 Time and Time Again Near Mint Phase 5 1 236 142
-Superman, The Adventures of 424 Near Mint 1 237 51
-Superman (vol. 2) 1 Near Mint 1 238 165
-Superman (vol. 2) 57 Near Mint Krypton Man 1 239 165
-Superman (vol. 2) (Annual) 1 Near Mint 1 240 166
-Superman (vol. 2) (Annual) 2 Near Mint Cadmus/Newsboy Legion 1 241 166
-Superman (vol. 2) (Annual) 5 Near Mint 1 242 166
-Supergirl and Team Luthor 1 Near Mint 1 243 56
-Adam Strange 1 Near Mint 1 244 57
-Adam Strange 2 Near Mint 1 245 57
-Adam Strange 3 Near Mint 1 246 57
-Akira 1 Near Mint 1 247 58
-Akira 2 Near Mint 1 248 58
-Akira 3 Near Mint 1 249 58
-Akira 4 Near Mint 1 250 58
-Akira 5 Near Mint 1 251 58
-Akira 6 Near Mint 1 252 58
-Akira 7 Near Mint 1 253 58
-Akira 8 Near Mint 1 254 58
-Akira 9 Near Mint 1 255 58
-Akira 10 Near Mint 1 256 58
-Akira 11 Near Mint 1 257 58
-Akira 12 Near Mint 1 258 58
-Akira 13 Near Mint 1 259 58
-Akira 14 Near Mint 1 260 58
-Akira 15 Near Mint 1 261 58
-Akira 16 Near Mint Second copy very fine 2 262 58
-Akira 17 Near Mint 1 263 58
-Akira 18 Near Mint 1 264 58
-Static 1 Near Mint Collector's Edition 1 1 33
-Static 2 Near Mint 1 2 33
-Static 3 Near Mint 1 3 33
-Static 4 Near Mint 1 4 33
-Darkstars 2 Near Mint 1 5 3
-Darkstars 3 Near Mint 1 6 3
-Darkstars 4 Near Mint 1 7 3
-Darkstars 5 Near Mint 1 8 3
-Darkstars 6 Near Mint 1 9 3
-Darkstars 7 Near Mint 1 10 3
-Darkstars 8 Near Mint 1 11 3
-Darkstars 9 Near Mint 1 12 3
-Darkstars 10 Near Mint 1 13 3
-Darkstars 11 Trinity Near Mint Part 4 1 14 3
-Darkstars 12 Trinity Near Mint Part 7 1 15 3
-Secret City Saga 0 Near Mint 2 16 4
-Darker Image 1 Near Mint 1 17 5
-Sebastian O 1 Near Mint 1 18 37
-Sebastian O 2 Near Mint 1 19 37
-Sebastian O 3 Near Mint 1 20 37
-Captain Glory 1 Near Mint 1 21 7
-Night Glider 1 Near Mint 1 22 8
-Spider-Man 2099 7 Near Mint 1 23 9
-Spider-Man 2099 8 Near Mint 1 24 9
-1963 1 Near Mint 1 25 39
-1963 2 Near Mint 1 26 39
-1963 3 Near Mint 1 27 39
-1963 4 Near Mint 1 28 39
-1963 5 Near Mint 1 29 39
-1963 6 Near Mint 1 30 39
-Sandman 48 Near Mint 1 31 10
-Sandman 49 Near Mint 1 32 10
-Sandman 50 Near Mint 1 33 10
-Sandman 51 Near Mint 1 34 10
-Sandman 52 Near Mint 1 35 10
-Sandman 53 Near Mint 1 36 10
-Sandman 54 Near Mint 1 37 10
-Legionnaires 1 Near Mint 2 38 11
-Justice League America 72 Near Mint 1 39 12
-Justice League America 73 Near Mint 1 40 12
-Justice League America 74 Near Mint 1 41 12
-Justice League America 75 Near Mint 1 42 12
-Justice League America 76 Near Mint 1 43 12
-Justice League America 77 Near Mint 1 44 12
-Justice League America 78 Near Mint 1 45 12
-Justice League America 79 Near Mint 1 46 12
-Valor 6 Near Mint 1 47 13
-Valor 7 Near Mint 1 48 13
-Valor 8 Near Mint 1 49 13
-Valor 9 Near Mint 1 50 13
-Valor 10 Near Mint 1 51 13
-Valor 11 Near Mint 1 52 13
-Valor 12 D.O.A. Near Mint Part 1 1 53 13
-Bombast 1 Near Mint 1 54 14
-Hellblazer 63 Near Mint 1 55 15
-Hellblazer 64 Near Mint 1 56 15
-Hellblazer 65 Near Mint 1 57 15
-Hellblazer 66 Near Mint 1 58 15
-Hellblazer 67 Near Mint 1 59 15
-Hellblazer 68 Near Mint 1 60 15
-Hellblazer 69 Near Mint 1 61 15
-Hellblazer 70 Near Mint 1 62 15
-Hellblazer 71 Near Mint 1 63 15
-Hellblazer 72 Near Mint 1 64 15
-Satan's Six 1 Near Mint 1 65 281
-Satan's Six 2 Near Mint 1 66 281
-Kid Eternity 1 Near Mint 1 67 16
-Kid Eternity 2 Near Mint 1 68 16
-Icon 1 Near Mint one newsstand, one collector's edition 2 69 17
-Icon 2 Near Mint 1 70 17
-Icon 3 Near Mint 1 71 17
-Icon 4 Near Mint 1 72 17
-Icon 5 Near Mint 1 73 17
-Icon 6 Near Mint 1 74 17
-Action Comics 687 Reign of the Supermen Near Mint 1 75 142
-Action Comics 688 Reign of the Supermen Near Mint 1 76 142
-Action Comics 689 Reign of the Supermen Near Mint 1 77 142
-Action Comics 690 Reign of the Supermen Near Mint 1 78 142
-Action Comics 691 Reign of the Supermen Near Mint 1 79 142
-Superman (vol. 2) 78 Reign of the Supermen Near Mint 1 80 165
-Superman (vol. 2) 79 Reign of the Supermen Near Mint 1 81 165
-Superman (vol. 2) 80 Reign of the Supermen Near Mint 1 82 165
-Superman (vol. 2) 81 Reign of the Supermen Near Mint 1 83 165
-Superman (vol. 2) 82 Reign of the Supermen Near Mint one newstand, one collector's edition 2 84 165
-Superman, The Man of Steel 22 Reign of the Supermen Near Mint 1 85 18
-Superman, The Man of Steel 23 Reign of the Supermen Near Mint 1 86 18
-Superman, The Man of Steel 24 Reign of the Supermen Near Mint 1 87 18
-Superman, The Man of Steel 25 Reign of the Supermen Near Mint 1 88 18
-Superman, The Man of Steel 26 Reign of the Supermen Near Mint 1 89 18
-Hepcats 7 Near Mint 1 90 19
-Action Comics 643 Near Mint 1 91 142
-Sandman Mystery Theatre 1 Near Mint 1 92 20
-Sandman Mystery Theatre 2 Near Mint 1 93 20
-Sandman Mystery Theatre 3 Near Mint 1 94 20
-Sandman Mystery Theatre 4 Near Mint 1 95 20
-Omac 1 Near Mint Kirby 1 592 111
-Ragman 1 Near Mint 1 593 94
-Ragman 2 Near Mint 1 594 94
-Ragman 3 Near Mint 1 595 94
-Ragman 4 Near Mint 1 596 94
-Ragman 5 Near Mint 1 597 94
-Ragman 6 Near Mint 1 598 94
-Ragman 7 Near Mint 1 599 94
-Ragman 8 Near Mint 1 600 94
-Sandman 19 Near Mint 1 601 10
-Sandman 20 Near Mint 1 602 10
-Sandman 21 Near Mint 1 603 10
-Sandman 22 Near Mint 1 604 10
-Sandman 23 Near Mint 1 605 10
-Sandman 24 Near Mint 1 606 10
-Sandman 25 Near Mint 1 607 10
-Sandman 26 Near Mint 1 608 10
-Sandman 27 Near Mint 1 609 10
-Sandman 28 Near Mint 1 610 10
-Sandman 29 Near Mint 1 611 10
-Sandman 30 Near Mint 1 612 10
-Sandman 31 Near Mint 1 613 10
-Sandman 32 Near Mint 1 614 10
-Sandman 33 Near Mint 1 615 10
-Sandman 34 Near Mint 1 616 10
-Sandman 35 Near Mint 1 617 10
-Sandman 36 Near Mint 1 618 10
-Sandman 37 Near Mint 1 619 10
-Sandman 38 Near Mint 1 620 10
-Sandman 39 Near Mint 1 621 10
-Sandman 40 Near Mint 1 622 10
-Sandman 41 Near Mint 1 623 10
-Sandman 42 Near Mint 1 624 10
-Sandman 43 Near Mint 1 625 10
-Sandman 44 Near Mint 1 626 10
-Sandman 45 Near Mint 1 627 10
-Secrets of the Legion of Super-Heroes 1 Near Mint 2 628 36
-Secrets of the Legion of Super-Heroes 2 Near Mint 2 629 36
-The Shadow (1987) 1 Near Mint 2 630 96
-The Shadow (1987) 2 Near Mint 1 631 96
-The Shadow (1987) 3 Near Mint 1 632 96
-The Shadow (1987) 4 Near Mint 1 633 96
-The Shadow (1987) 5 Near Mint 1 634 96
-The Shadow (1987) 6 Near Mint 1 635 96
-The Shadow (1987) 7 Near Mint Kyle Baker 1 636 96
-The Shadow (1987) 8 Near Mint Kyle Baker 1 637 96
-The Shadow (1987) 9 Near Mint Kyle Baker 1 638 96
-The Shadow (1987) 10 Near Mint Kyle Baker 1 639 96
-The Shadow (1987) 11 Near Mint Kyle Baker 1 640 96
-The Shadow (1987) 12 Near Mint Kyle Baker 1 641 96
-The Shadow (1987) 13 Near Mint Kyle Baker 1 642 96
-The Shadow (1987) 14 Near Mint Kyle Baker 1 643 96
-The Shadow (1987) 15 Near Mint Kyle Baker 1 644 96
-The Shadow (1987) 16 Near Mint Kyle Baker 1 645 96
-The Shadow (1987) 17 Near Mint Kyle Baker 1 646 96
-The Shadow (1987) 18 Near Mint Kyle Baker 1 647 96
-The Shadow (1987) 19 Near Mint Kyle Baker 1 648 96
-The Shadow (1987) 1 Near Mint 1 649 96
-Shadow Stikes, The 14 Near Mint 1 650 133
-Shadow Stikes, The 15 Near Mint 1 651 133
-Shadow Stikes, The 16 Near Mint 1 652 133
-Shadow Stikes, The 17 Near Mint 1 653 133
-Shadow Stikes, The 18 Near Mint 1 654 133
-Shadow Stikes, The 19 Near Mint 1 655 133
-Shadow Stikes, The 20 Near Mint 1 656 133
-Shadow Stikes, The 21 Near Mint 1 657 133
-Shadow Stikes, The 22 Near Mint 1 658 133
-Shadow Stikes, The 23 Near Mint 1 659 133
-Shadow Stikes, The 24 Near Mint 1 660 133
-Shadow Stikes, The 25 Near Mint 1 661 133
-Shadow Stikes, The 26 Near Mint 1 662 133
-Shadow Stikes, The 27 Near Mint 1 663 133
-Shadow Stikes, The 28 Near Mint 1 664 133
-Shadow Stikes, The 29 Near Mint 1 665 133
-Shadow Stikes, The 30 Near Mint 1 666 133
-Shadow Stikes, The 31 Near Mint 1 667 133
-Shadow, The (mini-series) 3 Near Mint 1 668 95
-Shadow, The (mini-series) 4 Near Mint 1 669 95
-Showcase '93 1 Near Mint 1 670 97
-DC Silver Age Classics Adventure 247 1 Near Mint 1 671 98
-DC Silver Age Classics Adventure Comics 247 Near Mint 1 672 98
-DC Silver Age Classics The Brave And The Bold 28 Near Mint 1 673 99
-Spawn 1 Near Mint 1 674 30
-Spawn 2 Near Mint 1 675 30
-Spawn 3 Near Mint 1 676 30
-Spawn 4 Near Mint 1 677 30
-Spawn 5 Near Mint 1 678 30
-Spectre, The (vol. 3) 1 Near Mint 1 679 294
-Spider-Man 2099 1 Near Mint 1 680 9
-Spider-Man 2099 2 Near Mint 1 681 9
-Spider-Man 2099 3 Near Mint 1 682 9
-Spider-Man 2099 4 Near Mint 1 683 9
-Superman (vol. 2) 2 Near Mint 1 684 165
-Superman (vol. 2) 3 Near Mint 1 685 165
-Superman (vol. 2) 8 Near Mint 1 686 165
-Superman (vol. 2) 21 Near Mint 1 687 165
-Superman (vol. 2) 65 Panic in the Sky Near Mint Second Strike 1 688 165
-Superman (vol. 2) 66 Panic in the Sky Near Mint Final Strike 1 689 165
-Superman (vol. 2) 74 Near Mint 1 690 165
-Superman (vol. 2) 75 Near Mint One newstand, one collector's edition 2 691 165
-Superman Special 1 Near Mint 1 692 100
-Superman, The Man of Steel 9 Panic in the Sky Near Mint First Strike 1 693 18
-Superman, The Man of Steel 10 Panic in the Sky Near Mint Fifth Strike 1 694 18
-Superman, The Man of Steel 17 Near Mint Second Printing 1 695 18
-Superman, The Man of Steel 18 Near Mint 1 696 18
-Superman, The Man of Steel 19 Near Mint 1 697 18
-Valor 1 Near Mint 1 698 13
-Valor 2 Near Mint 1 699 13
-Valor 3 Near Mint 1 700 13
-Weird Science Fantasy (Reprint) 1 Near Mint 1 701 101
-Weird Fantasy (Reprint) 1 Near Mint 1 702 102
-WildC.A.T.S. 1 Near Mint 2 703 103
-Spectacular Spider-Man, The 158 Near Mint 1 704 105
-Musings 1 Near Mint Fanzine about Sandman 1 705 106
-Swamp Thing (Vol. 2) 22 Near Mint 1 706 107
-Swamp Thing (Vol. 2) 23 Near Mint 1 707 107
-Swamp Thing (Vol. 2) 24 Near Mint 1 708 107
-Swamp Thing (Vol. 2) 25 Near Mint 1 709 107
-Video Jack 1 Near Mint Giffen 1 710 108
-Video Jack 2 Near Mint Giffen 1 711 108
-Wanderers, The 1 Near Mint 1 712 109
-Wanderers, The 2 Near Mint 1 713 109
-Wanderers, The 3 Near Mint 1 714 109
-Wanderers, The 4 Near Mint 1 715 109
-Sandman (Vol. 1) 1 Near Mint Kirby, Simon 1 716 110
-Sandman (Vol. 1) 2 Near Mint Kirby cover 1 717 110
-Sandman (Vol. 1) 3 Near Mint Kirby cover 1 718 110
-Sandman (Vol. 1) 4 Near Mint Kirby 1 719 110
-Sandman (Vol. 1) 5 Near Mint Kirby 1 720 110
-Sandman (Vol. 1) 6 Near Mint Kirby 1 721 110
-Omac (mini-series) 1 Near Mint Byrne 1 722 93
-Omac (mini-series) 2 Near Mint Byrne 1 723 93
-Omac (mini-series) 3 Near Mint Byrne 1 724 93
-Omac (mini-series) 4 Near Mint Byrne 1 725 93
-Omac 4 Near Mint Kirby 1 726 111
-Omac 7 Near Mint Kirby 1 727 111
-Omac 8 Near Mint Kirby 1 728 111
-Vertigo Jam 1 Near Mint 1 729 112
-Cerebus 112 Near Mint 112 and 113 were published as one issue 1 730 123
-Cerebus 113 Near Mint 112 and 113 were published as one issue 1 731 123
-Cerebus 114 Jaka's Story Near Mint 1 732 123
-Cerebus 115 Jaka's Story Near Mint 1 733 123
-Cerebus 116 Jaka's Story Near Mint 1 734 123
-Cerebus 117 Jaka's Story Near Mint 1 735 123
-Cerebus 118 Jaka's Story Near Mint 1 736 123
-Cerebus 119 Jaka's Story Near Mint 1 737 123
-Cerebus 120 Jaka's Story Near Mint 1 738 123
-Cerebus 121 Jaka's Story Near Mint 1 739 123
-Cerebus 122 Jaka's Story Near Mint 1 740 123
-Cerebus 123 Jaka's Story Near Mint 1 741 123
-Cerebus 124 Jaka's Story Near Mint 1 742 123
-Cerebus 125 Jaka's Story Near Mint 1 743 123
-Cerebus 126 Jaka's Story Near Mint 1 744 123
-Cerebus 127 Jaka's Story Near Mint 1 745 123
-Cerebus 128 Jaka's Story Near Mint 1 746 123
-Cerebus 129 Jaka's Story Near Mint 1 747 123
-Cerebus 130 Jaka's Story Near Mint 1 748 123
-Cerebus 131 Jaka's Story Near Mint 1 749 123
-Cerebus 132 Jaka's Story Near Mint 1 750 123
-Cerebus 133 Jaka's Story Near Mint 1 751 123
-Cerebus 134 Jaka's Story Near Mint 1 752 123
-Cerebus 135 Jaka's Story Near Mint 1 753 123
-Cerebus 136 Jaka's Story Near Mint 1 754 123
-Cerebus 137 Jaka's Story Near Mint Epilogue Part 1 1 755 123
-Cerebus 138 Jaka's Story Near Mint Epilogue Part 2 1 756 123
-Cerebus 139 Near Mint 1 757 123
-Cerebus 140 Near Mint 1 758 123
-Cerebus 141 Near Mint 1 759 123
-Cerebus 142 Near Mint 1 760 123
-Cerebus 143 Near Mint 1 761 123
-Cerebus 144 Near Mint 1 762 123
-Cerebus 145 Near Mint 1 763 123
-Cerebus 146 Near Mint 1 764 123
-Cerebus 147 Near Mint 1 765 123
-Cerebus 148 Near Mint 1 766 123
-Cerebus 149 Near Mint 1 767 123
-Cerebus 150 Near Mint 1 768 123
-Cerebus 151 Mother's and Daughter's Near Mint 1 769 123
-Cerebus 152 Mother's and Daughter's Near Mint 1 770 123
-Cerebus 153 Mother's and Daughter's Near Mint 1 771 123
-Cerebus 154 Mother's and Daughter's Near Mint 1 772 123
-Cerebus 155 Mother's and Daughter's Near Mint 1 773 123
-Cerebus 156 Mother's and Daughter's Near Mint 1 774 123
-Cerebus 157 Mother's and Daughter's Near Mint 1 775 123
-Cerebus 158 Mother's and Daughter's Near Mint 1 776 123
-World of Smallville 2 Near Mint 1 931 119
-Superman (vol. 2) 37 Near Mint 1 932 165
-Green Lantern (vol. 2) 49 Emerald Twilight Near Mint Part 2 1 933 49
-Green Lantern (vol. 2) 50 Emerald Twilight Near Mint Part 3 1 934 49
-Valor 17 D.O.A. Near Mint Part 6 1 935 13
-Superboy (vol. 2) 2 Near Mint 1 936 120
-Steel 1 Near Mint 1 937 121
-Icon 10 Near Mint 1 938 17
-Static 9 Near Mint 1 939 33
-Static 10 Near Mint 1 940 33
-Static 11 Near Mint 1 941 33
-Static 12 Near Mint 1 942 33
-Superman, The Adventures of (Annual) 2 Near Mint L.E.G.I.O.N./Brainiac 1 943 122
-Cerebus Bi-weekly 1 Near Mint 1 944 124
-Cerebus Bi-weekly 3 Near Mint 1 945 124
-Cerebus, Free 1 Near Mint 1 946 125
-Cerebus High Society 1 Near Mint 1 947 126
-Cerebus High Society 2 Near Mint 1 948 126
-Cerebus High Society 3 Near Mint 1 949 126
-Cerebus High Society 4 Near Mint 1 950 126
-Cerebus High Society 5 Near Mint 1 951 126
-Cerebus High Society 6 Near Mint 1 952 126
-Cerebus High Society 7 Near Mint 1 953 126
-Demon, The (vol. 2) 11 Near Mint 1 954 127
-Demon, The (vol. 2) 14 Near Mint 1 955 127
-Lobo 1 Near Mint 1 956 128
-Lobo 2 Near Mint 1 957 128
-Lobo 3 Near Mint 1 958 128
-Lobo 4 Near Mint 1 959 128
-Power Pack Holiday Special 1 Near Mint 1 960 129
-Sandman 1 Near Mint 1 961 10
-Sandman 17 Near Mint 1 962 10
-Sandman Special 1 Near Mint 1 963 130
-Shade, The Changing Man 5 Near Mint 1 964 446
-Shade, The Changing Man 6 Near Mint 1 965 446
-Shade, The Changing Man 7 Near Mint 1 966 446
-Shadow, The (Annual) 1 Near Mint 1 967 131
-Shadow, The (Annual) 2 Near Mint Kyle Baker 1 968 131
-Shadow Stikes, The 1 Near Mint 1 969 133
-Shadow Stikes, The 4 Near Mint 1 970 133
-Shadow Stikes, The 6 Near Mint 1 971 133
-Shadow Stikes, The 7 Near Mint 1 972 133
-Shadow Stikes, The 8 Near Mint 1 973 133
-Shadow Stikes, The 9 Near Mint 1 974 133
-Doom Patrol 34 Near Mint 2 975 252
-Suicide Squad 47 Near Mint 1 976 132
-Suicide Squad 48 Near Mint 1 977 132
-Suicide Squad 49 Near Mint 1 978 132
-Suicide Squad 50 Near Mint 1 979 132
-Suicide Squad 51 Near Mint 1 980 132
-Suicide Squad 52 Near Mint 1 981 132
-Suicide Squad 53 Dragon's Hoard Near Mint 1 982 132
-Suicide Squad 54 Dragon's Hoard Near Mint 1 983 132
-Destroyer Duck 4 Near Mint Kirby 1 984 81
-Destroyer Duck 5 Near Mint Kirby 1 985 81
-1st Issue Special 6 Near Mint Kirby, Dingbats 1 986 134
-Demon, The (vol. 1) 1 Near Mint Kirby 1 987 135
-Superman's Pal Jimmy Olsen 137 Near Mint Kirby 1 988 82
-Superman's Pal Jimmy Olsen 138 Near Mint Kirby 1 989 82
-Superman's Pal Jimmy Olsen 139 Near Mint Kirby 1 990 82
-Superman's Pal Jimmy Olsen 141 Near Mint Kirby, Don Rickles photo cover 1 991 82
-Forever People 6 Near Mint Kirby 1 992 136
-Forever People 10 Near Mint Kirby, one copy is reading quality 2 993 136
-Forever People 11 Near Mint Kirby 1 994 136
-Kamandi 7 Near Mint Kirby 1 995 72
-Kamandi 8 Near Mint Kirby 1 996 72
-Kamandi 17 Near Mint Kirby 1 997 72
-Kamandi 18 Near Mint Kirby 2 998 72
-Kamandi 19 Near Mint Kirby 1 999 72
-Kamandi 20 Near Mint Kirby 1 1000 72
-Kamandi 21 Near Mint Kirby 1 1001 72
-Kamandi 22 Near Mint Kirby 1 1002 72
-Kamandi 25 Near Mint Kirby 1 1003 72
-Kamandi 26 Near Mint Kirby 1 1004 72
-Kamandi 27 Near Mint Kirby 1 1005 72
-Kamandi 29 Near Mint Kirby 1 1006 72
-2001: A Space Odyssey 1 Near Mint Kirby 1 1007 137
-DC Comics Presents 84 Near Mint 1 1008 138
-Shade, The Changing Man 19 Near Mint 1 1009 446
-Buck Godot, Zap Gun for Hire 1 Near Mint 1 1010 139
-E-Man (vol 3.) 1 Near Mint 1 1011 140
-Blue Devil 2 Near Mint 1 1012 141
-Blue Devil 3 Near Mint 1 1013 141
-Blue Devil 4 Near Mint 1 1014 141
-Blue Devil 5 Near Mint 1 1015 141
-Blue Devil 6 Near Mint 1 1016 141
-Blue Devil 7 Near Mint 1 1017 141
-Blue Devil 8 Near Mint 1 1018 141
-Blue Devil 9 Near Mint 1 1019 141
-Blue Devil 10 Near Mint 1 1020 141
-Blue Devil 11 Near Mint 1 1021 141
-Blue Devil 12 Near Mint 1 1022 141
-Blue Devil 13 Near Mint 1 1023 141
-Blue Devil 14 Near Mint 1 1024 141
-Blue Devil 15 Near Mint 1 1025 141
-Blue Devil 16 Near Mint 1 1026 141
-Blue Devil 17 Near Mint 1 1027 141
-Blue Devil 18 Near Mint 1 1028 141
-Blue Devil 19 Near Mint 1 1029 141
-Blue Devil 20 Near Mint 1 1030 141
-Blue Devil 24 Near Mint 1 1031 141
-Blue Devil 25 Near Mint 1 1032 141
-Blue Devil 26 Near Mint 1 1033 141
-Blue Devil 28 Near Mint 1 1034 141
-Superman, The Man of Steel 1 Near Mint 1 1035 18
-Superman, The Man of Steel 2 Near Mint 1 1036 18
-Superman, The Man of Steel 3 War of the Gods Near Mint 1 1037 18
-Superman, The Man of Steel 4 Near Mint 1 1038 18
-Superman, The Man of Steel 5 Near Mint 1 1039 18
-Superman, The Man of Steel 13 Near Mint 1 1040 18
-Hellblazer 30 Near Mint 1 1041 15
-Hellblazer 50 Near Mint 1 1042 15
-Animal Man 53 Near Mint 1 1043 59
-Action Comics 654 Dark Knight over Metropolis Near Mint Part 3 1 1044 142
-Secret Origins (vol. 2) 10 Reading Alan Moore, Phantom Stranger 1 1045 143
-Timber Wolf 3 Near Mint 1 1046 144
-Timber Wolf 4 Near Mint 1 1047 144
-Timber Wolf 5 Near Mint 1 1048 144
-Legion of Super-Heroes (vol. 3) 15 Near Mint 2 1049 147
-Legion of Super-Heroes (vol. 3) 37 Near Mint 1 1050 147
-Boy Commandos (Reprint) 2 Near Mint 1 1051 149
-Black Lightning 1 Near Mint 1 1052 150
-Bloodshot 1 Near Mint 1 1053 151
-Magneto 0 Near Mint 1 1054 152
-Black Magic (Reprint) 1 Near Mint 1 1055 153
-Captain America 193 Near Mint Kirby 1 1056 154
-Captain America 194 Near Mint Kirby 1 1057 154
-Captain America 195 Near Mint Kirby 1 1058 154
-Captain America 196 Near Mint Kirby 1 1059 154
-Captain America 197 Near Mint Kirby 1 1060 154
-Captain America 198 Near Mint Kirby 1 1061 154
-Captain America 199 Near Mint Kirby 1 1062 154
-Captain America 208 Near Mint Kirby 1 1063 154
-Captain America 209 Near Mint Kirby 1 1064 154
-Captain America 210 Near Mint Kirby 1 1065 154
-Captain America 211 Near Mint Kirby 1 1066 154
-Captain America 212 Near Mint Kirby 1 1067 154
-Phantom Force 0 Near Mint 1 1068 155
-Phantom Force 1 Near Mint 1 1069 155
-Phantom Force 2 Near Mint 1 1070 155
-Phantom Force 3 Near Mint 1 1071 155
-Phantom Force 4 Near Mint 1 1072 155
-Gilgamesh 1 Near Mint 1 1073 156
-Gilgamesh 3 Near Mint 1 1074 156
-Gilgamesh 4 Near Mint 1 1075 156
-Demon, The (vol. 1) 8 Near Mint Kirby 1 1076 135
-Curse of the Weird 2 Near Mint 1 1077 157
-Curse of the Weird 3 Near Mint 1 1078 157
-Curse of the Weird 4 Near Mint 1 1079 157
-Monster Menace 2 Near Mint 1 1080 158
-Monster Menace 3 Near Mint 1 1081 158
-Cerebus 55 Near Mint 1 1082 123
-Black Orchid (Annual) 1 Near Mint 1 1083 159
-Scarab 1 Near Mint 1 1084 160
-Scarab 2 Near Mint 1 1085 160
-Scarab 3 Near Mint 1 1086 160
-Beautiful Stories for Ugly Children 27 Near Mint 1 1087 161
-Super Powers (vol. 3) 1 Near Mint 1 1088 295
-Super Powers (vol. 2) 4 Near Mint 1 1089 162
-Super Powers (vol. 2) 6 Near Mint 1 1090 162
-Video Jack 5 Near Mint Giffen 1 1091 108
-Children's Crusade, The 2 Near Mint 1 1092 163
-Miracle Man 3D 1 Near Mint 1 1093 164
-Superman (vol. 1) (Annual) 11 Near Mint 1 1094 54
-Cages 1 Near Mint 1 1095 167
-Big Numbers 1 Near Mint 1 1096 168
-Big Numbers 2 Near Mint 1 1097 168
-Hard Boiled 1 Near Mint Frank Miller/Geoff Darrow 1 1098 169
-Hard Boiled 2 Near Mint Frank Miller/Geoff Darrow 1 1099 169
-Hard Boiled 3 Near Mint Frank Miller/Geoff Darrow 1 1100 169
-Action Comics 384 Near Mint 1 1101 142
-Cerebus 159 Mother's and Daughter's Near Mint 1 777 123
-Cerebus 160 Mother's and Daughter's Near Mint 1 778 123
-Cerebus 161 Mother's and Daughter's Near Mint 1 779 123
-Cerebus 162 Mother's and Daughter's Near Mint 1 780 123
-Cerebus 163 Mother's and Daughter's Near Mint 1 781 123
-Cerebus 164 Mother's and Daughter's Near Mint 1 782 123
-Cerebus 165 Mother's and Daughter's Near Mint 1 783 123
-Cerebus 166 Mother's and Daughter's Near Mint 1 784 123
-Cerebus 167 Mother's and Daughter's Near Mint 1 785 123
-Cerebus 168 Mother's and Daughter's Near Mint 1 786 123
-Cerebus 169 Mother's and Daughter's Near Mint 1 787 123
-Cerebus 170 Mother's and Daughter's Near Mint 1 788 123
-Cerebus 171 Mother's and Daughter's Near Mint 1 789 123
-Cerebus 172 Mother's and Daughter's Near Mint 1 790 123
-Eclipso Special 1 Near Mint 1 791 113
-Eclipso Special 2 Near Mint 1 792 113
-Superman, The Adventures of 477 Time and Time Again Near Mint Phase 4 1 793 51
-Superman, The Adventures of 478 Time and Time Again Near Mint Phase 7 1 794 51
-Superman, The Adventures of 488 Panic in the Sky Near Mint Third Strike 1 795 51
-Superman, The Adventures of 489 Panic in the Sky Near Mint Epilogue 1 796 51
-Superman, The Adventures of 495 Near Mint Forever People 1 797 51
-Superman, The Adventures of 496 Near Mint 1 798 51
-Superman, The Adventures of 497 Near Mint 1 799 51
-Superman, The Adventures of 498 Funeral For a Friend Near Mint Part 1 1 800 51
-Miracle Man 24 Near Mint 1 801 92
-Jonah Hex, Two Gun Mojo 1 Near Mint 1 802 79
-Jonah Hex, Two Gun Mojo 2 Near Mint 1 803 79
-Jonah Hex, Two Gun Mojo 3 Near Mint 1 804 79
-Jonah Hex, Two Gun Mojo 4 Near Mint 1 805 79
-Jonah Hex, Two Gun Mojo 5 Near Mint 1 806 79
-Legends 1 Near Mint 2 807 53
-Action Comics 599 Near Mint 1 808 142
-Superman, The Adventures of 427 Near Mint 1 809 51
-Superman, The Adventures of 428 Near Mint 2 810 51
-Superman, The Adventures of 429 Near Mint 1 811 51
-Superman, The Adventures of 437 Near Mint 1 812 51
-Superman, The Adventures of 439 Near Mint 1 813 51
-Superman, The Adventures of 443 Near Mint 1 814 51
-Stray Toasters 1 Near Mint 1 815 114
-Stray Toasters 3 Near Mint 1 816 114
-Legion of Super-Heroes (vol. 3) 1 Near Mint 1 817 147
-Legion of Super-Heroes (vol. 2) 214 Near Mint 1 818 115
-Legion of Super-Heroes (vol. 2) 215 Near Mint 1 819 115
-Legion of Super-Heroes (vol. 2) 216 Near Mint 1 820 115
-Legion of Super-Heroes (vol. 2) 217 Near Mint 1 821 115
-Legion of Super-Heroes (vol. 2) 218 Near Mint 1 822 115
-Legion of Super-Heroes (vol. 2) 219 Near Mint 1 823 115
-Legion of Super-Heroes (vol. 2) 220 Near Mint 1 824 115
-Legion of Super-Heroes (vol. 2) 221 Near Mint 1 825 115
-Legion of Super-Heroes (vol. 2) 222 Near Mint 1 826 115
-Legion of Super-Heroes (vol. 2) 223 Near Mint 1 827 115
-Legion of Super-Heroes (vol. 2) 224 Near Mint 1 828 115
-Legion of Super-Heroes (vol. 2) 225 Near Mint 1 829 115
-Legion of Super-Heroes (vol. 2) 227 Near Mint 1 830 115
-Legion of Super-Heroes (vol. 2) 228 Near Mint 1 831 115
-Legion of Super-Heroes (vol. 2) 229 Near Mint 1 832 115
-Legion of Super-Heroes (vol. 2) 230 Near Mint 1 833 115
-Legion of Super-Heroes (vol. 2) 232 Near Mint 1 834 115
-Legion of Super-Heroes (vol. 2) 233 Near Mint 1 835 115
-Legion of Super-Heroes (vol. 2) 235 Near Mint 1 836 115
-Legion of Super-Heroes (vol. 2) 236 Near Mint 1 837 115
-Legion of Super-Heroes (vol. 2) 237 Near Mint 1 838 115
-Legion of Super-Heroes (vol. 2) 238 Near Mint 1 839 115
-Legion of Super-Heroes (vol. 2) 239 Near Mint 1 840 115
-Legion of Super-Heroes (vol. 2) 240 Near Mint 1 841 115
-Legion of Super-Heroes (vol. 2) 241 Near Mint 1 842 115
-Legion of Super-Heroes (vol. 2) 242 Near Mint 1 843 115
-Legion of Super-Heroes (vol. 2) 243 Near Mint 1 844 115
-Legion of Super-Heroes (vol. 2) 244 Near Mint 1 845 115
-Legion of Super-Heroes (vol. 2) 245 Near Mint 1 846 115
-Legion of Super-Heroes (vol. 2) 246 Near Mint 1 847 115
-Legion of Super-Heroes (vol. 2) 247 Near Mint 1 848 115
-Legion of Super-Heroes (vol. 2) 248 Near Mint 1 849 115
-Legion of Super-Heroes (vol. 2) 249 Near Mint 1 850 115
-Legion of Super-Heroes (vol. 2) 251 Near Mint 1 851 115
-Legion of Super-Heroes (vol. 2) 252 Near Mint 1 852 115
-Legion of Super-Heroes (vol. 2) 253 Near Mint 1 853 115
-Legion of Super-Heroes (vol. 2) 254 Near Mint 1 854 115
-Legion of Super-Heroes (vol. 2) 255 Near Mint 1 855 115
-Legion of Super-Heroes (vol. 2) 256 Near Mint 1 856 115
-Legion of Super-Heroes (vol. 2) 258 Near Mint 1 857 115
-Legion of Super-Heroes (vol. 2) 259 Near Mint 4 858 115
-Legion of Super-Heroes (vol. 2) 260 Near Mint 1 859 115
-Legion of Super-Heroes (vol. 2) 261 Near Mint 1 860 115
-Legion of Super-Heroes (vol. 2) 262 Near Mint 1 861 115
-Legion of Super-Heroes (vol. 2) 263 Near Mint 1 862 115
-Legion of Super-Heroes (vol. 2) 264 Near Mint 1 863 115
-Legion of Super-Heroes (vol. 2) 265 Near Mint 1 864 115
-Legion of Super-Heroes (vol. 2) 266 Near Mint 1 865 115
-Legion of Super-Heroes (vol. 2) 267 Near Mint 1 866 115
-Legion of Super-Heroes (vol. 2) 268 Near Mint 1 867 115
-Legion of Super-Heroes (vol. 2) 269 Near Mint 1 868 115
-Legion of Super-Heroes (vol. 2) 270 Near Mint 1 869 115
-Legion of Super-Heroes (vol. 2) 271 Near Mint 1 870 115
-Legion of Super-Heroes (vol. 2) 272 Near Mint 1 871 115
-Legion of Super-Heroes (vol. 2) 274 Near Mint 1 872 115
-Legion of Super-Heroes (vol. 2) 275 Near Mint 1 873 115
-Legion of Super-Heroes (vol. 2) 276 Near Mint 1 874 115
-Legion of Super-Heroes (vol. 2) 277 Near Mint 1 875 115
-Legion of Super-Heroes (vol. 2) 278 Near Mint 1 876 115
-Legion of Super-Heroes (vol. 2) 279 Near Mint 1 877 115
-Legion of Super-Heroes (vol. 2) 280 Near Mint 1 878 115
-Legion of Super-Heroes (vol. 2) 281 Near Mint 2 879 115
-Legion of Super-Heroes (vol. 2) 282 Near Mint 1 880 115
-Legion of Super-Heroes (vol. 2) 283 Near Mint 1 881 115
-Legion of Super-Heroes (vol. 2) 284 Near Mint 1 882 115
-Legion of Super-Heroes (vol. 2) 285 Near Mint 1 883 115
-Legion of Super-Heroes (vol. 2) 286 Near Mint 1 884 115
-Legion of Super-Heroes (vol. 2) 287 Near Mint 1 885 115
-Legion of Super-Heroes (vol. 2) 288 Near Mint 1 886 115
-Legion of Super-Heroes (vol. 2) 289 Near Mint 1 887 115
-Legion of Super-Heroes (vol. 2) 290 Near Mint 1 888 115
-Legion of Super-Heroes (vol. 2) 291 Near Mint 1 889 115
-Legion of Super-Heroes (vol. 2) 292 Near Mint 1 890 115
-Legion of Super-Heroes (vol. 2) 293 Near Mint 1 891 115
-Legion of Super-Heroes (vol. 2) 294 Near Mint 1 892 115
-Legion of Super-Heroes (vol. 2) 295 Near Mint 1 893 115
-Legion of Super-Heroes (vol. 2) 296 Near Mint 2 894 115
-Legion of Super-Heroes (vol. 2) 297 Near Mint 1 895 115
-Legion of Super-Heroes (vol. 2) 298 Near Mint 1 896 115
-Legion of Super-Heroes (vol. 2) 299 Near Mint 1 897 115
-Legion of Super-Heroes (vol. 2) 300 Near Mint 1 898 115
-Legion of Super-Heroes (vol. 2) 301 Near Mint 1 899 115
-Legion of Super-Heroes (vol. 2) 302 Near Mint 1 900 115
-Legion of Super-Heroes (vol. 2) 303 Near Mint 1 901 115
-Legion of Super-Heroes (vol. 2) 304 Near Mint 1 902 115
-Legion of Super-Heroes (vol. 2) 305 Near Mint 1 903 115
-Legion of Super-Heroes (vol. 2) 306 Near Mint 1 904 115
-Legion of Super-Heroes (vol. 2) 307 Near Mint 1 905 115
-Legion of Super-Heroes (vol. 2) 308 Near Mint 1 906 115
-Legion of Super-Heroes (vol. 2) 309 Near Mint 1 907 115
-Legion of Super-Heroes (vol. 2) 310 Near Mint 1 908 115
-Legion of Super-Heroes (vol. 2) 311 Near Mint 1 909 115
-Legion of Super-Heroes (vol. 2) 312 Near Mint 1 910 115
-Legion of Super-Heroes (vol. 2) 313 Near Mint 1 911 115
-Legion of Super-Heroes (vol. 2) 314 Near Mint 1 912 115
-Legion of Super-Heroes (vol. 2) 315 Near Mint 1 913 115
-Legion of Super-Heroes (vol. 2) (Annual) 1 Near Mint 1 914 116
-Legion of Super-Heroes (vol. 2) (Annual) 2 Near Mint 1 915 116
-Hellblazer 25 Near Mint 1 916 15
-Hellblazer 26 Near Mint 1 917 15
-Hellblazer (Annual) 1 Near Mint 1 918 117
-Shade, The Changing Man 33 Near Mint 1 919 446
-Shade, The Changing Man 35 Near Mint 1 920 446
-Shade, The Changing Man 36 Near Mint 1 921 446
-Animal Man 57 Near Mint 1 922 59
-Animal Man 58 Near Mint 1 923 59
-Animal Man 59 Near Mint 1 924 59
-World of Metropolis 2 Near Mint 1 925 118
-World of Metropolis 3 Near Mint 1 926 118
-World of Metropolis 4 Near Mint 1 927 118
-Superboy, The New Adventures of 50 Near Mint LSH appearance 1 928 148
-Kamandi 1 Near Mint Kirby 1 929 72
-World of Smallville 1 Near Mint 1 930 119
-Legion of Super-Heroes (vol. 3) 45 Near Mint 1 437 147
-Legion of Super-Heroes (vol. 3) 46 Near Mint 1 438 147
-Legion of Super-Heroes (vol. 3) 47 Near Mint 1 439 147
-Legion of Super-Heroes (vol. 3) 48 Near Mint 1 440 147
-Legion of Super-Heroes (vol. 3) 49 Near Mint 1 441 147
-Legion of Super-Heroes (vol. 3) 50 Near Mint 1 442 147
-Legion of Super-Heroes (vol. 3) 51 Near Mint 1 443 147
-Legion of Super-Heroes (vol. 3) 52 Near Mint 1 444 147
-Legion of Super-Heroes (vol. 3) 53 Near Mint 1 445 147
-Legion of Super-Heroes (vol. 3) 54 Near Mint 1 446 147
-Legion of Super-Heroes (vol. 3) 55 Near Mint 1 447 147
-Legion of Super-Heroes (vol. 3) 56 Near Mint 1 448 147
-Legion of Super-Heroes (vol. 3) 57 Near Mint 1 449 147
-Legion of Super-Heroes (vol. 3) 58 Near Mint 1 450 147
-Legion of Super-Heroes (vol. 3) 59 Near Mint 1 451 147
-Legion of Super-Heroes (vol. 3) 60 Near Mint 1 452 147
-Legion of Super-Heroes (vol. 3) 61 Near Mint 1 453 147
-Legion of Super-Heroes (vol. 3) 62 Near Mint 1 454 147
-Legion of Super-Heroes (vol. 3) 63 Near Mint 1 455 147
-Legion of Super-Heroes (vol. 3) (Annual) 1 Near Mint 1 456 292
-Crisis on Infinite Earths 1 Near Mint 1 457 74
-Crisis on Infinite Earths 2 Near Mint 1 458 74
-Crisis on Infinite Earths 3 Near Mint 1 459 74
-Crisis on Infinite Earths 4 Near Mint 1 460 74
-Crisis on Infinite Earths 8 Near Mint 1 461 74
-Crisis on Infinite Earths 11 Near Mint 1 462 74
-Legion of Super-Heroes (vol. 4) 1 Near Mint 1 463 145
-Legion of Super-Heroes (vol. 4) 2 Near Mint 1 464 145
-Legion of Super-Heroes (vol. 4) 3 Near Mint 1 465 145
-Legion of Super-Heroes (vol. 4) 4 Near Mint 1 466 145
-Legion of Super-Heroes (vol. 4) 5 Near Mint 1 467 145
-Legion of Super-Heroes (vol. 4) 6 Near Mint 1 468 145
-Legion of Super-Heroes (vol. 4) 7 Near Mint 1 469 145
-Legion of Super-Heroes (vol. 4) 8 Near Mint 1 470 145
-Legion of Super-Heroes (vol. 4) 9 Near Mint 1 471 145
-Legion of Super-Heroes (vol. 4) 10 Near Mint 1 472 145
-Legion of Super-Heroes (vol. 4) 11 Near Mint 1 473 145
-Legion of Super-Heroes (vol. 4) 12 Near Mint 1 474 145
-Legion of Super-Heroes (vol. 4) 13 Near Mint 1 475 145
-Legion of Super-Heroes (vol. 4) 14 Near Mint 1 476 145
-Legion of Super-Heroes (vol. 4) 15 Near Mint 1 477 145
-Legion of Super-Heroes (vol. 4) 16 Near Mint 1 478 145
-Legion of Super-Heroes (vol. 4) 17 Near Mint 1 479 145
-Legion of Super-Heroes (vol. 4) 18 Near Mint 1 480 145
-Legion of Super-Heroes (vol. 4) 19 Near Mint 1 481 145
-Legion of Super-Heroes (vol. 4) 20 Near Mint 1 482 145
-Legion of Super-Heroes (vol. 4) 21 Near Mint 1 483 145
-Legion of Super-Heroes (vol. 4) 22 Near Mint 1 484 145
-Legion of Super-Heroes (vol. 4) 23 Near Mint 1 485 145
-Legion of Super-Heroes (vol. 4) 24 Near Mint 1 486 145
-Legion of Super-Heroes (vol. 4) 25 Near Mint 1 487 145
-Legion of Super-Heroes (vol. 4) 26 Near Mint 1 488 145
-Legion of Super-Heroes (vol. 4) 27 Near Mint 1 489 145
-Legion of Super-Heroes (vol. 4) 28 Near Mint 1 490 145
-Legion of Super-Heroes (vol. 4) 29 Near Mint 1 491 145
-Legion of Super-Heroes (vol. 4) 30 Near Mint 1 492 145
-Legion of Super-Heroes (vol. 4) 31 Near Mint 1 493 145
-Legion of Super-Heroes (vol. 4) 32 Near Mint 1 494 145
-Legion of Super-Heroes (vol. 4) 33 Near Mint 1 495 145
-Legion of Super-Heroes (vol. 4) 34 Near Mint 1 496 145
-Legion of Super-Heroes (vol. 4) 35 Near Mint 1 497 145
-Legion of Super-Heroes (vol. 4) 36 Near Mint 1 498 145
-Legion of Super-Heroes (vol. 4) 37 Near Mint 1 499 145
-Legion of Super-Heroes (vol. 4) 38 Near Mint 1 500 145
-Legion of Super-Heroes (vol. 4) 39 Near Mint 1 501 145
-Legion of Super-Heroes (vol. 4) 40 Near Mint 1 502 145
-Legion of Super-Heroes (vol. 4) 41 Near Mint 1 503 145
-Legion of Super-Heroes (vol. 4) 42 Near Mint 1 504 145
-Legion of Super-Heroes (vol. 4) 43 Near Mint 1 505 145
-Legion of Super-Heroes (vol. 4) 44 Near Mint 1 506 145
-Legion of Super-Heroes (vol. 4) 45 Near Mint 1 507 145
-Legion of Super-Heroes (vol. 4) 46 Near Mint 1 508 145
-Legion of Super-Heroes (vol. 4) 47 Near Mint 1 509 145
-Legion of Super-Heroes (vol. 4) 48 Near Mint 1 510 145
-Legion of Super-Heroes (vol. 4) (Annual) 1 Near Mint 1 511 256
-Legion of Super-Heroes (vol. 4) (Annual) 2 Near Mint 1 512 256
-Legion of Super-Heroes (vol. 4) (Annual) 3 Near Mint 1 513 256
-Legion of Super-Heroes (vol. 4) (Annual) 4 Near Mint 1 514 256
-Legion of Super-Heroes (vol. 4) (Annual) 5 Near Mint 1 515 256
-Legionnaires 3 1 Near Mint 1 516 75
-Legionnaires 3 2 Near Mint 1 517 75
-Legionnaires 3 3 Near Mint 1 518 75
-Legionnaires 3 4 Near Mint 1 519 75
-Warriors of Plasm 1 Near Mint 1 520 76
-Golden Age, The 1 Near Mint 1 521 77
-Golden Age, The 2 Near Mint 1 522 77
-Golden Age, The 3 Near Mint 1 523 77
-Cerebus 0 Near Mint 1 524 123
-Black Orchid 1 Near Mint 1 525 78
-Black Orchid 2 Near Mint 1 526 78
-Black Panther 6 Near Mint Kirby 1 527 80
-Destroyer Duck 1 Near Mint Kirby, First Groo by Aragones 1 528 81
-Destroyer Duck 2 Near Mint KIrby 1 529 81
-Kamandi 30 Near Mint Kirby 1 530 72
-Superman's Pal Jimmy Olsen 144 Near Mint Kirby 1 531 82
-Superman's Pal Jimmy Olsen 145 Near Mint Kirby 1 532 82
-Superman's Pal Jimmy Olsen 146 Near Mint Kirby 1 533 82
-Mister Miracle 1 Near Mint Kirby 1 534 307
-Mister Miracle 2 Near Mint Kirby 1 535 307
-Mister Miracle 3 Near Mint Kirby 1 536 307
-Mister Miracle 4 Near Mint Kirby 1 537 307
-Mister Miracle 5 Near Mint Kirby 1 538 307
-Mister Miracle 6 Near Mint Kirby 1 539 307
-Mister Miracle 9 Near Mint Kirby 1 540 307
-Mister Miracle 10 Near Mint Kirby 1 541 307
-Mister Miracle 12 Near Mint Kirby 1 542 307
-Mister Miracle 13 Near Mint Kirby 1 543 307
-Mister Miracle 14 Near Mint Kirby 1 544 307
-Mister Miracle 15 Near Mint Kirby 1 545 307
-Mister Miracle 16 Near Mint Kirby 1 546 307
-Mister Miracle 17 Near Mint Kirby 1 547 307
-Mister Miracle 18 Near Mint Kirby 1 548 307
-New Gods 1 Near Mint Kirby 1 549 84
-New Gods 2 Near Mint Kirby 1 550 84
-New Gods 3 Near Mint Kirby 1 551 84
-New Gods 4 Near Mint Kirby 1 552 84
-New Gods 5 Near Mint Kirby 1 553 84
-New Gods 6 Near Mint Kirby 1 554 84
-New Gods 7 Near Mint Kirby 1 555 84
-New Gods 9 Near Mint Kirby 1 556 84
-New Gods (Reprints) 6 Near Mint Kirby 1 557 85
-Hellblazer 57 Near Mint 1 558 15
-Hellblazer 58 Near Mint 1 559 15
-Hellblazer 59 Near Mint 1 560 15
-X-Men, The Uncanny 257 Near Mint 1 561 86
-X-Men, The Uncanny 130 Near Mint 2 562 86
-X-Men, The Uncanny 132 Near Mint 2 563 86
-X-Men, The Uncanny 135 Near Mint 2 564 86
-X-Men, The Uncanny 145 Near Mint 4 565 86
-X-Men, The Uncanny 146 Near Mint 3 566 86
-X-Men, The Uncanny 147 Near Mint 3 567 86
-X-Men, The Uncanny 153 Near Mint 3 568 86
-X-Men, The Uncanny 149 Near Mint 3 569 86
-X-Men, The Uncanny 150 Near Mint 3 570 86
-X-Men, The Uncanny 152 Near Mint 2 571 86
-X-Men, The Uncanny 154 Near Mint 4 572 86
-X-Men, The Uncanny 155 Near Mint 4 573 86
-X-Men, The Uncanny 186 Near Mint 2 574 86
-X-Men, The Uncanny (Annual) 5 Near Mint 4 575 87
-Lex Luthor, The Unauthorized Biography 1 Near Mint 1 576 88
-Lobo's Back 1 Near Mint 1 577 90
-Lobo Infanticide 1 Near Mint 1 578 89
-Man of Steel, The 1 Near Mint one newstand, one collector's edition 2 579 91
-Man of Steel, The 2 Near Mint 1 580 91
-Man of Steel, The 3 Near Mint 1 581 91
-Man of Steel, The 4 Near Mint 1 582 91
-Man of Steel, The 5 Near Mint 1 583 91
-Man of Steel, The 6 Near Mint 1 584 91
-Miracle Man 2 Near Mint 1 585 92
-Miracle Man 3 Near Mint 1 586 92
-Miracle Man 4 Near Mint 1 587 92
-Miracle Man 5 Near Mint 1 588 92
-Miracle Man 6 Near Mint 1 589 92
-Miracle Man 8 Near Mint 1 590 92
-Miracle Man 10 Near Mint 1 591 92
-Action Comics 415 Near Mint 1 1102 142
-Action Comics 417 Near Mint 1 1103 142
-Action Comics 426 Near Mint 1 1104 142
-Action Comics 427 Near Mint 1 1105 142
-Action Comics 428 Near Mint 1 1106 142
-Action Comics 431 Near Mint 1 1107 142
-Action Comics 432 Near Mint 1 1108 142
-Action Comics 433 Near Mint 1 1109 142
-Action Comics 434 Near Mint 1 1110 142
-Action Comics 436 Near Mint 1 1111 142
-Action Comics 438 Near Mint 1 1112 142
-Action Comics 439 Near Mint 1 1113 142
-Action Comics 440 Near Mint 1 1114 142
-Action Comics 441 Near Mint 1 1115 142
-Action Comics 442 Near Mint 1 1116 142
-Action Comics 443 Near Mint 1 1117 142
-Action Comics 444 Near Mint 1 1118 142
-Action Comics 445 Near Mint 1 1119 142
-Action Comics 446 Near Mint 1 1120 142
-Action Comics 447 Near Mint 1 1121 142
-Action Comics 448 Near Mint 1 1122 142
-Action Comics 449 Near Mint 1 1123 142
-Action Comics 450 Near Mint 1 1124 142
-Action Comics 452 Near Mint 1 1125 142
-Action Comics 453 Near Mint 1 1126 142
-Action Comics 454 Near Mint 1 1127 142
-Action Comics 455 Near Mint 1 1128 142
-Action Comics 456 Near Mint 1 1129 142
-Action Comics 457 Near Mint 1 1130 142
-Action Comics 458 Near Mint 1 1131 142
-Action Comics 459 Near Mint 1 1132 142
-Action Comics 460 Near Mint 1 1133 142
-Action Comics 461 Near Mint 1 1134 142
-Action Comics 462 Near Mint 1 1135 142
-Action Comics 463 Near Mint 1 1136 142
-Action Comics 464 Near Mint 1 1137 142
-Action Comics 465 Near Mint 1 1138 142
-Action Comics 466 Near Mint 1 1139 142
-Action Comics 467 Near Mint 1 1140 142
-Action Comics 468 Near Mint 1 1141 142
-Action Comics 469 Near Mint 1 1142 142
-Action Comics 470 Near Mint 1 1143 142
-Action Comics 471 Near Mint 1 1144 142
-Action Comics 472 Near Mint 1 1145 142
-Action Comics 473 Near Mint 1 1146 142
-Action Comics 474 Near Mint 1 1147 142
-Action Comics 475 Near Mint 1 1148 142
-Action Comics 476 Near Mint 1 1149 142
-Action Comics 477 Near Mint 1 1150 142
-Action Comics 478 Near Mint 1 1151 142
-Action Comics 479 Near Mint 1 1152 142
-Action Comics 480 Near Mint 1 1153 142
-Action Comics 481 Near Mint 1 1154 142
-Action Comics 482 Near Mint 1 1155 142
-Action Comics 483 Near Mint 1 1156 142
-Action Comics 484 Near Mint 1 1157 142
-Action Comics 486 Near Mint 1 1158 142
-Action Comics 487 Near Mint 1 1159 142
-Action Comics 488 Near Mint 1 1160 142
-Action Comics 489 Near Mint 1 1161 142
-Action Comics 490 Near Mint 1 1162 142
-Action Comics 491 Near Mint 1 1163 142
-Action Comics 492 Near Mint 1 1164 142
-Action Comics 493 Near Mint 1 1165 142
-Action Comics 494 Near Mint 1 1166 142
-Action Comics 495 Near Mint 1 1167 142
-Action Comics 496 Near Mint 1 1168 142
-Action Comics 497 Near Mint 1 1169 142
-Action Comics 498 Near Mint 1 1170 142
-Action Comics 499 Near Mint 1 1171 142
-Action Comics 500 Near Mint 2 1172 142
-Action Comics 501 Near Mint 1 1173 142
-Action Comics 502 Near Mint 1 1174 142
-Action Comics 503 Near Mint 1 1175 142
-Action Comics 504 Near Mint 1 1176 142
-Action Comics 506 Near Mint 1 1177 142
-Action Comics 638 Near Mint Kirby cover 1 1178 142
-Adventure Comics 340 Near Mint 1 1179 170
-Adventure Comics 367 Near Mint 1 1180 170
-Adventure Comics 467 Near Mint 1 1181 170
-Adventure Comics 468 Near Mint 1 1182 170
-Adventure Comics 469 Near Mint 1 1183 170
-Adventure Comics 470 Near Mint 1 1184 170
-Adventure Comics 471 Near Mint 1 1185 170
-Adventure Comics 472 Near Mint 1 1186 170
-Adventure Comics 474 Near Mint 1 1187 170
-Adventure Comics 479 Near Mint 1 1188 170
-Alien Legion 1 Near Mint 1 1189 171
-Alien Legion 2 Near Mint 1 1190 171
-DC Comics Presents 23 Near Mint 1 1520 138
-DC Comics Presents 24 Near Mint 1 1521 138
-DC Comics Presents 27 Near Mint 1 1522 138
-DC Comics Presents 30 Near Mint 1 1523 138
-DC Comics Presents 31 Near Mint 1 1524 138
-DC Comics Presents 32 Near Mint 1 1525 138
-DC Comics Presents 33 Near Mint 1 1526 138
-DC Comics Presents 34 Near Mint 1 1527 138
-DC Comics Presents 35 Near Mint 2 1528 138
-DC Comics Presents 37 Near Mint 1 1529 138
-DC Comics Presents 38 Near Mint 1 1530 138
-DC Comics Presents 39 Near Mint 1 1531 138
-DC Comics Presents 40 Near Mint 1 1532 138
-DC Comics Presents 41 Near Mint 1 1533 138
-DC Comics Presents 42 Near Mint 1 1534 138
-DC Comics Presents 43 Near Mint 1 1535 138
-Deadman (reprints) 6 Near Mint 1 1536 210
-Death, The High Cost of Living 3 Near Mint one has no price, one has page reversal 2 1537 23
-Defenders, The 11 Near Mint 1 1538 211
-Defenders, The 13 Near Mint 1 1539 211
-Defenders, The 18 Near Mint 1 1540 211
-Defenders, The 20 Near Mint 1 1541 211
-Defenders, The 21 Near Mint 1 1542 211
-Defenders, The 22 Near Mint 1 1543 211
-Defenders, The 25 Near Mint 1 1544 211
-Defenders, The 65 Near Mint 1 1545 211
-Defenders, The 66 Near Mint 1 1546 211
-Defenders, The 67 Near Mint 1 1547 211
-Defenders, The 68 Near Mint 1 1548 211
-Defenders, The 69 Near Mint 1 1549 211
-Defenders, The 70 Near Mint 1 1550 211
-Defenders, The 71 Near Mint 1 1551 211
-Defenders, The 72 Near Mint 1 1552 211
-Defenders, The 73 Near Mint 1 1553 211
-Defenders, The 74 Near Mint 1 1554 211
-Defenders, The 75 Near Mint 1 1555 211
-Defenders, The 76 Near Mint 1 1556 211
-Defenders, The 77 Near Mint 1 1557 211
-Defenders, The 78 Near Mint 2 1558 211
-Defenders, The 79 Near Mint 1 1559 211
-Defenders, The 80 Near Mint 1 1560 211
-Defenders, The 81 Near Mint 1 1561 211
-Defenders, The 82 Near Mint 1 1562 211
-Defenders, The 83 Near Mint 1 1563 211
-Defenders, The 84 Near Mint 1 1564 211
-Defenders, The 85 Near Mint 1 1565 211
-Defenders, The 86 Near Mint 1 1566 211
-Defenders, The 87 Near Mint 1 1567 211
-Defenders, The 88 Near Mint 1 1568 211
-Defenders, The 89 Near Mint 1 1569 211
-Defenders, The 90 Near Mint 1 1570 211
-Defenders, The 93 Near Mint 1 1571 211
-Defenders, The 94 Near Mint 1 1572 211
-Defenders, The 95 Near Mint 1 1573 211
-Defenders, The 96 Near Mint 1 1574 211
-Defenders, The 97 Near Mint 1 1575 211
-Defenders, The 98 Near Mint 1 1576 211
-Defenders, The 100 Near Mint 1 1577 211
-Defenders, The 103 Near Mint 1 1578 211
-Defenders, The 104 Near Mint 1 1579 211
-D.N.Agents 1 Near Mint 1 1580 212
-D.N.Agents 2 Near Mint 1 1581 212
-D.N.Agents 3 Near Mint 1 1582 212
-Doc Savage (1988) 2 Near Mint 1 1583 213
-Doc Savage (1988) 3 Near Mint 1 1584 213
-Doc Savage (1988) 5 Near Mint 1 1585 213
-Dr. Who 2 Near Mint 1 1586 214
-Dr. Who 3 Near Mint 1 1587 214
-Dr. Who 4 Near Mint 1 1588 214
-Dragon Slayer 1 Near Mint 1 1589 215
-Dragon Slayer 2 Near Mint 1 1590 215
-Dreadstar 1 Near Mint 1 1591 5044
-Dreadstar 6 Near Mint 1 1592 5044
-Dreadstar (Annual) 1 Near Mint 1 1593 216
-Dynamic Classics 1 Near Mint 1594 217
-Elementals 1 Near Mint 1 1595 220
-Elementals 2 Near Mint 1 1596 220
-Elementals 3 Near Mint 1 1597 220
-Elementals 4 Near Mint 1 1598 220
-Elementals 5 Near Mint 1 1599 220
-Elementals 6 Near Mint 1 1600 220
-Elementals 7 Near Mint 1 1601 220
-Elementals 8 Near Mint 1 1602 220
-Elementals 9 Near Mint 1 1603 220
-Elementals 25 Near Mint 1 1604 220
-Elementals 26 Near Mint 1 1605 220
-Elementals Special 1 Near Mint 1 1606 219
-E-Man (vol. 2) 1 Near Mint 1 1607 221
-E-Man (vol. 2) 2 Near Mint 1 1608 221
-E-Man (vol. 2) 3 Near Mint 1 1609 221
-E-Man (vol. 2) 4 Near Mint 1 1610 221
-E-Man (vol. 2) 5 Near Mint 1 1611 221
-E-Man (vol. 2) 6 Near Mint 1 1612 221
-E-Man (vol. 2) 7 Near Mint 1 1613 221
-E-Man (vol. 2) 8 Near Mint 1 1614 221
-E-Man (vol. 2) 9 Near Mint 1 1615 221
-E-Man (vol. 2) 10 Near Mint 1 1616 221
-E-Man (vol. 2) 11 Near Mint 1 1617 221
-E-Man (vol. 2) 12 Near Mint 1 1618 221
-E-Man (vol. 2) 13 Near Mint 1 1619 221
-E-Man (vol. 2) 14 Near Mint 1 1620 221
-E-Man (vol. 2) 15 Near Mint 1 1621 221
-E-Man (vol. 2) 16 Near Mint 1 1622 221
-E-Man (vol. 2) 17 Near Mint 1 1623 221
-E-Man (vol. 2) 18 Near Mint 1 1624 221
-E-Man (vol. 2) 19 Near Mint 1 1625 221
-E-Man (vol. 2) 20 Near Mint 1 1626 221
-E-Man (vol. 2) 21 Near Mint 1 1627 221
-E-Man (vol. 2) 22 Near Mint 1 1628 221
-E-Man (vol. 2) 23 Near Mint 1 1629 221
-E-Man (vol. 2) 24 Near Mint 1 1630 221
-E-Man (vol. 2) 25 Near Mint 1 1631 221
-E-Man (vol. 4) 2 Near Mint 1 1632 222
-Eternals 1 Near Mint Kirby 1 1633 223
-Eternals 2 Near Mint Kirby 1 1634 223
-Eternals 3 Near Mint Kirby 1 1635 223
-Eternals 4 Near Mint Kirby 1 1636 223
-Eternals 5 Near Mint Kirby 1 1637 223
-Eternals 6 Near Mint Kirby 1 1638 223
-Eternals 7 Near Mint Kirby 1 1639 223
-Eternals 8 Near Mint Kirby 1 1640 223
-Eternals 9 Near Mint Kirby 1 1641 223
-Eternals 10 Near Mint Kirby 1 1642 223
-Eternals 11 Near Mint Kirby 1 1643 223
-Eternals 12 Near Mint Kirby 1 1644 223
-Eternals 13 Near Mint Kirby 1 1645 223
-Eternals 14 Near Mint Kirby 1 1646 223
-Eternals 15 Near Mint Kirby 1 1647 223
-Eternals 16 Near Mint Kirby 1 1648 223
-Eternals 17 Near Mint Kirby 1 1649 223
-Eternals 18 Near Mint Kirby 1 1650 223
-Eternals 19 Near Mint Kirby 1 1651 223
-Eternals (Annual) 1 Near Mint Kirby 1 1652 224
-Eternals (maxi-series) 2 Near Mint 1 1653 225
-Eternals (maxi-series) 3 Near Mint 1 1654 225
-Eternals (maxi-series) 4 Near Mint 1 1655 225
-Eternals (maxi-series) 5 Near Mint 1 1656 225
-Eternals (maxi-series) 6 Near Mint 1 1657 225
-Fantastic Four 176 Near Mint 1 1658 226
-Fantastic Four 200 Near Mint 2 1659 226
-Fantastic Four 201 Near Mint 1 1660 226
-Fantastic Four 202 Near Mint 1 1661 226
-Fantastic Four 203 Near Mint 1 1662 226
-Fantastic Four 204 Near Mint 1 1663 226
-Fantastic Four 205 Near Mint 1 1664 226
-Fantastic Four 206 Near Mint 1 1665 226
-Fantastic Four 207 Near Mint 1 1666 226
-Fantastic Four 208 Near Mint 1 1667 226
-Fantastic Four 209 Near Mint 1 1668 226
-Fantastic Four 210 Near Mint 1 1669 226
-Fantastic Four 211 Near Mint 1 1670 226
-Fantastic Four 212 Near Mint 1 1671 226
-Fantastic Four 213 Near Mint 2 1672 226
-Fantastic Four 214 Near Mint 1 1673 226
-Fantastic Four 215 Near Mint 1 1674 226
-Fantastic Four 216 Near Mint 1 1675 226
-Fantastic Four 217 Near Mint 2 1676 226
-Fantastic Four 218 Near Mint 1 1677 226
-Fantastic Four 219 Near Mint 1 1678 226
-Fantastic Four 220 Near Mint 1 1679 226
-Fantastic Four 221 Near Mint 1 1680 226
-Fantastic Four 222 Near Mint 1 1681 226
-Fantastic Four 224 Near Mint 1 1682 226
-Fantastic Four 225 Near Mint 1 1683 226
-Fantastic Four 228 Near Mint 1 1684 226
-Fantastic Four 229 Near Mint 2 1685 226
-Fantastic Four 230 Near Mint 1 1686 226
-Fantastic Four 231 Near Mint 2 1687 226
-Fantastic Four 232 Near Mint 1 1688 226
-Fantastic Four 233 Near Mint 1 1689 226
-Fantastic Four 234 Near Mint 1 1690 226
-Fantastic Four 235 Near Mint 1 1691 226
-Alien Legion 3 Near Mint 1 1191 171
-Alien Legion 4 Near Mint 1 1192 171
-Alien Legion 5 Near Mint 1 1193 171
-Alpha Flight 17 Near Mint 1 1194 172
-Alpha Flight 18 Near Mint 1 1195 172
-Alpha Flight 19 Near Mint 1 1196 172
-Alpha Flight 20 Near Mint 1 1197 172
-Alpha Flight 21 Near Mint 1 1198 172
-Alpha Flight 22 Near Mint 1 1199 172
-Alpha Flight 24 Near Mint 1 1200 172
-Amazing Adventures (vol. 2) 1 Near Mint 8 1201 173
-Amazing Adventures (vol. 2) 2 Near Mint 5 1202 173
-Amazing Adventures (vol. 2) 3 Near Mint 2 1203 173
-Amazing Adventures (vol. 2) 4 Near Mint 2 1204 173
-Amazing Adventures (vol. 2) 5 Near Mint 4 1205 173
-Amazing Adventures (vol. 2) 6 Near Mint 1 1206 173
-Amazing Adventures (vol. 2) 7 Near Mint 1 1207 173
-Amazing Adventures (vol. 2) 8 Near Mint 1 1208 173
-Amazing Adventures (vol. 2) 9 Near Mint 1 1209 173
-Amazing Adventures (vol. 2) 11 Near Mint 1 1210 173
-Amazing Adventures (vol. 2) 12 Near Mint 1 1211 173
-Amazing Adventures (vol. 2) 13 Near Mint 1 1212 173
-Amazing Adventures (vol. 2) 14 Near Mint 1 1213 173
-Amazing Comics Premieres 2 Near Mint 1 1214 174
-Amazing Spiderman, The 163 Near Mint 1 1215 175
-Amazing Spiderman, The 167 Near Mint 1 1216 175
-Amazing Spiderman, The 168 Near Mint 1 1217 175
-Amazing Spiderman, The 170 Near Mint 1 1218 175
-Amazing Spiderman, The 171 Near Mint 2 1219 175
-Amazing Spiderman, The 172 Near Mint 1 1220 175
-Amazing Spiderman, The 173 Near Mint 1 1221 175
-Amazing Spiderman, The 174 Near Mint 1 1222 175
-Amazing Spiderman, The 175 Near Mint 1 1223 175
-Amazing Spiderman, The 176 Near Mint 1 1224 175
-Amazing Spiderman, The 177 Near Mint 1 1225 175
-Amazing Spiderman, The 178 Near Mint 1 1226 175
-Amazing Spiderman, The 179 Near Mint 1 1227 175
-Amazing Spiderman, The 180 Near Mint 1 1228 175
-Amazing Spiderman, The 181 Near Mint 1 1229 175
-Amazing Spiderman, The 182 Near Mint 1 1230 175
-Amazing Spiderman, The 183 Near Mint 1 1231 175
-Amazing Spiderman, The 184 Near Mint 1 1232 175
-Amazing Spiderman, The 185 Near Mint 1 1233 175
-Amazing Spiderman, The 186 Near Mint 1 1234 175
-Amazing Spiderman, The 187 Near Mint 1 1235 175
-Amazing Spiderman, The 188 Near Mint 2 1236 175
-Amazing Spiderman, The 189 Near Mint 2 1237 175
-Amazing Spiderman, The 190 Near Mint 2 1238 175
-Amazing Spiderman, The 191 Near Mint 2 1239 175
-Amazing Spiderman, The 193 Near Mint 2 1240 175
-Amazing Spiderman, The 194 Near Mint 1 1241 175
-Amazing Spiderman, The 195 Near Mint 10 1242 175
-Amazing Spiderman, The 196 Near Mint 2 1243 175
-Amazing Spiderman, The 197 Near Mint 1 1244 175
-Amazing Spiderman, The 198 Near Mint 1 1245 175
-Amazing Spiderman, The 199 Near Mint 1 1246 175
-Amazing Spiderman, The 200 Near Mint 3 1247 175
-Amazing Spiderman, The 201 Near Mint 1 1248 175
-Amazing Spiderman, The 202 Near Mint 1 1249 175
-Amazing Spiderman, The 203 Near Mint 1 1250 175
-Amazing Spiderman, The 204 Near Mint 1 1251 175
-Amazing Spiderman, The 205 Near Mint 1 1252 175
-Amazing Spiderman, The 206 Near Mint 1 1253 175
-Amazing Spiderman, The 207 Near Mint 1 1254 175
-Amazing Spiderman, The 208 Near Mint 1 1255 175
-Amazing Spiderman, The 210 Near Mint 1 1256 175
-Amazing Spiderman, The 211 Near Mint 1 1257 175
-Amazing Spiderman, The 212 Near Mint 1 1258 175
-Amazing Spiderman, The 213 Near Mint 1 1259 175
-Amazing Spiderman, The 214 Near Mint 1 1260 175
-Amazing Spiderman, The 215 Near Mint 2 1261 175
-Amazing Spiderman, The 216 Near Mint 1 1262 175
-Amazing Spiderman, The 217 Near Mint 3 1263 175
-Amazing Spiderman, The 218 Near Mint 1 1264 175
-Amazing Spiderman, The 219 Near Mint 1 1265 175
-Amazing Spiderman, The 220 Near Mint 1 1266 175
-Amazing Spiderman, The 224 Near Mint 1 1267 175
-Amazing Spiderman, The 225 Near Mint 1 1268 175
-Amazing Spiderman, The 266 Near Mint 1 1269 175
-Amazing Spiderman, The (Annual) 11 Near Mint 1 1270 176
-Amazing Spiderman, The (Annual) 12 Near Mint 1 1271 176
-Amazing Spiderman, The (Annual) 13 Near Mint 1 1272 176
-Amazing Spiderman, The (Annual) 15 Near Mint 1 1273 176
-Amazing Spiderman, Skating on Thin Ice 1 Near Mint 1 1274 283
-Ambush Bug 1 Near Mint 1 1275 178
-Andromeda 1 Near Mint 1 1276 179
-Andromeda 2 Near Mint 1 1277 179
-Andromeda 3 Near Mint 1 1278 179
-Andromeda 4 Near Mint 1 1279 179
-Andromeda 5 Near Mint 1 1280 179
-Andromeda 6 Near Mint 1 1281 179
-Angel and the Ape 1 Near Mint 1 1282 180
-Angel and the Ape 2 Near Mint 1 1283 180
-Angel and the Ape 3 Near Mint 1 1284 180
-Angel and the Ape 4 Near Mint 1 1285 180
-Arctic Comics 1 Near Mint 2 1286 181
-Arion, Lord of Atlantis 1 Near Mint 1 1287 182
-Aquaman 44 Good 1 1288 183
-Avengers, The 140 Near Mint 1 1289 184
-Avengers, The 141 Near Mint 1 1290 184
-Avengers, The 142 Near Mint 1 1291 184
-Avengers, The 143 Near Mint 1 1292 184
-Avengers, The 144 Near Mint 1 1293 184
-Avengers, The 145 Near Mint 1 1294 184
-Avengers, The 146 Near Mint 1 1295 184
-Avengers, The 147 Near Mint 1 1296 184
-Avengers, The 148 Near Mint 1 1297 184
-Avengers, The 149 Near Mint 1 1298 184
-Avengers, The 151 Near Mint 1 1299 184
-Avengers, The 152 Near Mint 1 1300 184
-Avengers, The 153 Near Mint 1 1301 184
-Avengers, The 154 Near Mint 1 1302 184
-Avengers, The 155 Near Mint 1 1303 184
-Avengers, The 156 Near Mint 1 1304 184
-Avengers, The 157 Near Mint 1 1305 184
-Avengers, The 158 Near Mint 1 1306 184
-Avengers, The 159 Near Mint 1 1307 184
-Avengers, The 160 Near Mint 1 1308 184
-Avengers, The 161 Near Mint 1 1309 184
-Avengers, The 162 Near Mint 1 1310 184
-Avengers, The 163 Near Mint 1 1311 184
-Avengers, The 164 Near Mint 1 1312 184
-Avengers, The 165 Near Mint 1 1313 184
-Avengers, The 166 Near Mint 1 1314 184
-Avengers, The 167 Near Mint 1 1315 184
-Avengers, The 168 Near Mint 1 1316 184
-Avengers, The 169 Near Mint 1 1317 184
-Avengers, The 170 Near Mint 1 1318 184
-Avengers, The 171 Near Mint 1 1319 184
-Avengers, The 172 Near Mint 1 1320 184
-Avengers, The 173 Near Mint 1 1321 184
-Avengers, The 174 Near Mint 1 1322 184
-Avengers, The 175 Near Mint 1 1323 184
-Avengers, The 182 Near Mint 1 1324 184
-Avengers, The 192 Near Mint 1 1325 184
-Avengers, The 197 Near Mint 1 1326 184
-Avengers, The 199 Near Mint 1 1327 184
-Avengers, The 200 Near Mint 1 1328 184
-Avengers, The 206 Near Mint 1 1329 184
-Avengers, The 207 Near Mint 1 1330 184
-Avengers, The 208 Near Mint 2 1331 184
-Avengers, The 209 Near Mint 1 1332 184
-Avengers, The 210 Near Mint 1 1333 184
-Avengers, The 211 Near Mint 1 1334 184
-Avengers, The 214 Near Mint 1 1335 184
-Avengers, The 215 Near Mint 1 1336 184
-Avengers, The 216 Near Mint 1 1337 184
-Avengers, The 217 Near Mint 1 1338 184
-Avengers, The 219 Near Mint 1 1339 184
-Avengers, The 220 Near Mint 1 1340 184
-Avengers, The 257 Near Mint 1 1341 184
-Avengers, The (Annual) 7 Near Mint 1 1342 185
-Avengers, The (Annual) 8 Near Mint 1 1343 185
-Avengers, The (Annual) 9 Near Mint 1 1344 185
-Avengers, The (Annual) 10 Near Mint 1 1345 185
-Battlestar Galactica 1 Near Mint 6 1346 186
-Battlestar Galactica 2 Near Mint 5 1347 186
-Battlestar Galactica 3 Near Mint 5 1348 186
-Battlestar Galactica 4 Near Mint 5 1349 186
-Battlestar Galactica 5 Near Mint 2 1350 186
-Battlestar Galactica 6 Near Mint 1 1351 186
-Battlestar Galactica 7 Near Mint 1 1352 186
-Battlestar Galactica 8 Near Mint 1 1353 186
-Battlestar Galactica 9 Near Mint 1 1354 186
-Battlestar Galactica 10 Near Mint 1 1355 186
-Battlestar Galactica 11 Near Mint 1 1356 186
-Battlestar Galactica 12 Near Mint 1 1357 186
-Battlestar Galactica 13 Near Mint 1 1358 186
-Battlestar Galactica 14 Near Mint 1 1359 186
-Battlestar Galactica 15 Near Mint 1 1360 186
-Battlestar Galactica 16 Near Mint 1 1361 186
-Battlestar Galactica 17 Near Mint 1 1362 186
-Battlestar Galactica 18 Near Mint 1 1363 186
-Batman 400 Near Mint 1 1364 187
-Batman and Other DC Classics 1 Near Mint 1 1365 188
-Beagle Boys Versus Uncle Scrooge 1 Near Mint 1 1366 189
-Beagle Boys Versus Uncle Scrooge 2 Near Mint 1 1367 189
-Beagle Boys Versus Uncle Scrooge 3 Near Mint 1 1368 189
-Beagle Boys Versus Uncle Scrooge 4 Near Mint 1 1369 189
-Beauty and the Beast 1 Near Mint 1 1370 190
-Beauty and the Beast 2 Near Mint 1 1371 190
-Beauty and the Beast 3 Near Mint 1 1372 190
-Blackhawk (vol. 1) 251 Near Mint 1 1373 191
-Blackhawk (vol. 1) 252 Near Mint 1 1374 191
-Blackhawk (vol. 2) 2 Near Mint 1 1375 192
-Blackhawk (vol. 2) 3 Near Mint 1 1376 192
-Blackhawk (vol. 2) 4 Near Mint 1 1377 192
-Blackhawk (vol. 2) 5 Near Mint 1 1378 192
-Blackhawk (vol. 2) 6 Near Mint 1 1379 192
-Blackhawk (vol. 2) 7 Near Mint 1 1380 192
-Blackhawk (vol. 2) 8 Near Mint 1 1381 192
-Blackhawk (vol. 2) (Annual) 1 Near Mint 1 1382 193
-Blue Devil (Annual) 2 Near Mint 1 1383 194
-Captain America 230 Near Mint 1 1384 154
-Captain America 231 Near Mint 1 1385 154
-Captain America 232 Near Mint 1 1386 154
-Captain America 233 Near Mint 1 1387 154
-Captain America 234 Near Mint 1 1388 154
-Captain America 235 Near Mint 1 1389 154
-Captain America 236 Near Mint 1 1390 154
-Captain America 237 Near Mint 1 1391 154
-Captain America 238 Near Mint 1 1392 154
-Captain America 239 Near Mint 1 1393 154
-Captain America 240 Near Mint 1 1394 154
-Captain America 241 Near Mint 1 1395 154
-Captain America 242 Near Mint 1 1396 154
-Captain America 243 Near Mint 1 1397 154
-Captain America 244 Near Mint 1 1398 154
-Captain America 246 Near Mint 1 1399 154
-Captain America 254 Near Mint 2 1400 154
-Captain America 256 Near Mint 1 1401 154
-Captain America 257 Near Mint 1 1402 154
-Captain America 258 Near Mint 2 1403 154
-Captain America 259 Near Mint 1 1404 154
-Captain America 260 Near Mint 1 1405 154
-Captain America 261 Near Mint 1 1406 154
-Captain America 262 Near Mint 1 1407 154
-Captain America 263 Near Mint 1 1408 154
-Captain America 264 Near Mint 1 1409 154
-Captain America 265 Near Mint 2 1410 154
-Captain America 266 Near Mint 2 1411 154
-Captain America 267 Near Mint 2 1412 154
-Captain America 268 Near Mint 1 1413 154
-Captain America 269 Near Mint 1 1414 154
-Captain America 270 Near Mint 1 1415 154
-Captain America 271 Near Mint 1 1416 154
-Captain America 272 Near Mint 1 1417 154
-Captain America 273 Near Mint 1 1418 154
-Captain America 274 Near Mint 1 1419 154
-Captain America 275 Near Mint 1 1420 154
-Captain America 276 Near Mint 1 1421 154
-Captain America 277 Near Mint 1 1422 154
-Captain America 278 Near Mint 1 1423 154
-Captain America (Annual) 5 Near Mint 1 1424 195
-Captain Canuck 1 Near Mint autographed by Richard Comely 7 1425 196
-Captain Canuck 2 Near Mint autographed by Richard Comely 1 1426 196
-Captain Canuck 3 Near Mint autographed by Richard Comely 1 1427 196
-Captain Canuck 4 Near Mint autographed by Richard Comely 2 1428 196
-Captain Canuck 5 Near Mint 1 1429 196
-Captain Canuck 6 Near Mint 1 1430 196
-Captain Canuck 7 Near Mint 1 1431 196
-Captain Canuck 8 Near Mint 1 1432 196
-Captain Canuck 9 Near Mint 1 1433 196
-Captain Canuck 10 Near Mint 1 1434 196
-Captain Canuck 14 Near Mint 1 1435 196
-Captain Canuck Summer Special 1 Near Mint 1 1436 197
-Captain Marvel 59 Near Mint 1 1437 198
-Captain Marvel 61 Near Mint 1 1438 198
-Captain Marvel 62 Near Mint 1 1439 198
-Captain Thunder and Blue Bolt 1 Near Mint 1 1440 199
-Captain Victory 1 Near Mint Kirby 1 1441 200
-Captain Victory 2 Near Mint Kirby 1 1442 200
-Captain Victory 3 Near Mint Kirby 4 1443 200
-Captain Victory 4 Near Mint Kirby 1 1444 200
-Captain Victory 5 Near Mint Kirby 1 1445 200
-Captain Victory 6 Near Mint Kirby 1 1446 200
-Captain Victory 7 Near Mint Kirby 1 1447 200
-Captain Victory 8 Near Mint Kirby 1 1448 200
-Captain Victory 9 Near Mint Kirby 1 1449 200
-Captain Victory 10 Near Mint Kirby 1 1450 200
-Captain Victory 11 Near Mint Kirby 1 1451 200
-Captain Victory 12 Near Mint Kirby 1 1452 200
-Captain Victory Special 1 Near Mint Kirby 1 1453 201
-Cloak and Dagger 1 Near Mint 1 1454 202
-Conan The Barbarian 88 Near Mint 1 1455 203
-Conan The Barbarian 89 Near Mint 1 1456 203
-Conan The Barbarian 90 Near Mint 1 1457 203
-Conan The Barbarian 91 Near Mint 1 1458 203
-Conan The Barbarian 92 Near Mint 1 1459 203
-Conan The Barbarian 95 Near Mint 1 1460 203
-Conan The Barbarian 96 Near Mint 1 1461 203
-Conan The Barbarian 97 Near Mint 1 1462 203
-Conan The Barbarian 98 Near Mint 1 1463 203
-Conan The Barbarian 99 Near Mint 1 1464 203
-Conan The Barbarian 100 Near Mint 2 1465 203
-Conan The Barbarian 101 Near Mint 1 1466 203
-Conan The Barbarian 102 Near Mint 1 1467 203
-Conan The Barbarian 103 Near Mint 1 1468 203
-Conan The Barbarian 104 Near Mint 1 1469 203
-Conan The Barbarian 105 Near Mint 1 1470 203
-Conan The Barbarian 106 Near Mint 1 1471 203
-Conan The Barbarian 107 Near Mint 1 1472 203
-Conan The Barbarian 108 Near Mint 1 1473 203
-Conan The Barbarian 109 Near Mint 1 1474 203
-Conan The Barbarian 120 Near Mint 1 1475 203
-Conan The Barbarian 121 Near Mint 1 1476 203
-Conan The Barbarian 122 Near Mint 1 1477 203
-Conan The Barbarian 123 Near Mint 1 1478 203
-Conan The Barbarian 124 Near Mint 1 1479 203
-Conan The Barbarian 125 Near Mint 1 1480 203
-Conan The Barbarian 126 Near Mint 1 1481 203
-Conan The Barbarian 129 Near Mint 1 1482 203
-Conan The Barbarian 130 Near Mint 1 1483 203
-Conan The Barbarian 131 Near Mint 1 1484 203
-Conan The Barbarian 132 Near Mint 1 1485 203
-Conan The Barbarian (Annual) 5 Near Mint 1 1486 204
-Conan The Barbarian (Annual) 6 Near Mint 1 1487 204
-Crimson Avenger, The 1 Near Mint 1 1488 205
-Crimson Avenger, The 3 Near Mint 1 1489 205
-Crimson Avenger, The 4 Near Mint 1 1490 205
-Cyberpunk (Book Two) 1 Near Mint 1 1491 206
-Damage Control (vol. 3) 1 Near Mint 1 1492 207
-Daredevil, The Man Without Fear 181 Near Mint 6 1493 208
-Daredevil, The Man Without Fear 214 Near Mint 1 1494 208
-Daredevil, The Man Without Fear 220 Near Mint 1 1495 208
-Dazzler 1 Near Mint 1 1496 209
-Dazzler 2 Near Mint 1 1497 209
-DC Comics Presents 1 Near Mint 2 1498 138
-DC Comics Presents 2 Near Mint 1 1499 138
-DC Comics Presents 3 Near Mint 1 1500 138
-DC Comics Presents 4 Near Mint 1 1501 138
-DC Comics Presents 5 Near Mint 1 1502 138
-DC Comics Presents 6 Near Mint 1 1503 138
-DC Comics Presents 7 Near Mint 1 1504 138
-DC Comics Presents 8 Near Mint 1 1505 138
-DC Comics Presents 9 Near Mint 1 1506 138
-DC Comics Presents 10 Near Mint 1 1507 138
-DC Comics Presents 11 Near Mint 1 1508 138
-DC Comics Presents 12 Near Mint 1 1509 138
-DC Comics Presents 13 Near Mint 1 1510 138
-DC Comics Presents 14 Near Mint 1 1511 138
-DC Comics Presents 15 Near Mint 1 1512 138
-DC Comics Presents 16 Near Mint 1 1513 138
-DC Comics Presents 17 Near Mint 1 1514 138
-DC Comics Presents 18 Near Mint 1 1515 138
-DC Comics Presents 19 Near Mint 1 1516 138
-DC Comics Presents 20 Near Mint 1 1517 138
-DC Comics Presents 21 Near Mint 1 1518 138
-DC Comics Presents 22 Near Mint 1 1519 138
-Howard the Duck (Annual) 1 Near Mint 1 1855 242
-Howard the Duck (mini-series) 1 Near Mint 1 1856 243
-Howard the Duck (mini-series) 2 Near Mint 1 1857 243
-Incredible Hulk, The 231 Near Mint 1 1858 244
-Incredible Hulk, The 232 Near Mint 1 1859 244
-Incredible Hulk, The 233 Near Mint 1 1860 244
-Incredible Hulk, The 234 Near Mint 1 1861 244
-Incredible Hulk, The 235 Near Mint 1 1862 244
-Incredible Hulk, The 236 Near Mint 1 1863 244
-Incredible Hulk, The 237 Near Mint 1 1864 244
-Incredible Hulk, The 238 Near Mint 1 1865 244
-Incredible Hulk, The 239 Near Mint 1 1866 244
-Incredible Hulk, The 240 Near Mint 1 1867 244
-Incredible Hulk, The 241 Near Mint 1 1868 244
-Incredible Hulk, The 242 Near Mint 1 1869 244
-Incredible Hulk, The 243 Near Mint 1 1870 244
-Incredible Hulk, The 244 Near Mint 1 1871 244
-Incredible Hulk, The 245 Near Mint 1 1872 244
-Incredible Hulk, The 246 Near Mint 1 1873 244
-Incredible Hulk, The 247 Near Mint 1 1874 244
-Incredible Hulk, The 248 Near Mint 1 1875 244
-Incredible Hulk, The 249 Near Mint 1 1876 244
-Incredible Hulk, The 250 Near Mint 1 1877 244
-Incredible Hulk, The 251 Near Mint 1 1878 244
-Incredible Hulk, The 253 Near Mint 1 1879 244
-Incredible Hulk, The 255 Near Mint 1 1880 244
-Incredible Hulk, The 257 Near Mint 1 1881 244
-Incredible Hulk, The 258 Near Mint 1 1882 244
-Incredible Hulk, The 259 Near Mint 1 1883 244
-Incredible Hulk, The 260 Near Mint 2 1884 244
-Incredible Hulk, The 261 Near Mint 1 1885 244
-Incredible Hulk, The 262 Near Mint 1 1886 244
-Incredible Hulk, The 263 Near Mint 1 1887 244
-Incredible Hulk, The 266 Near Mint 1 1888 244
-Incredible Hulk, The 267 Near Mint 1 1889 244
-Incredible Hulk, The 268 Near Mint 1 1890 244
-Incredible Hulk, The 269 Near Mint 1 1891 244
-Incredible Hulk, The 272 Near Mint 1 1892 244
-Incredible Hulk, The (Annual) 8 Near Mint 1 1893 245
-Incredible Hulk, The (Annual) 9 Near Mint 1 1894 245
-Incredible Hulk, The (Annual) 10 Near Mint 1 1895 245
-Adventure Comics 432 Near Mint 1 1896 170
-America vs. The Justice Society 1 Near Mint 1 1897 246
-America vs. The Justice Society 2 Near Mint 1 1898 246
-America vs. The Justice Society 3 Near Mint 1 1899 246
-America vs. The Justice Society 4 Near Mint 1 1900 246
-Blackball Comics 1 Near Mint 1 1901 247
-Blood Syndicate 10 Near Mint 1 1902 21
-Blood Syndicate 16 Near Mint 1 1903 21
-Blood Syndicate 17 Near Mint 1 1904 21
-Books of Magic (regular series) 1 Near Mint 1 1905 435
-Books of Magic (regular series) 2 Near Mint 1 1906 435
-Books of Magic (regular series) 3 Near Mint 1 1907 435
-Cerebus 181 Mother's and Daughter's Near Mint 1 1908 123
-Cerebus 182 Mother's and Daughter's Near Mint 1 1909 123
-Cerebus 183 Mother's and Daughter's Near Mint 1 1910 123
-Cerebus 184 Mother's and Daughter's Near Mint 1 1911 123
-Congorilla 1 Near Mint 1 1912 248
-Congorilla 2 Near Mint 1 1913 248
-Congorilla 3 Near Mint 1 1914 248
-Congorilla 4 Near Mint 1 1915 248
-Damage 1 Near Mint 1 1916 249
-Damage 2 Near Mint 1 1917 249
-Damage 3 Near Mint 1 1918 249
-Damage 4 Near Mint 1 1919 249
-Danger Unlimited 2 Near Mint 1 1920 250
-Danger Unlimited 3 Near Mint 1 1921 250
-Danger Unlimited 4 Near Mint 1 1922 250
-Dark Dominion 2 Near Mint 1 1923 251
-Doom Patrol 35 Near Mint 1 1924 252
-Doom Patrol 36 Near Mint 1 1925 252
-Doom Patrol 70 Near Mint 1 1926 252
-Doom Patrol 71 Near Mint 1 1927 252
-Doom Patrol 72 Near Mint 1 1928 252
-Doom's IV 1 Near Mint 1 1929 253
-Green Lantern (vol. 2) 52 Near Mint 1 1930 49
-Green Lantern (vol. 2) 53 Near Mint 1 1931 49
-Green Lantern (vol. 2) 54 Near Mint 1 1932 49
-Green Lantern (vol. 2) 55 Zero Hour Near Mint 1 1933 49
-Guy Gardner 20 Near Mint 1 1934 69
-Guy Gardner 21 Near Mint 1 1935 69
-Hardware 16 Near Mint 1 1936 22
-Hardware 17 Near Mint 1 1937 22
-Hardware 18 Near Mint 1 1938 22
-Hardware 19 Near Mint 1 1939 22
-Hellblazer 77 Near Mint 1 1940 15
-Hellblazer 78 Near Mint 1 1941 15
-Hellblazer 79 Near Mint 1 1942 15
-Hellblazer 80 Near Mint 1 1943 15
-Hellblazer 81 Near Mint 1 1944 15
-Hellboy: Seeds Of Destruction 2 Near Mint Mike Mignola, has Monkey Man and O'Brian 1 1945 254
-Hellboy: Seeds Of Destruction 3 Near Mint Mike Mignola, has Monkey Man and O'Brian 1 1946 254
-Hellboy: Seeds Of Destruction 4 Near Mint Mike Mignola, has Monkey Man and O'Brian 1 1947 254
-Icon 14 Near Mint 1 1948 17
-Icon 15 World's Collide Near Mint Part 4 1 1949 17
-Icon 16 World's Collide Near Mint Part 11 1 1950 17
-Icon 17 Mothership Connection Near Mint Part 1 1 1951 17
-Invaders, The 1 Near Mint 1 1952 255
-Invaders, The 2 Near Mint 1 1953 255
-Invaders, The 3 Near Mint 1 1954 255
-Invaders, The 4 Near Mint 1 1955 255
-Legion of Super-Heroes (vol. 4) 58 Near Mint 1 1956 145
-Legion of Super-Heroes (vol. 4) 59 Near Mint 1 1957 145
-Legion of Super-Heroes (vol. 4) 60 End of an Era Near Mint Part 3 1 1958 145
-Legionnaires 15 Near Mint 1 1959 11
-Legionnaires 16 Near Mint 1 1960 11
-Legionnaires 17 End of an Era Near Mint Part 1, incorrectly label "conclusion" on cover 1 1961 11
-Legionnaires 18 Zero Hour/End of an Era Near Mint Part 4 1 1962 11
-Legionnaires (Annual) 1 Near Mint 1 1963 257
-L.E.G.I.O.N. 66 Near Mint 1 1964 146
-L.E.G.I.O.N. 67 Near Mint 1 1965 146
-L.E.G.I.O.N. 68 Near Mint 1 1966 146
-L.E.G.I.O.N. 69 Near Mint 1 1967 146
-L.E.G.I.O.N. 70 Near Mint 1 1968 146
-Action Comics 699 Near Mint 1 1969 142
-Action Comics 700 Fall of Metropolis Near Mint 1 1970 142
-Action Comics 701 Fall of Metropolis Near Mint 1 1971 142
-Action Comics 702 Near Mint 1 1972 142
-Superman (vol. 2) 49 Krisis of the Krimson Kryptonite Fine Part 1 1 1973 165
-Superman (vol. 2) 50 Krisis of the Krimson Kryptonite Near Mint Part 4 1 1974 165
-Superman (vol. 2) 89 Near Mint 1 1975 165
-Superman (vol. 2) 90 Near Mint 1 1976 165
-Superman (vol. 2) 91 Near Mint 1 1977 165
-Superman (vol. 2) 92 Near Mint 1 1978 165
-Superman (vol. 2) 93 Zero Hour Near Mint 1 1979 165
-Superman, The Adventures of 472 Krisis of the Krimson Kryptonite Near Mint Part 2 1 1980 51
-Superman, The Adventures of 473 Near Mint Green Lantern 1 1981 51
-Superman, The Adventures of 512 Near Mint 1 1982 51
-Superman, The Adventures of 513 Battle for Metropolis Near Mint 1 1983 51
-Superman, The Adventures of 514 Fall of Metropolis Near Mint 1 1984 51
-Superman, The Adventures of 515 Near Mint 1 1985 51
-Superman, The Adventures of 516 Zero Hour Near Mint 1 1986 51
-Superman, The Adventures of (Annual) 6 Near Mint 1 1987 122
-Superman/Doomsday: Hunter/Prey 1 Near Mint 1 1988 259
-Superman/Doomsday: Hunter/Prey 2 Near Mint 1 1989 259
-Superman/Doomsday: Hunter/Prey 3 Near Mint 1 1990 259
-Superman, The Man of Steel 34 Battle for Metropolis Near Mint 1 1991 18
-Superman, The Man of Steel 35 World's Collide Near Mint Part 1 1 1992 18
-Superman, The Man of Steel 36 World's Collide Near Mint Part 10 1 1993 18
-Superman, The Man of Steel 37 Zero Hour Near Mint 1 1994 18
-Madman Comics 1 Near Mint 1 1995 260
-Madman Comics 2 Near Mint 1 1996 260
-Marvels 0 Near Mint 1 1997 261
-Marvels 1 Near Mint 1 1998 261
-Marvels 2 Near Mint 1 1999 261
-Marvels 3 Near Mint 1 2000 261
-Marvels 4 Near Mint 1 2001 261
-Maxx, The 7 Near Mint 1 2002 2
-Maxx, The 8 Near Mint 1 2003 2
-Miracle Man: Apocrypha 1 Near Mint 1 2004 262
-Miracle Man: Apocrypha 2 Near Mint 1 2005 262
-Miracle Man: Apocrypha 3 Near Mint 1 2006 262
-Moonshadow 1 Near Mint 1 2007 444
-Nexus: Alien Justice 1 Near Mint 1 2008 263
-Nexus: Alien Justice 2 Near Mint 1 2009 263
-Nexus: Alien Justice 3 Near Mint 1 2010 263
-Nexus: The Origin 1 Near Mint 1 2011 264
-Ray, The (regular series) 1 Near Mint 1 2012 265
-Ray, The (regular series) 2 Near Mint 1 2013 265
-Ray, The (regular series) 3 Near Mint 1 2014 265
-Ray, The (regular series) 4 Near Mint 1 2015 265
-Ray, The (regular series) 5 Near Mint 1 2016 265
-Sandman 59 Near Mint 1 2017 10
-Sandman 60 Near Mint 1 2018 10
-Sandman 61 Near Mint 1 2019 10
-Sandman 62 Near Mint 1 2020 10
-Sandman Mystery Theatre 15 Near Mint 1 2021 20
-Sandman Mystery Theatre 16 Near Mint 1 2022 20
-Sandman Mystery Theatre 17 Near Mint 1 2023 20
-Shade, The Changing Man 47 A Season in Hell Near Mint Part 3 1 2024 446
-Shade, The Changing Man 48 A Season in Hell Near Mint Part 4 1 2025 446
-Superman (vol. 2) 20 Near Mint 1 2200 165
-Superman (vol. 2) 22 Fine 1 2201 165
-Superman (vol. 2) 44 Dark Knight over Metropolis Near Mint Part 1 1 2202 165
-Superman (vol. 2) 60 Near Mint 1 2203 165
-Superman (vol. 2) 76 Funeral For a Friend Near Mint Part 4 1 2204 165
-Superman (vol. 2) 77 Funeral For a Friend Near Mint Part 8 1 2205 165
-Superman (vol. 2) 83 Funeral For a Friend Near Mint Epilogue 1 2206 165
-Superman (vol. 2) 84 Near Mint 1 2207 165
-Superman (vol. 2) 85 Near Mint 1 2208 165
-Superman (vol. 2) 86 Near Mint 1 2209 165
-Superman (vol. 2) 87 Bizarro's World Near Mint Part 1 1 2210 165
-Superman (vol. 2) 88 Bizarro's World Near Mint Part 5 1 2211 165
-Superman, The Adventures of 425 Near Mint 1 2212 51
-Superman, The Adventures of 426 Near Mint 1 2213 51
-Superman, The Adventures of 432 Near Mint 1 2214 51
-Superman, The Adventures of 433 Near Mint 1 2215 51
-Superman, The Adventures of 434 Near Mint 1 2216 51
-Superman, The Adventures of 436 Near Mint 1 2217 51
-Superman, The Adventures of 438 Near Mint 1 2218 51
-Superman, The Adventures of 440 Near Mint 1 2219 51
-Superman, The Adventures of 444 Supergirl Saga Near Mint Part 2 1 2220 51
-Superman, The Adventures of 445 Near Mint 1 2221 51
-Superman, The Adventures of 467 Dark Knight over Metropolis Near Mint Part 2 1 2222 51
-Superman, The Adventures of 499 Funeral For a Friend Near Mint Part 5 1 2223 51
-Superman, The Adventures of 500 Near Mint 1 2224 51
-Superman, The Adventures of 501 Reign of the Supermen Near Mint 1 2225 51
-Superman, The Adventures of 502 Reign of the Supermen Near Mint 1 2226 51
-Superman, The Adventures of 503 Reign of the Supermen Near Mint 1 2227 51
-Superman, The Adventures of 504 Reign of the Supermen Near Mint 1 2228 51
-Superman, The Adventures of 505 Near Mint 1 2229 51
-Superman, The Adventures of 506 Near Mint 1 2230 51
-Superman, The Adventures of 507 Spilled Blood Near Mint First Cut 1 2231 51
-Superman, The Adventures of 508 Near Mint 1 2232 51
-Superman, The Adventures of 509 Near Mint 1 2233 51
-Superman, The Adventures of 510 Bizarro's World Near Mint Part 2 1 2234 51
-Superman, The Adventures of 511 Near Mint 1 2235 51
-Superman: The Legacy of Superman 1 Near Mint 1 2236 297
-Superman, The Man of Steel 20 Funeral For a Friend Near Mint Part 3 1 2237 18
-Superman, The Man of Steel 21 Funeral For a Friend Near Mint Part 7 1 2238 18
-Superman, The Man of Steel 27 Near Mint 1 2239 18
-Superman, The Man of Steel 28 Near Mint 1 2240 18
-Superman, The Man of Steel 29 Spilled Blood Near Mint Final Cut 1 2241 18
-Superman, The Man of Steel 30 Near Mint 1 2242 18
-Superman, The Man of Steel 31 Near Mint 1 2243 18
-Superman, The Man of Steel 32 Bizarro's World Near Mint Part 4 1 2244 18
-Superman, The Man of Steel 33 Near Mint 1 2245 18
-Zero Hour: Crisis in Time 4 Near Mint 1 2246 280
-Zero Hour: Crisis in Time 3 Near Mint 1 2247 280
-Zero Hour: Crisis in Time 2 Near Mint 1 2248 280
-Zero Hour: Crisis in Time 1 Near Mint 1 2249 280
-Stanley and His Monster 2 Near Mint 1 2250 31
-Stanley and His Monster 1 Near Mint Signed by Phil Foglio 1 2251 31
-S.T.A.R. Corps 1 Near Mint 1 2252 298
-Starman 28 Krisis of the Krimson Kryptonite Near Mint Part 2A 1 2253 299
-Valor 4 Near Mint 1 2254 13
-Valor 5 Near Mint 1 2255 13
-Valor 13 D.O.A. Near Mint Part 2 1 2256 13
-Valor 14 D.O.A. Near Mint Part 3 1 2257 13
-Valor 15 D.O.A. Near Mint Part 4 1 2258 13
-Valor 16 D.O.A. Near Mint Part 5 1 2259 13
-Valor 18 D.O.A. Near Mint Aftermath 1 2260 13
-Valor 19 Near Mint 1 2261 13
-Warriors of Plasm 2 Near Mint 1 2262 76
-Warriors of Plasm 3 Near Mint 1 2263 76
-Warriors of Plasm 4 Near Mint 1 2264 76
-Warriors of Plasm 5 Near Mint 1 2265 76
-Who's Who in the Legion of Super Heroes 1 Near Mint 1 2266 104
-Who's Who in the Legion of Super Heroes 2 Near Mint 1 2267 104
-World of Metropolis 1 Near Mint 1 2268 118
-World of Smallville 3 Near Mint 1 2269 119
-Silver Star 4 Near Mint Kirby 1 2270 300
-Shade, The Changing Man 42 Near Mint 1 2271 446
-Shade, The Changing Man 43 Near Mint 1 2272 446
-Shade, The Changing Man 44 Near Mint 1 2273 446
-Shade, The Changing Man 45 A Season in Hell Near Mint Part 1 1 2274 446
-Shade, The Changing Man 46 A Season in Hell Near Mint Part 2 1 2275 446
-Hellblazer 1 Near Mint 1 2276 15
-Hellblazer 73 Near Mint 1 2277 15
-Hellblazer 74 Near Mint 1 2278 15
-Hellblazer 75 Near Mint 1 2279 15
-Hellblazer 76 Near Mint 1 2280 15
-Hellblazer Special 1 Near Mint 1 2281 301
-Hawkman (vol. 2) 13 Zero Hour Near Mint 1 2282 302
-Zero Hour: Crisis in Time 0 Zero Hour Near Mint 1 2283 280
-Superman (vol. 2) 54 Time and Time Again Near Mint Phase 3 1 2284 165
-Sandman 63 Kindly Ones, The Near Mint 1 2285 10
-Invisibles 1 Near Mint Morrison 1 2286 303
-Madman Comics 3 Near Mint 1 2287 260
-Static 15 Near Mint 1 2288 33
-Detective Comics 678 Zero Hour Near Mint 1 2289 304
-Lone Ranger and Tonto, The 1 Near Mint 1 of 4 1 2290 305
-Dark Horse Presents 88 Near Mint Hellboy by Mignola 1 2291 306
-Phantom Force 6 Near Mint 1 2292 155
-Books of Magic (regular series) 4 Near Mint 1 2293 435
-Books of Magic (regular series) 5 Near Mint 1 2294 435
-New Gods 8 Reading Kirby 1 2295 84
-New Gods 10 Reading Kirby 1 2296 84
-New Gods 11 Reading Kirby, new material 1 2297 84
-Demon, The (vol. 1) 14 Reading Kirby 1 2298 135
-Black Panther 3 Near Mint Kirby 1 2299 80
-Black Panther 4 Near Mint Kirby 1 2300 80
-Devil Dinosaur 4 Near Mint Kirby 1 2301 308
-Machine Man 1 Near Mint Kirby 3 2302 309
-Machine Man 2 Near Mint Kirby 3 2303 309
-Machine Man 3 Near Mint Kirby 3 2304 309
-Machine Man 4 Near Mint Kirby 2 2305 309
-Machine Man 5 Near Mint Kirby 2 2306 309
-Machine Man 6 Near Mint Kirby 2 2307 309
-Machine Man 7 Near Mint Kirby 2 2308 309
-Machine Man 8 Near Mint Kirby 2 2309 309
-Machine Man 9 Near Mint Kirby 2 2310 309
-Machine Man 10 Near Mint Ditko 2 2311 309
-Machine Man 11 Near Mint Ditko 1 2312 309
-Machine Man 12 Near Mint Ditko 1 2313 309
-Machine Man 13 Near Mint Ditko 1 2314 309
-Machine Man 14 Near Mint Ditko 1 2315 309
-Machine Man 15 Near Mint Ditko 1 2316 309
-Machine Man 17 Near Mint Ditko 1 2317 309
-Machine Man 18 Near Mint Ditko 1 2318 309
-Machine Man 19 Near Mint Ditko 1 2319 309
-Captain Victory 13 Near Mint Kirby 2 2320 200
-Silver Star 1 Near Mint Kirby 1 2321 300
-Silver Star 2 Near Mint Kirby 1 2322 300
-Silver Star 3 Near Mint Kirby 2 2323 300
-Silver Star 5 Near Mint Kirby 1 2324 300
-Silver Star 6 Near Mint Kirby 1 2325 300
-Kamandi 12 Near Mint Kirby 1 2326 72
-Wolverine (mini-series) 1 Near Mint Miller 1 2327 310
-Wolverine (mini-series) 2 Near Mint Miller 1 2328 310
-Wolverine (mini-series) 3 Near Mint Miller 1 2329 310
-Clash 1 Reading 1 2330 311
-Clash 2 Reading 1 2331 311
-Clash 3 Reading 1 2332 311
-Classics Illustrated 4 Near Mint Sienkiewicz, Moby Dick 1 2333 312
-Classics Illustrated 3 Near Mint Baker, Through the Looking Glass 1 2334 312
-Lone Wolf and Cub 19 Near Mint 1 2335 313
-Lone Wolf and Cub 20 Near Mint 1 2336 313
-Horobi 1 Near Mint 1 2337 314
-Black Orchid (mini-series) 1 Near Mint Gaiman, McKean 1 2338 315
-Black Orchid (mini-series) 2 Near Mint Gaiman, McKean 1 2339 315
-Black Orchid (mini-series) 3 Near Mint Gaiman, McKean 1 2340 315
-Justice Inc. (mini-series) 1 Near Mint Baker 1 2341 316
-Justice Inc. (mini-series) 2 Near Mint Baker 1 2342 316
-Batman: The Dark Knight Returns 1 Near Mint Miller, second printing 1 2343 317
-Batman: The Dark Knight Returns 3 Near Mint Miller 1 2344 317
-Batman: The Dark Knight Returns 4 Near Mint Miller 1 2345 317
-Give Me Liberty 1 Near Mint Gibbons, Miller story 1 2346 318
-Give Me Liberty 2 Near Mint Gibbons, Miller story 1 2347 318
-Give Me Liberty 3 Near Mint Gibbons, Miller story 1 2348 318
-Give Me Liberty 4 Near Mint Gibbons, Miller story 1 2349 318
-Nausicaa of the Vally of Wind (vol. 2) 1 Near Mint 1 2350 319
-Action Comics 663 Time and Time Again Near Mint Phase 2 1 2351 142
-Superman (vol. 2) 55 Time and Time Again Near Mint Phase 6 1 2352 165
-Superman, The Adventures of 476 Time and Time Again Near Mint Phase 1 1 2353 51
-Ambush Bug Stocking Stuffer 1 Near Mint 1 2354 320
-Iceman (mini-series) 1 Near Mint 1 2355 321
-Iceman (mini-series) 2 Near Mint 1 2356 321
-Iceman (mini-series) 3 Near Mint 1 2357 321
-Iron FIst 15 Near Mint 2nd Byrne X-men, first full story 1 2358 322
-Swamp Thing (Vol. 2) 1 Near Mint 2 2359 107
-Swamp Thing (Vol. 2) 3 Near Mint 1 2360 107
-'Mazing Man Winter Special 2 Near Mint 1 2361 344
-Ambush Bug, Son of 6 Near Mint 1 2362 387
-Doc Stern...Mister Monster 2 Near Mint 1 2363 352
-Doc Stern...Mister Monster 3 Near Mint 1 2364 352
-E-Man, The Original 2 Near Mint 1 2365 373
-Shade, The Changing Man 49 A Season in Hell Near Mint Part 5 1 2026 446
-Shade, The Changing Man 50 A Season in Hell Near Mint Part 6 1 2027 446
-Shade, The Changing Man 51 Near Mint 1 2028 446
-Shadow Cabinet 0 Near Mint 1 2029 266
-Shaman's Tears 1 Near Mint 1 2030 267
-Shaman's Tears 2 Near Mint 1 2031 267
-Sin City: A Dame to Kill For 1 Near Mint 1 2032 268
-Sin City: A Dame to Kill For 2 Near Mint 1 2033 268
-Sin City: A Dame to Kill For 3 Near Mint 1 2034 268
-Sin City: A Dame to Kill For 4 Near Mint 1 2035 268
-Sin City: A Dame to Kill For 5 Near Mint 1 2036 268
-Sin City: A Dame to Kill For 6 Near Mint 1 2037 268
-Spawn/Batman 1 Near Mint 1 2038 269
-Steel 4 Near Mint 1 2039 121
-Steel 5 Near Mint 1 2040 121
-Steel 6 World's Collide Near Mint Part 5 1 2041 121
-Steel 7 World's Collide Near Mint Part 12 1 2042 121
-Steel (Annual) 1 Near Mint 1 2043 270
-Superboy (vol. 2) 5 Near Mint 1 2044 120
-Superboy (vol. 2) 6 World's Collide Near Mint Part 3 1 2045 120
-Superboy (vol. 2) 7 World's Collide Near Mint Part 7 1 2046 120
-Superboy (vol. 2) 8 Zero Hour Near Mint 1 2047 120
-Superboy (vol. 2) (Annual) 1 Near Mint 1 2048 271
-Teen Agents, Jack Kirby's 1 Near Mint 1 2049 272
-Valor 20 Near Mint 1 2050 13
-Valor 21 Near Mint 1 2051 13
-Valor 22 End of an Era Near Mint Part 2 1 2052 13
-Valor 23 Zero Hour/End of an Era Near Mint Part 5 1 2053 13
-Vamps 1 Near Mint 1 2054 273
-Victory 1 Near Mint 1 2055 274
-Vertigo Visions: Dr. Occult 1 Near Mint 1 2056 275
-Vertigo Visions: The Geek 1 Near Mint 1 2057 6
-Wetworks 1 Near Mint 1 2058 276
-Wildstar 2 Near Mint 1 2059 277
-Witchcraft 1 Near Mint 1 2060 278
-Witchcraft 2 Near Mint 1 2061 278
-Witchcraft 3 Near Mint 1 2062 278
-Worlds Collide 1 Near Mint 1 2063 279
-Action Comics 670 Near Mint Armageddon tie-in 1 2064 142
-Action Comics 659 Krisis of the Krimson Kryptonite Near Mint Part 3 1 2065 142
-Superman (vol. 2) 61 Near Mint Waverider/Linear Men appearance 1 2066 165
-Action Comics 647 Brainiac Trilogy Near Mint Part I 1 2067 142
-Action Comics 648 Brainiac Trilogy Near Mint Part II 1 2068 142
-Action Comics 649 Brainiac Trilogy Near Mint Part III 1 2069 142
-Blasters Special 1 Near Mint Invasion Tie-in 1 2070 285
-Blood Syndicate 1 Near Mint 1 2071 21
-Blood Syndicate 2 Near Mint 1 2072 21
-Doc Stern...Mr. Monster 4 Near Mint 1 2073 286
-Danger Unlimited 1 Near Mint 1 2074 250
-Dark Dominion 1 Near Mint 1 2075 251
-Dark Dominion 0 Near Mint Set of cards in first edition binder. 1 2076 251
-Infinity, Inc. 1 Near Mint 1 2077 287
-Infinity, Inc. 3 Near Mint 1 2078 287
-Justice League America (Annual) 4 Near Mint Justice League Antartica 1 2079 288
-Justice Leauge Quarterly 5 Near Mint 1 2080 28
-Justice Society of America 7 Near Mint 1 2081 25
-Justice Society of America 8 Near Mint 1 2082 25
-Last of the Viking Heroes 1 Near Mint Kirby Cover 1 2083 290
-Action Comics 584 Near Mint First Post-Crisis Action Comics 1 2084 142
-Action Comics 585 Near Mint 1 2085 142
-Action Comics 586 Near Mint 1 2086 142
-Action Comics 587 Near Mint 1 2087 142
-Action Comics 588 Near Mint 1 2088 142
-Action Comics 591 Death of Superboy Near Mint 1 2089 142
-Action Comics 594 Near Mint 1 2090 142
-Action Comics 595 Near Mint First Silver Banshee 1 2091 142
-Action Comics 596 Near Mint 1 2092 142
-Action Comics 597 Near Mint 1 2093 142
-Action Comics 645 Near Mint 1 2094 142
-Action Comics 662 Near Mint Lois finds out on last page 1 2095 142
-Action Comics 674 Panic in the Sky Near Mint Prologue, featuringSupergirl 1 2096 142
-Action Comics 675 Panic in the Sky Near Mint Fourth Strike 1 2097 142
-Action Comics 683 Near Mint 1 2098 142
-Action Comics 684 Doomsday Near Mint 1 2099 142
-Action Comics 685 Funeral For a Friend Near Mint Part 2, featuring Supergirl 1 2100 142
-Action Comics 686 Funeral For a Friend Near Mint Part 6, featuring Supergirl 1 2101 142
-Action Comics 692 Near Mint 1 2102 142
-Action Comics 693 Near Mint 1 2103 142
-Action Comics 694 Spilled Blood Near Mint Second Cut 1 2104 142
-Action Comics 695 Near Mint 1 2105 142
-Action Comics 696 Near Mint 1 2106 142
-Action Comics 697 Bizarro's World Near Mint Part 3 1 2107 142
-Action Comics 698 Near Mint 1 2108 142
-Action Comics 703 Zero Hour Near Mint 1 2109 142
-Action Comics 2 Near Mint 1 2110 142
-Cerebus 185 Mother's and Daughter's Near Mint 1 2111 123
-Cerebus Jam 1 Near Mint 1 2112 291
-Damage 6 Zero Hour Near Mint 1 2113 249
-Darkstars 13 Near Mint 1 2114 3
-Darkstars 14 Near Mint 1 2115 3
-Darkstars 15 Near Mint 1 2116 3
-Darkstars 16 Near Mint 1 2117 3
-Green Lantern (vol. 2) 47 Near Mint 1 2118 49
-Green Lantern (vol. 2) 48 Emerald Twilight Near Mint Part 1 1 2119 49
-Green Lantern (vol. 2) 51 Near Mint 1 2120 49
-Icon 7 Near Mint 1 2121 17
-Icon 8 Near Mint 1 2122 17
-Icon 9 Shadow War Near Mint 1 2123 17
-Icon 11 Near Mint 1 2124 17
-Icon 12 Near Mint 1 2125 17
-Icon 13 Near Mint 1 2126 17
-Legionnaires 8 Near Mint 1 2127 11
-Legionnaires 9 Near Mint 1 2128 11
-Legionnaires 10 Near Mint 1 2129 11
-Legionnaires 11 Near Mint 1 2130 11
-Legionnaires 12 Near Mint 1 2131 11
-Legionnaires 13 Near Mint 1 2132 11
-Legionnaires 14 Near Mint 1 2133 11
-Legion of Super-Heroes (vol. 4) 49 Near Mint 1 2134 145
-Legion of Super-Heroes (vol. 4) 50 Near Mint 1 2135 145
-Legion of Super-Heroes (vol. 4) 51 Near Mint 1 2136 145
-Legion of Super-Heroes (vol. 4) 52 Near Mint 1 2137 145
-Legion of Super-Heroes (vol. 4) 53 Near Mint 1 2138 145
-Legion of Super-Heroes (vol. 4) 54 Near Mint 1 2139 145
-Legion of Super-Heroes (vol. 4) 55 Near Mint 1 2140 145
-Legion of Super-Heroes (vol. 4) 56 Near Mint 1 2141 145
-Legion of Super-Heroes (vol. 4) 57 Near Mint 1 2142 145
-Legion of Super-Heroes (vol. 4) 61 Zero Hour/End of an Era Near Mint Part 6 1 2143 145
-Legion of Super-Heroes (vol. 3) 12 Near Mint 2 2144 147
-Legion of Super-Heroes (vol. 3) 14 Near Mint 2 2145 147
-Legion of Super-Heroes (vol. 3) 21 Near Mint 1 2146 147
-Legion of Super-Heroes (vol. 3) 38 Near Mint 1 2147 147
-Legion of Super-Heroes (vol. 3) (Annual) 4 Near Mint 1 2148 292
-L.E.G.I.O.N. 65 Near Mint 1 2149 146
-Miracle Man 7 Near Mint 1 2150 92
-Monster Menace 1 Near Mint 1 2151 158
-Monster Menace 4 Near Mint 1 2152 158
-Robin 3000 2 Near Mint 1 2153 293
-Robin 3000 1 Near Mint 1 2154 293
-Secret Origins (vol. 2) 8 Near Mint LSH tie-in, Shadow Lass 1 2155 143
-Secret Origins (vol. 2) 25 Near Mint LSH tie-in, LSH 1 2156 143
-Secret Origins (vol. 2) 37 Near Mint LSH tie-in, Legion of Substitue-Heroes 1 2157 143
-Secret Origins (vol. 2) 42 Near Mint LSH tie-in, Phantom Girl 1 2158 143
-Secret Origins (vol. 2) 49 Near Mint LSH tie-in, Bouncing Boy, Newsboy Legion 1 2159 143
-Shadow, The (mini-series) 2 Near Mint 1 2160 95
-Shadow, The (mini-series) 1 Near Mint 1 2161 95
-Shadow Stikes, The 12 Near Mint 1 2162 133
-Shadow Stikes, The 13 Near Mint 1 2163 133
-Spawn 6 Near Mint 1 2164 30
-Spawn 7 Near Mint 1 2165 30
-Spider-Man 2099 5 Near Mint 1 2166 9
-Spider-Man 2099 6 Near Mint 1 2167 9
-Maxx, The 6 Near Mint 1 2168 2
-Static 5 Near Mint 1 2169 33
-Static 6 Near Mint 1 2170 33
-Static 7 Near Mint 1 2171 33
-Static 8 Shadow War Near Mint 1 2172 33
-Static 13 Near Mint 1 2173 33
-Static 14 World's Collide Near Mint 1 2174 33
-Steel 2 Near Mint 1 2175 121
-Steel 3 Near Mint 1 2176 121
-Steel 8 Near Mint 1 2177 121
-Superboy (vol. 2) 1 Near Mint 1 2178 120
-Superboy (vol. 2) 3 Near Mint 1 2179 120
-Superboy (vol. 2) 4 Near Mint 1 2180 120
-Supergirl 1 Near Mint 1 2181 5045
-Supergirl 2 Near Mint 1 2182 5045
-Supergirl 3 Near Mint 1 2183 5045
-Supergirl 4 Near Mint 1 2184 5045
-Superman (vol. 1) 423 Reading Alan Moore, Last Superman Story 1 2185 296
-Superman (vol. 2) 4 Near Mint 1 2186 165
-Superman (vol. 2) 5 Near Mint 1 2187 165
-Superman (vol. 2) 6 Near Mint 1 2188 165
-Superman (vol. 2) 7 Near Mint 1 2189 165
-Superman (vol. 2) 9 Near Mint 1 2190 165
-Superman (vol. 2) 11 Near Mint 1 2191 165
-Superman (vol. 2) 12 Near Mint 1 2192 165
-Superman (vol. 2) 13 Near Mint 1 2193 165
-Superman (vol. 2) 14 Near Mint 1 2194 165
-Superman (vol. 2) 15 Near Mint 1 2195 165
-Superman (vol. 2) 16 Near Mint 1 2196 165
-Superman (vol. 2) 17 Near Mint 1 2197 165
-Superman (vol. 2) 18 Near Mint 1 2198 165
-Superman (vol. 2) 19 Near Mint 1 2199 165
-Fantastic Four 236 Near Mint 1 1692 226
-Fantastic Four 237 Near Mint 1 1693 226
-Fantastic Four 238 Near Mint 1 1694 226
-Fantastic Four 239 Near Mint 1 1695 226
-Fantastic Four 240 Near Mint 1 1696 226
-Fantastic Four 241 Near Mint 1 1697 226
-Fantastic Four 242 Near Mint 1 1698 226
-Fantastic Four 243 Near Mint 1 1699 226
-Fantastic Four 244 Near Mint 1 1700 226
-Fantastic Four 245 Near Mint 1 1701 226
-Fantastic Four 246 Near Mint 2 1702 226
-Fantastic Four 247 Near Mint 1 1703 226
-Fantastic Four 248 Near Mint 1 1704 226
-Fantastic Four 249 Near Mint 1 1705 226
-Fantastic Four 250 Near Mint 1 1706 226
-Fantastic Four 251 Near Mint 1 1707 226
-Fantastic Four 274 Near Mint 1 1708 226
-Fantastic Four 275 Near Mint 1 1709 226
-Fantastic Four 276 Near Mint 1 1710 226
-Fantastic Four 277 Near Mint 1 1711 226
-Fantastic Four 278 Near Mint 1 1712 226
-Fantastic Four 279 Near Mint 1 1713 226
-Fantastic Four (Annual) 12 Near Mint 1 1714 227
-Fantastic Four (Annual) 13 Near Mint 1 1715 227
-Fantastic Four (Annual) 14 Near Mint 2 1716 227
-Fantastic Four (Annual) 15 Near Mint 1 1717 227
-Fantastic Four (Annual) 16 Near Mint 1 1718 227
-Fantastic Four Roast 1 Near Mint 1 1719 228
-Fantasy Masterpieces (vol. 2) 1 Near Mint 7 1720 229
-Fantasy Masterpieces (vol. 2) 2 Near Mint 1 1721 229
-Fantasy Masterpieces (vol. 2) 3 Near Mint 3 1722 229
-Fantasy Masterpieces (vol. 2) 4 Near Mint 1 1723 229
-Fantasy Masterpieces (vol. 2) 5 Near Mint 2 1724 229
-Fantasy Masterpieces (vol. 2) 6 Near Mint 1 1725 229
-Fantasy Masterpieces (vol. 2) 7 Near Mint 1 1726 229
-Fantasy Masterpieces (vol. 2) 8 Near Mint 1 1727 229
-Fantasy Masterpieces (vol. 2) 9 Near Mint 1 1728 229
-Fantasy Masterpieces (vol. 2) 10 Near Mint 1 1729 229
-Fantasy Masterpieces (vol. 2) 11 Near Mint 1 1730 229
-Fantasy Masterpieces (vol. 2) 12 Near Mint 1 1731 229
-Fantasy Masterpieces (vol. 2) 13 Near Mint 1 1732 229
-Firestorm, The Fury Of 1 Near Mint 3 1733 230
-Firestorm, The Fury Of 2 Near Mint 1 1734 230
-Firestorm, The Fury Of 3 Near Mint 1 1735 230
-Firestorm, The Fury Of 4 Near Mint 1 1736 230
-Firestorm, The Fury Of 5 Near Mint 1 1737 230
-Firestorm, The Fury Of 6 Near Mint 1 1738 230
-Firestorm, The Fury Of 7 Near Mint 1 1739 230
-Firestorm, The Fury Of 8 Near Mint 1 1740 230
-Firestorm, The Fury Of 9 Near Mint 1 1741 230
-Firestorm, The Fury Of 10 Near Mint 1 1742 230
-Firestorm, The Fury Of 11 Near Mint 1 1743 230
-Firestorm, The Fury Of 12 Near Mint 1 1744 230
-Firestorm, The Fury Of 13 Near Mint 1 1745 230
-Firestorm, The Fury Of 14 Near Mint 1 1746 230
-Firestorm, The Fury Of 15 Near Mint 1 1747 230
-Firestorm, The Fury Of 16 Near Mint 1 1748 230
-Firestorm, The Fury Of 17 Near Mint 1 1749 230
-Firestorm, The Fury Of 18 Near Mint 1 1750 230
-Firestorm, The Fury Of 19 Near Mint 1 1751 230
-Firestorm, The Fury Of 30 Near Mint 1 1752 230
-Firestorm, The Fury Of 32 Near Mint 1 1753 230
-Firestorm, The Fury Of 33 Near Mint 1 1754 230
-Firestorm, The Fury Of 34 Near Mint 1 1755 230
-Firestorm, The Fury Of (Annual) 2 Near Mint 1 1756 231
-Firestorm, The Fury Of (Annual) 3 Near Mint 1 1757 231
-1st Issue Special 8 Near Mint 1 1758 134
-Forever People (mini-series) 1 Near Mint 1 1759 232
-Forever People (mini-series) 2 Near Mint 1 1760 232
-Forever People (mini-series) 3 Near Mint 1 1761 232
-Forever People (mini-series) 4 Near Mint 1 1762 232
-Forever People (mini-series) 5 Near Mint 1 1763 232
-Forever People (mini-series) 6 Near Mint 1 1764 232
-Francis, Brother of the Universe 1 Near Mint 1 1765 233
-Ghost Rider 35 Near Mint 2 1766 234
-Green Arrow 16 Near Mint 1 1767 235
-Green Arrow 20 Near Mint 1 1768 235
-Green Lantern (vol. 1) 67 Near Mint 1 1769 67
-Green Lantern (vol. 1) 90 Near Mint 1 1770 67
-Green Lantern (vol. 1) 91 Near Mint 1 1771 67
-Green Lantern (vol. 1) 92 Near Mint 1 1772 67
-Green Lantern (vol. 1) 93 Near Mint 1 1773 67
-Green Lantern (vol. 1) 94 Near Mint 1 1774 67
-Green Lantern (vol. 1) 95 Near Mint 1 1775 67
-Green Lantern (vol. 1) 96 Near Mint 1 1776 67
-Green Lantern (vol. 1) 97 Near Mint 1 1777 67
-Green Lantern (vol. 1) 98 Near Mint 1 1778 67
-Green Lantern (vol. 1) 99 Near Mint 1 1779 67
-Green Lantern (vol. 1) 100 Near Mint 1 1780 67
-Green Lantern (vol. 1) 101 Near Mint 1 1781 67
-Green Lantern (vol. 1) 102 Near Mint 1 1782 67
-Green Lantern (vol. 1) 103 Near Mint 1 1783 67
-Green Lantern (vol. 1) 104 Near Mint 1 1784 67
-Green Lantern (vol. 1) 105 Near Mint 1 1785 67
-Green Lantern (vol. 1) 106 Near Mint 1 1786 67
-Green Lantern (vol. 1) 107 Near Mint 1 1787 67
-Green Lantern (vol. 1) 108 Near Mint 1 1788 67
-Green Lantern (vol. 1) 109 Near Mint 1 1789 67
-Green Lantern (vol. 1) 110 Near Mint 1 1790 67
-Green Lantern (vol. 1) 111 Near Mint 1 1791 67
-Green Lantern (vol. 1) 112 Near Mint 1 1792 67
-Green Lantern (vol. 1) 113 Near Mint 1 1793 67
-Green Lantern (vol. 1) 114 Near Mint 1 1794 67
-Green Lantern (vol. 1) 115 Near Mint 1 1795 67
-Green Lantern (vol. 1) 116 Near Mint 1 1796 67
-Green Lantern (vol. 1) 117 Near Mint 1 1797 67
-Green Lantern (vol. 1) 118 Near Mint 1 1798 67
-Green Lantern (vol. 1) 119 Near Mint 1 1799 67
-Green Lantern (vol. 1) 121 Near Mint 1 1800 67
-Green Lantern (vol. 1) 122 Near Mint 1 1801 67
-Green Lantern (vol. 1) 123 Near Mint 1 1802 67
-Green Lantern (vol. 1) 124 Near Mint 1 1803 67
-Green Lantern (vol. 1) 125 Near Mint 1 1804 67
-Green Lantern (vol. 1) 126 Near Mint 1 1805 67
-Green Lantern (vol. 1) 127 Near Mint 1 1806 67
-Green Lantern (vol. 1) 128 Near Mint 1 1807 67
-Green Lantern (vol. 1) 129 Near Mint 1 1808 67
-Green Lantern (vol. 1) 130 Near Mint 1 1809 67
-Green Lantern (vol. 1) 131 Near Mint 1 1810 67
-Green Lantern (vol. 1) 133 Near Mint 1 1811 67
-Green Lantern (vol. 1) 134 Near Mint 1 1812 67
-Green Lantern (vol. 1) 137 Near Mint 1 1813 67
-Groo the Wanderer 1 Near Mint 1 1814 236
-Hawkman Special 1 Near Mint 1 1815 237
-Hall of Fame Featuring the T.H.U.N.D.E.R 2 Near Mint 1 1816 238
-Hercules 1 Near Mint 1 1817 239
-Hercules 2 Near Mint 1 1818 239
-Hercules 3 Near Mint 1 1819 239
-Hercules 4 Near Mint 1 1820 239
-Heroes for Hope 1 Near Mint 1 1821 240
-Howard the Duck 1 Near Mint 1 1822 241
-Howard the Duck 2 Near Mint 1 1823 241
-Howard the Duck 3 Near Mint 1 1824 241
-Howard the Duck 4 Near Mint 1 1825 241
-Howard the Duck 5 Near Mint 1 1826 241
-Howard the Duck 6 Near Mint 1 1827 241
-Howard the Duck 7 Near Mint 1 1828 241
-Howard the Duck 8 Near Mint 1 1829 241
-Howard the Duck 9 Near Mint 1 1830 241
-Howard the Duck 10 Near Mint 1 1831 241
-Howard the Duck 11 Near Mint 1 1832 241
-Howard the Duck 12 Near Mint 1 1833 241
-Howard the Duck 13 Near Mint 1 1834 241
-Howard the Duck 14 Near Mint 1 1835 241
-Howard the Duck 15 Near Mint 1 1836 241
-Howard the Duck 16 Near Mint 1 1837 241
-Howard the Duck 17 Near Mint 1 1838 241
-Howard the Duck 18 Near Mint 1 1839 241
-Howard the Duck 19 Near Mint 1 1840 241
-Howard the Duck 20 Near Mint 1 1841 241
-Howard the Duck 21 Near Mint 1 1842 241
-Howard the Duck 22 Near Mint 1 1843 241
-Howard the Duck 23 Near Mint 1 1844 241
-Howard the Duck 24 Near Mint 1 1845 241
-Howard the Duck 25 Near Mint 1 1846 241
-Howard the Duck 26 Near Mint 1 1847 241
-Howard the Duck 27 Near Mint 1 1848 241
-Howard the Duck 28 Near Mint 1 1849 241
-Howard the Duck 29 Near Mint 1 1850 241
-Howard the Duck 30 Near Mint 1 1851 241
-Howard the Duck 31 Near Mint 1 1852 241
-Howard the Duck 32 Near Mint 1 1853 241
-Howard the Duck 33 Near Mint 1 1854 241
-Iron Man 111 Near Mint 1 2366 1
-Iron Man 112 Near Mint 1 2367 1
-Iron Man 113 Near Mint 1 2368 1
-Iron Man 114 Near Mint 1 2369 1
-Iron Man 115 Near Mint 1 2370 1
-Iron Man 116 Near Mint 1 2371 1
-Iron Man 117 Near Mint 1 2372 1
-Iron Man 118 Near Mint 1 2373 1
-Iron Man 119 Near Mint 1 2374 1
-Iron Man 120 Near Mint 1 2375 1
-Iron Man 121 Near Mint 1 2376 1
-Iron Man 122 Near Mint 1 2377 1
-Iron Man 123 Near Mint 1 2378 1
-Iron Man 124 Near Mint 1 2379 1
-Iron Man 125 Near Mint 1 2380 1
-Iron Man 126 Near Mint 1 2381 1
-Iron Man 127 Near Mint 1 2382 1
-Iron Man 128 Near Mint 1 2383 1
-Iron Man 129 Near Mint 1 2384 1
-Iron Man 130 Near Mint 1 2385 1
-Iron Man 131 Near Mint 1 2386 1
-Iron Man 132 Near Mint 1 2387 1
-Iron Man 133 Near Mint 1 2388 1
-Iron Man 134 Near Mint 1 2389 1
-Iron Man 135 Near Mint 1 2390 1
-Iron Man 136 Near Mint 1 2391 1
-Iron Man 137 Near Mint 1 2392 1
-Iron Man 138 Near Mint 1 2393 1
-Iron Man 139 Near Mint 1 2394 1
-Iron Man 143 Near Mint 1 2395 1
-Iron Man 145 Near Mint 2 2396 1
-Iron Man 146 Near Mint 1 2397 1
-Iron Man 147 Near Mint 1 2398 1
-Iron Man 148 Near Mint 1 2399 1
-Iron Man 149 Near Mint 1 2400 1
-Iron Man 150 Near Mint 1 2401 1
-Iron Man 153 Near Mint 1 2402 1
-Iron Man 154 Near Mint 1 2403 1
-Iron Man 155 Near Mint 1 2404 1
-Iron Man 174 Near Mint 1 2405 1
-Iron Man 195 Near Mint 1 2406 1
-Justice League America 27 Reading 1 2407 12
-Justice League America 28 Reading 1 2408 12
-Justice League America 29 Reading 1 2409 12
-Justice League America 30 Reading 1 2410 12
-Justice League Europe 3 Near Mint 1 2411 323
-Justice League Europe 4 Near Mint 1 2412 323
-Justice League Europe 5 Near Mint 1 2413 323
-Justice League Europe 6 Near Mint 1 2414 323
-Kamandi 42 Reading 1 2415 72
-Kamandi 43 Reading 1 2416 72
-Kamandi 46 Reading 1 2417 72
-Kamandi 47 Reading 1 2418 72
-Kamandi 48 Reading 1 2419 72
-Kazar the Savage 1 Near Mint 2 2420 324
-Kazar the Savage 3 Near Mint 1 2421 324
-Kazar the Savage 4 Near Mint 1 2422 324
-King Conan 1 Near Mint 2 2423 325
-King Conan 2 Near Mint 1 2424 325
-King Conan 3 Near Mint 1 2425 325
-King Conan 5 Near Mint 1 2426 325
-King Conan 6 Near Mint 1 2427 325
-King Conan 7 Near Mint 1 2428 325
-King Conan 8 Near Mint 1 2429 325
-Kitty Pride and Wolverine 1 Near Mint 1 2430 326
-Kitty Pride and Wolverine 2 Near Mint 1 2431 326
-Kitty Pride and Wolverine 3 Near Mint 1 2432 326
-Kitty Pride and Wolverine 4 Near Mint 1 2433 326
-Kitty Pride and Wolverine 5 Near Mint 1 2434 326
-Legion of Super-Heroes Special 1 Near Mint 1 2435 327
-Machine Man (mini-series) 3 Near Mint 1 2436 328
-Machine Man (mini-series) 4 Near Mint 1 2437 328
-Man-Thing 1 Near Mint 8 2438 329
-Man-Thing 2 Near Mint 2 2439 329
-Man-Thing 3 Near Mint 3 2440 329
-Man-Thing 4 Near Mint 1 2441 329
-Martian Manhunter (mini-series) 1 Near Mint 1 2442 331
-Martian Manhunter (mini-series) 2 Near Mint 1 2443 331
-Martian Manhunter (mini-series) 3 Near Mint 1 2444 331
-Martian Manhunter (mini-series) 4 Near Mint 1 2445 331
-Marvel Age 21 Near Mint 1 2446 332
-Marvel Age 22 Near Mint 1 2447 332
-Marvel Age 23 Near Mint 1 2448 332
-Marvel Age 24 Near Mint 1 2449 332
-Marvel Age 25 Near Mint 1 2450 332
-Marvel Age 26 Near Mint 1 2451 332
-Marvel Age 27 Near Mint 1 2452 332
-Marvel Fanfare 1 Near Mint 1 2453 333
-Marvel Fanfare 2 Near Mint 1 2454 333
-Marvel Fanfare 3 Near Mint 1 2455 333
-Mystery in Space 111 Near Mint 1 2801 357
-Mystery in Space 114 Near Mint 1 2802 357
-Mystery in Space 115 Near Mint 1 2803 357
-Mystery in Space 116 Near Mint 1 2804 357
-Mystery in Space 117 Near Mint 1 2805 357
-New D.N.Agents 1 Near Mint 1 2806 358
-New D.N.Agents 2 Near Mint 1 2807 358
-New D.N.Agents 3 Near Mint 1 2808 358
-New D.N.Agents 4 Near Mint 1 2809 358
-New D.N.Agents 5 Near Mint 1 2810 358
-New D.N.Agents 6 Near Mint 1 2811 358
-New D.N.Agents 9 Near Mint 1 2812 358
-New D.N.Agents 10 Near Mint 1 2813 358
-New D.N.Agents 11 Near Mint 1 2814 358
-New D.N.Agents 12 Near Mint 1 2815 358
-New D.N.Agents 13 Near Mint 1 2816 358
-New Gods (vol. 2) 2 Near Mint 1 2817 359
-New Gods (vol. 2) 4 Near Mint 1 2818 359
-New Gods (vol. 2) 5 Near Mint 1 2819 359
-New Gods (vol. 2) 6 Near Mint 1 2820 359
-New Gods (vol. 2) 7 Near Mint 1 2821 359
-New Gods (vol. 2) 8 Near Mint 1 2822 359
-New Gods (vol. 2) 9 Near Mint 1 2823 359
-New Mutants 18 Near Mint 1 2824 360
-New Mutants 19 Near Mint 1 2825 360
-New Mutants 21 Near Mint 1 2826 360
-New Mutants 22 Near Mint 1 2827 360
-New Mutants 23 Near Mint 1 2828 360
-New Mutants 24 Near Mint 1 2829 360
-New Mutants 25 Near Mint 1 2830 360
-New Mutants 26 Near Mint 1 2831 360
-New Mutants 27 Near Mint 1 2832 360
-New Mutants 28 Near Mint 1 2833 360
-New Mutants 29 Near Mint 1 2834 360
-New Mutants (Annual) 1 Near Mint 1 2835 361
-New Mutants Special Edition 1 Near Mint 1 2836 362
-New Teen Titans, The 1 Near Mint 1 2837 363
-New Teen Titans, The 5 Near Mint 1 2838 363
-New Teen Titans, The 6 Near Mint 1 2839 363
-New Teen Titans, The 7 Near Mint 1 2840 363
-New Teen Titans, The 8 Near Mint 2 2841 363
-New Teen Titans, The 9 Near Mint 1 2842 363
-New Teen Titans, The 10 Near Mint 1 2843 363
-New Teen Titans, The 11 Near Mint 1 2844 363
-New Teen Titans, The 12 Near Mint 1 2845 363
-New Teen Titans, The 13 Near Mint 1 2846 363
-New Teen Titans, The 14 Near Mint 1 2847 363
-New Teen Titans, The 15 Near Mint 1 2848 363
-New Teen Titans, The 16 Near Mint 2 2849 363
-New Teen Titans, The 17 Near Mint 1 2850 363
-New Teen Titans, The 18 Near Mint 1 2851 363
-New Teen Titans, The 19 Near Mint 1 2852 363
-New Teen Titans, The 20 Near Mint 1 2853 363
-New Teen Titans, The 21 Near Mint 1 2854 363
-New Teen Titans, The 23 Near Mint 1 2855 363
-New Teen Titans, The 24 Near Mint 1 2856 363
-New Teen Titans, The 25 Near Mint 1 2857 363
-New Teen Titans, The 27 Near Mint 1 2858 363
-New Teen Titans, The 28 Near Mint 1 2859 363
-New Teen Titans, The (Annual) 1 Near Mint 1 2860 364
-New Teen Titans, The (vol. 2) 2 Near Mint 1 2861 365
-New Teen Titans, The (vol. 2) 3 Near Mint 1 2862 365
-New Teen Titans, The (vol. 2) 4 Near Mint 1 2863 365
-New Teen Titans, The (vol. 2) 5 Near Mint 1 2864 365
-New Teen Titans, The (vol. 2) 6 Near Mint 1 2865 365
-New Teen Titans, The (vol. 2) 7 Near Mint 1 2866 365
-New Teen Titans, The (vol. 2) 8 Near Mint 1 2867 365
-New Teen Titans, The (vol. 2) (Annual) 3 Near Mint 1 2868 366
-Nick Fury Agent of SHEILD 11 Reading 1 2869 367
-Nightcrawler 1 Near Mint 1 2870 368
-Normal Man 8 Near Mint 1 2871 369
-Nova 1 Near Mint 1 2872 370
-Nova 2 Near Mint 1 2873 370
-Nova 3 Near Mint 1 2874 370
-Nova 4 Near Mint 1 2875 370
-Nova 5 Near Mint 1 2876 370
-Nova 6 Near Mint 1 2877 370
-Nova 7 Near Mint 1 2878 370
-Nova 8 Near Mint 1 2879 370
-Nova 9 Near Mint 1 2880 370
-Nova 10 Near Mint 1 2881 370
-Nova 11 Near Mint 1 2882 370
-Nova 12 Near Mint 1 2883 370
-Nova 13 Near Mint 1 2884 370
-Nova 14 Near Mint 1 2885 370
-Nova 15 Near Mint 1 2886 370
-Nova 16 Near Mint 1 2887 370
-Nova 17 Near Mint 1 2888 370
-Nova 18 Near Mint 1 2889 370
-Nova 19 Near Mint 1 2890 370
-Nova 20 Near Mint 1 2891 370
-Nova 21 Near Mint 1 2892 370
-Nova 22 Near Mint 1 2893 370
-Nova 23 Near Mint 1 2894 370
-Nova 24 Near Mint 1 2895 370
-Nova 25 Near Mint 1 2896 370
-Omega the Unknown 9 Near Mint 1 2897 372
-Omega the Unknown 10 Near Mint 1 2898 372
-Omegamen, The 1 Near Mint 1 2899 371
-Omegamen, The 2 Near Mint 1 2900 371
-Omegamen, The 3 Near Mint 1 2901 371
-Omegamen, The 4 Near Mint 1 2902 371
-Omegamen, The 5 Near Mint 1 2903 371
-Omegamen, The 6 Near Mint 1 2904 371
-Omegamen, The 10 Near Mint 1 2905 371
-Omegamen, The 11 Near Mint 1 2906 371
-Omegamen, The 27 Near Mint 1 2907 371
-Pacific Presents 1 Near Mint 1 2908 374
-Power Man and Iron Fist 115 Near Mint 1 2909 375
-Power Pack 1 Near Mint 1 2910 376
-Power Pack 2 Near Mint 1 2911 376
-Power Pack 3 Near Mint 1 2912 376
-Power Pack 4 Near Mint 1 2913 376
-Power Pack 5 Near Mint 1 2914 376
-Power Pack 7 Near Mint 1 2915 376
-Power Pack 8 Near Mint 1 2916 376
-Power Pack 9 Near Mint 1 2917 376
-Power Pack 10 Near Mint 1 2918 376
-Power Pack 11 Near Mint 1 2919 376
-Power Pack 12 Near Mint 1 2920 376
-Power Pack 13 Near Mint 1 2921 376
-Power Pack 14 Near Mint 1 2922 376
-Power Pack 15 Near Mint 1 2923 376
-Power Pack 16 Near Mint 1 2924 376
-Power Pack 17 Near Mint 1 2925 376
-Power Pack 18 Near Mint 1 2926 376
-Power Pack 19 Near Mint 1 2927 376
-Power Pack 20 Near Mint 1 2928 376
-Power Pack 21 Near Mint 1 2929 376
-Power Pack 22 Near Mint 1 2930 376
-Power Pack 23 Near Mint 1 2931 376
-Power Pack 24 Near Mint 1 2932 376
-Power Pack 25 Near Mint 1 2933 376
-Power Pack 26 Near Mint 1 2934 376
-Power Pack 27 Near Mint 1 2935 376
-Power Pack 28 Near Mint 1 2936 376
-Power Pack 29 Near Mint 1 2937 376
-Power Pack 30 Near Mint 1 2938 376
-Power Pack 31 Near Mint 1 2939 376
-Power Pack 32 Near Mint 1 2940 376
-Power Pack 37 Near Mint 1 2941 376
-Power Pack 39 Near Mint 1 2942 376
-Power Pack 40 Near Mint 1 2943 376
-Power Pack 46 Near Mint 1 2944 376
-Power Pack 48 Near Mint 1 2945 376
-Power Pack 49 Near Mint 1 2946 376
-Power Pack 50 Near Mint 1 2947 376
-Power Pack 51 Near Mint 1 2948 376
-Power Pack 52 Near Mint 1 2949 376
-Power Pack 53 Near Mint 1 2950 376
-Power Pack 54 Near Mint 1 2951 376
-Power Pack 55 Near Mint 1 2952 376
-Power Pack 56 Near Mint 1 2953 376
-Power Pack 57 Near Mint 1 2954 376
-Power Pack 58 Near Mint 1 2955 376
-Power Pack 59 Near Mint 1 2956 376
-Power Pack 60 Near Mint 1 2957 376
-Power Pack 61 Near Mint 1 2958 376
-Power Pack 62 Near Mint 1 2959 376
-Robin (mini-series) (vol. 1) 1 Near Mint 1 2960 377
-Robin (mini-series) (vol. 1) 2 Near Mint 1 2961 377
-Robin (mini-series) (vol. 1) 3 Near Mint 1 2962 377
-Rocket Racoon 1 Near Mint 1 2963 378
-Rom Spaceknight 1 Near Mint 3 2964 379
-Rom Spaceknight 2 Near Mint 2 2965 379
-Rom Spaceknight 3 Near Mint 2 2966 379
-Rom Spaceknight 4 Near Mint 1 2967 379
-Rom Spaceknight 5 Near Mint 1 2968 379
-Rom Spaceknight 6 Near Mint 1 2969 379
-Rom Spaceknight 8 Near Mint 1 2970 379
-Seraphim 1 Near Mint 1 2971 380
-Shatter 6 Near Mint 1 2972 381
-Shatter 8 Near Mint 1 2973 381
-Shatter 11 Near Mint 1 2974 381
-She Hulk, The Savage 1 Near Mint 10 2975 382
-Marvel Fanfare 4 Near Mint 1 2456 333
-Marvel Holiday Special 1 Near Mint 1 2457 334
-Marvel Premiere 1 Near Mint 1 2458 335
-Marvel Premiere 2 Near Mint 1 2459 335
-Marvel Premiere 3 Near Mint 1 2460 335
-Marvel Premiere 4 Near Mint 1 2461 335
-Marvel Premiere 5 Near Mint 1 2462 335
-Marvel Premiere 6 Near Mint 1 2463 335
-Marvel Premiere 7 Near Mint 1 2464 335
-Marvel Premiere 8 Near Mint 1 2465 335
-Marvel Premiere 9 Near Mint 1 2466 335
-Marvel Premiere 10 Near Mint 1 2467 335
-Marvel Premiere 11 Near Mint 1 2468 335
-Marvel Premiere 12 Near Mint 1 2469 335
-Marvel Premiere 13 Near Mint 1 2470 335
-Marvel Premiere 14 Near Mint 1 2471 335
-Marvel Premiere 15 Near Mint 1 2472 335
-Marvel Premiere 16 Near Mint 1 2473 335
-Marvel Premiere 17 Near Mint 1 2474 335
-Marvel Premiere 18 Near Mint 1 2475 335
-Marvel Premiere 19 Near Mint 1 2476 335
-Marvel Premiere 20 Near Mint 1 2477 335
-Marvel Premiere 21 Near Mint 1 2478 335
-Marvel Premiere 22 Near Mint 1 2479 335
-Marvel Premiere 23 Near Mint 1 2480 335
-Marvel Premiere 24 Near Mint 1 2481 335
-Marvel Premiere 25 Near Mint 1 2482 335
-Marvel Premiere 26 Near Mint 1 2483 335
-Marvel Premiere 27 Near Mint 1 2484 335
-Marvel Premiere 28 Near Mint 1 2485 335
-Marvel Premiere 29 Near Mint 1 2486 335
-Marvel Premiere 30 Near Mint 1 2487 335
-Marvel Premiere 31 Near Mint 1 2488 335
-Marvel Premiere 32 Near Mint 1 2489 335
-Marvel Premiere 33 Near Mint 1 2490 335
-Marvel Premiere 34 Near Mint 1 2491 335
-Marvel Premiere 35 Near Mint 1 2492 335
-Marvel Premiere 36 Near Mint 1 2493 335
-Marvel Premiere 37 Near Mint 1 2494 335
-Marvel Premiere 38 Near Mint 1 2495 335
-Marvel Premiere 39 Near Mint 1 2496 335
-Marvel Premiere 40 Near Mint 1 2497 335
-Marvel Premiere 41 Near Mint 1 2498 335
-Marvel Premiere 42 Near Mint 1 2499 335
-Marvel Premiere 43 Near Mint 1 2500 335
-Marvel Premiere 44 Near Mint 1 2501 335
-Marvel Premiere 45 Near Mint 1 2502 335
-Marvel Premiere 46 Near Mint 1 2503 335
-Marvel Premiere 47 Near Mint 1 2504 335
-Marvel Premiere 48 Near Mint 1 2505 335
-Marvel Premiere 49 Near Mint 1 2506 335
-Marvel Premiere 50 Near Mint 1 2507 335
-Marvel Premiere 51 Near Mint 1 2508 335
-Marvel Premiere 52 Near Mint 1 2509 335
-Marvel Premiere 53 Near Mint 1 2510 335
-Marvel Premiere 54 Near Mint 1 2511 335
-Marvel Premiere 55 Near Mint 1 2512 335
-Marvel Premiere 56 Near Mint 1 2513 335
-Marvel Premiere 57 Near Mint 2 2514 335
-Marvel Premiere 58 Near Mint 1 2515 335
-Marvel Premiere 59 Near Mint 1 2516 335
-Marvel Premiere 60 Near Mint 2 2517 335
-Marvel Premiere 61 Near Mint 1 2518 335
-Marvel Spotlight (vol. 2) 1 Near Mint 22 2519 336
-Marvel Spotlight (vol. 2) 2 Near Mint 4 2520 336
-Marvel Spotlight (vol. 2) 3 Near Mint 2 2521 336
-Marvel Spotlight (vol. 2) 4 Near Mint 3 2522 336
-Marvel Spotlight (vol. 2) 5 Near Mint 2 2523 336
-Marvel Spotlight (vol. 2) 6 Near Mint 1 2524 336
-Marvel Spotlight (vol. 2) 7 Near Mint 1 2525 336
-Marvel Spotlight (vol. 2) 8 Near Mint 1 2526 336
-Marvel Spotlight (vol. 2) 9 Near Mint 1 2527 336
-Marvel Spotlight (vol. 2) 10 Near Mint 1 2528 336
-Marvel Spotlight (vol. 2) 11 Near Mint 1 2529 336
-Marvel Super Action 16 Near Mint 1 2530 337
-Marvel Super Action 17 Near Mint 1 2531 337
-Marvel Super Action 18 Near Mint 1 2532 337
-Marvel Super Hero Contest of Champions 1 Near Mint 1 2533 338
-Marvel Super Heros Secret Wars 1 Near Mint 1 2534 339
-Marvel Team-Up 1 Near Mint 1 2535 340
-Marvel Team-Up 5 Near Mint 1 2536 340
-Marvel Team-Up 11 Near Mint 1 2537 340
-Marvel Team-Up 12 Near Mint 1 2538 340
-Marvel Team-Up 13 Near Mint 1 2539 340
-Marvel Team-Up 14 Near Mint 1 2540 340
-Marvel Team-Up 15 Near Mint 1 2541 340
-Marvel Team-Up 16 Near Mint 1 2542 340
-Marvel Team-Up 17 Near Mint 1 2543 340
-Marvel Team-Up 18 Near Mint 1 2544 340
-Marvel Team-Up 19 Near Mint 1 2545 340
-Marvel Team-Up 20 Near Mint 1 2546 340
-Marvel Team-Up 21 Near Mint 1 2547 340
-Marvel Team-Up 22 Near Mint 1 2548 340
-Marvel Team-Up 23 Near Mint 1 2549 340
-Marvel Team-Up 24 Near Mint 1 2550 340
-Marvel Team-Up 25 Near Mint 1 2551 340
-Marvel Team-Up 26 Near Mint 1 2552 340
-Marvel Team-Up 27 Near Mint 1 2553 340
-Marvel Team-Up 28 Near Mint 1 2554 340
-Marvel Team-Up 29 Near Mint 1 2555 340
-Marvel Team-Up 30 Near Mint 1 2556 340
-Marvel Team-Up 31 Near Mint 1 2557 340
-Marvel Team-Up 32 Near Mint 1 2558 340
-Marvel Team-Up 33 Near Mint 1 2559 340
-Marvel Team-Up 34 Near Mint 1 2560 340
-Marvel Team-Up 35 Near Mint 1 2561 340
-Marvel Team-Up 36 Near Mint 1 2562 340
-Marvel Team-Up 37 Near Mint 1 2563 340
-Marvel Team-Up 38 Near Mint 1 2564 340
-Marvel Team-Up 39 Near Mint 1 2565 340
-Marvel Team-Up 40 Near Mint 1 2566 340
-Marvel Team-Up 41 Near Mint 1 2567 340
-Marvel Team-Up 42 Near Mint 1 2568 340
-Marvel Team-Up 43 Near Mint 1 2569 340
-Marvel Team-Up 44 Near Mint 1 2570 340
-Marvel Team-Up 45 Near Mint 1 2571 340
-Marvel Team-Up 46 Near Mint 1 2572 340
-Marvel Team-Up 47 Near Mint 1 2573 340
-Marvel Team-Up 48 Near Mint 1 2574 340
-Marvel Team-Up 49 Near Mint 1 2575 340
-Marvel Team-Up 50 Near Mint 1 2576 340
-Marvel Team-Up 51 Near Mint 1 2577 340
-Marvel Team-Up 52 Near Mint 1 2578 340
-Marvel Team-Up 53 Near Mint 1 2579 340
-Marvel Team-Up 54 Near Mint 1 2580 340
-Marvel Team-Up 55 Near Mint 1 2581 340
-Marvel Team-Up 56 Near Mint 1 2582 340
-Marvel Team-Up 57 Near Mint 1 2583 340
-Marvel Team-Up 58 Near Mint 1 2584 340
-Marvel Team-Up 59 Near Mint 1 2585 340
-Marvel Team-Up 60 Near Mint 1 2586 340
-Marvel Team-Up 61 Near Mint 1 2587 340
-Marvel Team-Up 62 Near Mint 1 2588 340
-Marvel Team-Up 63 Near Mint 1 2589 340
-Marvel Team-Up 64 Near Mint 1 2590 340
-Marvel Team-Up 65 Near Mint 1 2591 340
-Marvel Team-Up 66 Near Mint 1 2592 340
-Marvel Team-Up 67 Near Mint 2 2593 340
-Marvel Team-Up 68 Near Mint 1 2594 340
-Marvel Team-Up 69 Near Mint 1 2595 340
-Marvel Team-Up 70 Near Mint 1 2596 340
-Marvel Team-Up 71 Near Mint 1 2597 340
-Marvel Team-Up 72 Near Mint 1 2598 340
-Marvel Team-Up 73 Near Mint 1 2599 340
-Marvel Team-Up 74 Near Mint 1 2600 340
-Marvel Team-Up 75 Near Mint 1 2601 340
-Marvel Team-Up 76 Near Mint 1 2602 340
-Marvel Team-Up 77 Near Mint 1 2603 340
-Marvel Team-Up 78 Near Mint 1 2604 340
-Marvel Team-Up 79 Near Mint 1 2605 340
-Marvel Team-Up 80 Near Mint 1 2606 340
-Marvel Team-Up 81 Near Mint 1 2607 340
-Marvel Team-Up 82 Near Mint 1 2608 340
-Marvel Team-Up 83 Near Mint 1 2609 340
-Marvel Team-Up 84 Near Mint 1 2610 340
-Marvel Team-Up 85 Near Mint 1 2611 340
-Marvel Team-Up 86 Near Mint 1 2612 340
-Marvel Team-Up 87 Near Mint 1 2613 340
-Marvel Team-Up 88 Near Mint 1 2614 340
-Marvel Team-Up 89 Near Mint 1 2615 340
-Marvel Team-Up 90 Near Mint 1 2616 340
-Marvel Team-Up 91 Near Mint 1 2617 340
-Marvel Team-Up 92 Near Mint 1 2618 340
-Marvel Team-Up 93 Near Mint 1 2619 340
-Marvel Team-Up 94 Near Mint 1 2620 340
-Marvel Team-Up 95 Near Mint 1 2621 340
-Marvel Team-Up 96 Near Mint 1 2622 340
-Marvel Team-Up 97 Near Mint 1 2623 340
-Marvel Team-Up 98 Near Mint 1 2624 340
-Marvel Team-Up 99 Near Mint 1 2625 340
-Marvel Team-Up 101 Near Mint 1 2626 340
-Marvel Team-Up 102 Near Mint 1 2627 340
-Marvel Team-Up 103 Near Mint 1 2628 340
-Marvel Team-Up 104 Near Mint 1 2629 340
-Marvel Team-Up 105 Near Mint 1 2630 340
-Marvel Team-Up 106 Near Mint 2 2631 340
-Marvel Team-Up 107 Near Mint 1 2632 340
-Marvel Team-Up 108 Near Mint 1 2633 340
-Marvel Team-Up 109 Near Mint 1 2634 340
-Marvel Team-Up 112 Near Mint 1 2635 340
-Marvel Team-Up 113 Near Mint 1 2636 340
-Marvel Team-Up 150 Near Mint 1 2637 340
-Marvel Team-Up (Annual) 1 Near Mint 1 2638 341
-Marvel Team-Up (Annual) 2 Near Mint 1 2639 341
-Marvel Team-Up (Annual) 3 Near Mint 1 2640 341
-Marvel Team-Up (Annual) 4 Near Mint 1 2641 341
-Marvel Two-In-One 1 Near Mint 1 2642 342
-Marvel Two-In-One 2 Near Mint 1 2643 342
-Marvel Two-In-One 3 Near Mint 1 2644 342
-Marvel Two-In-One 4 Near Mint 1 2645 342
-Marvel Two-In-One 5 Near Mint 1 2646 342
-Marvel Two-In-One 6 Near Mint 1 2647 342
-Marvel Two-In-One 7 Near Mint 1 2648 342
-Marvel Two-In-One 8 Near Mint 1 2649 342
-Marvel Two-In-One 9 Near Mint 1 2650 342
-Marvel Two-In-One 10 Near Mint 1 2651 342
-Marvel Two-In-One 11 Near Mint 1 2652 342
-Marvel Two-In-One 12 Near Mint 1 2653 342
-Marvel Two-In-One 13 Near Mint 1 2654 342
-Marvel Two-In-One 14 Near Mint 1 2655 342
-Marvel Two-In-One 15 Near Mint 1 2656 342
-Marvel Two-In-One 16 Near Mint 1 2657 342
-Marvel Two-In-One 17 Near Mint 1 2658 342
-Marvel Two-In-One 18 Near Mint 1 2659 342
-Marvel Two-In-One 19 Near Mint 1 2660 342
-Marvel Two-In-One 20 Near Mint 1 2661 342
-Marvel Two-In-One 21 Near Mint 1 2662 342
-Marvel Two-In-One 22 Near Mint 1 2663 342
-Marvel Two-In-One 23 Near Mint 1 2664 342
-Marvel Two-In-One 24 Near Mint 1 2665 342
-Marvel Two-In-One 25 Near Mint 1 2666 342
-Marvel Two-In-One 26 Near Mint 1 2667 342
-Marvel Two-In-One 27 Near Mint 1 2668 342
-Marvel Two-In-One 28 Near Mint 1 2669 342
-Marvel Two-In-One 29 Near Mint 1 2670 342
-Marvel Two-In-One 30 Near Mint 1 2671 342
-Marvel Two-In-One 31 Near Mint 1 2672 342
-Marvel Two-In-One 32 Near Mint 1 2673 342
-Marvel Two-In-One 33 Near Mint 1 2674 342
-Marvel Two-In-One 34 Near Mint 1 2675 342
-Marvel Two-In-One 35 Near Mint 1 2676 342
-Marvel Two-In-One 36 Near Mint 1 2677 342
-Marvel Two-In-One 37 Near Mint 1 2678 342
-Marvel Two-In-One 38 Near Mint 1 2679 342
-Marvel Two-In-One 39 Near Mint 1 2680 342
-Marvel Two-In-One 40 Near Mint 1 2681 342
-Marvel Two-In-One 41 Near Mint 1 2682 342
-Marvel Two-In-One 42 Near Mint 1 2683 342
-Marvel Two-In-One 43 Near Mint 1 2684 342
-Marvel Two-In-One 44 Near Mint 1 2685 342
-Marvel Two-In-One 45 Near Mint 1 2686 342
-Marvel Two-In-One 46 Near Mint 1 2687 342
-Marvel Two-In-One 47 Near Mint 1 2688 342
-Marvel Two-In-One 48 Near Mint 1 2689 342
-Marvel Two-In-One 49 Near Mint 1 2690 342
-Marvel Two-In-One 50 Near Mint 1 2691 342
-Marvel Two-In-One 51 Near Mint 1 2692 342
-Marvel Two-In-One 52 Near Mint 1 2693 342
-Marvel Two-In-One 53 Near Mint 1 2694 342
-Marvel Two-In-One 54 Near Mint 1 2695 342
-Marvel Two-In-One 55 Near Mint 1 2696 342
-Marvel Two-In-One 56 Near Mint 1 2697 342
-Marvel Two-In-One 57 Near Mint 1 2698 342
-Marvel Two-In-One 58 Near Mint 1 2699 342
-Marvel Two-In-One 59 Near Mint 1 2700 342
-Marvel Two-In-One 60 Near Mint 1 2701 342
-Marvel Two-In-One 61 Near Mint 2 2702 342
-Marvel Two-In-One 62 Near Mint 1 2703 342
-Marvel Two-In-One 63 Near Mint 1 2704 342
-Marvel Two-In-One 64 Near Mint 1 2705 342
-Marvel Two-In-One 65 Near Mint 1 2706 342
-Marvel Two-In-One 66 Near Mint 1 2707 342
-Marvel Two-In-One 68 Near Mint 1 2708 342
-Marvel Two-In-One 69 Near Mint 1 2709 342
-Marvel Two-In-One 72 Near Mint 1 2710 342
-Marvel Two-In-One 73 Near Mint 1 2711 342
-Marvel Two-In-One 74 Near Mint 1 2712 342
-Marvel Two-In-One 75 Near Mint 1 2713 342
-Marvel Two-In-One 76 Near Mint 1 2714 342
-Marvel Two-In-One 77 Near Mint 2 2715 342
-Marvel Two-In-One 78 Near Mint 1 2716 342
-Marvel Two-In-One 79 Near Mint 1 2717 342
-Marvel Two-In-One 81 Near Mint 1 2718 342
-Marvel Two-In-One 83 Near Mint 1 2719 342
-Marvel Two-In-One 84 Near Mint 1 2720 342
-Marvel Two-In-One 85 Near Mint 1 2721 342
-Marvel Two-In-One 86 Near Mint 1 2722 342
-Marvel Two-In-One 87 Near Mint 1 2723 342
-Marvel Two-In-One 88 Near Mint 1 2724 342
-Marvel Two-In-One 90 Near Mint 1 2725 342
-Marvel Two-In-One 91 Near Mint 1 2726 342
-Marvel Two-In-One 92 Near Mint 1 2727 342
-Marvel Two-In-One 93 Near Mint 1 2728 342
-Marvel Two-In-One 95 Near Mint 1 2729 342
-Marvel Two-In-One 96 Near Mint 1 2730 342
-Marvel Two-In-One (Annual) 2 Near Mint 1 2731 343
-Marvel Two-In-One (Annual) 3 Near Mint 1 2732 343
-Marvel Two-In-One (Annual) 4 Near Mint 1 2733 343
-Marvel Two-In-One (Annual) 5 Near Mint 1 2734 343
-Marvel Two-In-One (Annual) 6 Near Mint 1 2735 343
-Master of Kung Fu, The Hands of Shang-Chi 80 Near Mint 1 2736 330
-Master of Kung Fu, The Hands of Shang-Chi 81 Near Mint 1 2737 330
-Master of Kung Fu, The Hands of Shang-Chi 82 Near Mint 1 2738 330
-Master of Kung Fu, The Hands of Shang-Chi 100 Near Mint 2 2739 330
-Megaton Man 1 Near Mint 1 2740 345
-Micronauts 1 Near Mint 4 2741 346
-Micronauts 2 Near Mint 2 2742 346
-Micronauts 3 Near Mint 3 2743 346
-Micronauts 4 Near Mint 3 2744 346
-Micronauts 5 Near Mint 3 2745 346
-Micronauts 6 Near Mint 3 2746 346
-Micronauts 7 Near Mint 2 2747 346
-Micronauts 8 Near Mint 1 2748 346
-Micronauts 9 Near Mint 1 2749 346
-Micronauts 10 Near Mint 1 2750 346
-Micronauts 11 Near Mint 2 2751 346
-Micronauts 12 Near Mint 1 2752 346
-Micronauts 13 Near Mint 1 2753 346
-Micronauts 14 Near Mint 1 2754 346
-Micronauts 15 Near Mint 1 2755 346
-Micronauts 16 Near Mint 1 2756 346
-Micronauts 17 Near Mint 1 2757 346
-Micronauts 18 Near Mint 1 2758 346
-Micronauts 19 Near Mint 1 2759 346
-Micronauts 20 Near Mint 1 2760 346
-Micronauts 21 Near Mint 1 2761 346
-Micronauts 22 Near Mint 1 2762 346
-Micronauts 23 Near Mint 1 2763 346
-Micronauts 26 Near Mint 1 2764 346
-Micronauts 27 Near Mint 1 2765 346
-Micronauts 28 Near Mint 2 2766 346
-Micronauts 29 Near Mint 2 2767 346
-Micronauts 30 Near Mint 1 2768 346
-Micronauts 31 Near Mint 1 2769 346
-Micronauts 32 Near Mint 1 2770 346
-Micronauts 33 Near Mint 1 2771 346
-Micronauts 34 Near Mint 1 2772 346
-Micronauts 35 Near Mint 1 2773 346
-Micronauts 37 Near Mint 1 2774 346
-Micronauts 38 Near Mint 1 2775 346
-Micronauts 39 Near Mint 1 2776 346
-Micronauts (Annual) 1 Near Mint 1 2777 347
-Micronauts (Annual) 2 Near Mint 1 2778 347
-Micronauts: The New Voyages 5 Near Mint 1 2779 348
-Micronauts: The New Voyages 6 Near Mint 1 2780 348
-Mighty Mites, The 3 Near Mint 1 2781 349
-Mister E 1 Near Mint 1 2782 350
-Mister Miracle Special 1 Near Mint 1 2783 351
-Moon Knight 1 Near Mint 1 2784 353
-Moon Knight 2 Near Mint 1 2785 353
-Moon Knight 4 Near Mint 2 2786 353
-Moon Knight 5 Near Mint 1 2787 353
-Moon Knight 6 Near Mint 1 2788 353
-Moon Knight 7 Near Mint 1 2789 353
-Moon Knight 8 Near Mint 1 2790 353
-Moon Knight 9 Near Mint 1 2791 353
-Moon Knight 10 Near Mint 1 2792 353
-Moon Knight 11 Near Mint 1 2793 353
-Moon Knight 12 Near Mint 1 2794 353
-Moon Knight 16 Near Mint 1 2795 353
-Moon Knight 17 Near Mint 1 2796 353
-Moon Knight: Fist of Khonshu 2 Near Mint 1 2797 354
-Ms. Mystic 1 Near Mint 1 2798 355
-Ms. Mystic 2 Near Mint 1 2799 355
-Ms. Tree's Thrilling Detective Adventure 2 Near Mint 1 2800 356
-Star Wars 24 Near Mint 1 3144 399
-Star Wars 25 Near Mint 1 3145 399
-Star Wars 26 Near Mint 1 3146 399
-Star Wars 27 Near Mint 1 3147 399
-Star Wars 28 Near Mint 1 3148 399
-Star Wars 29 Near Mint 1 3149 399
-Star Wars 30 Near Mint 1 3150 399
-Star Wars 31 Near Mint 1 3151 399
-Star Wars 32 Near Mint 1 3152 399
-Star Wars 33 Near Mint 1 3153 399
-Star Wars 34 Near Mint 1 3154 399
-Star Wars 35 Near Mint 1 3155 399
-Star Wars 36 Near Mint 1 3156 399
-Star Wars 37 Near Mint 1 3157 399
-Star Wars 47 Near Mint 1 3158 399
-Star Wars (Annual) 1 Near Mint 1 3159 400
-Star Wars 3D 3 Reading 1 3160 401
-Starlord Special Edition 1 Near Mint 1 3161 395
-Starstruck 1 Near Mint 1 3162 397
-Starstruck 2 Near Mint 1 3163 397
-Starstruck 3 Near Mint 1 3164 397
-Steelgrip Starkey 1 Near Mint 1 3165 402
-Sun Runners 1 Near Mint 1 3166 403
-Sun Runners 2 Near Mint 1 3167 403
-Sun Runners 3 Near Mint 1 3168 403
-Sun Runners 4 Near Mint 1 3169 403
-Superman: The Secret Years 1 Near Mint 1 3170 404
-Superman: The Secret Years 2 Near Mint 1 3171 404
-Superman: The Secret Years 3 Near Mint 1 3172 404
-Sword of the Atom 1 Near Mint 1 3173 405
-Sword of the Atom 2 Near Mint 1 3174 405
-Sword of the Atom 3 Near Mint 1 3175 405
-Sword of the Atom 4 Near Mint 1 3176 405
-Sword of the Atom Special 1 Near Mint 1 3177 406
-Sword of the Atom Special 2 Near Mint 1 3178 406
-Sword of the Atom Special 3 Near Mint 1 3179 406
-Tales from the Crypt 2 Near Mint 1 3180 407
-Tales of the Green Lantern Corps 1 Near Mint 1 3181 408
-Tales of the Green Lantern Corps 2 Near Mint 1 3182 408
-Tales of the Green Lantern Corps 3 Near Mint 1 3183 408
-Tales of the Legion of Super-Heroes 316 Near Mint 1 3184 409
-Tales of the Legion of Super-Heroes 317 Near Mint 1 3185 409
-Tales of the Legion of Super-Heroes 318 Near Mint 1 3186 409
-Tales of the Legion of Super-Heroes 319 Near Mint 1 3187 409
-Tales of the Legion of Super-Heroes 320 Near Mint 1 3188 409
-Tales of the Legion of Super-Heroes 321 Near Mint 1 3189 409
-Tales of the Legion of Super-Heroes 322 Near Mint 1 3190 409
-Tales of the Legion of Super-Heroes 323 Near Mint 1 3191 409
-Tales of the Legion of Super-Heroes 324 Near Mint 1 3192 409
-Tales of the Legion of Super-Heroes 325 Near Mint 1 3193 409
-Tales of the New Teen Titans 45 Near Mint 1 3194 411
-Tales of the New Teen Titans 46 Near Mint 1 3195 411
-Tales of the New Teen Titans 47 Near Mint 1 3196 411
-Tales of the New Teen Titans 48 Near Mint 1 3197 411
-Tales of the New Teen Titans 49 Near Mint 1 3198 411
-Tales of the New Teen Titans 50 Near Mint 1 3199 411
-Tales of the New Teen Titans 51 Near Mint 1 3200 411
-Tales of the New Teen Titans 52 Near Mint 1 3201 411
-Tales of the New Teen Titans 53 Near Mint 1 3202 411
-Tales of the New Teen Titans 54 Near Mint 1 3203 411
-Tales of the New Teen Titans (1982) 1 Near Mint 2 3204 410
-Tales of the New Teen Titans (1982) 2 Near Mint 2 3205 410
-Tales of the New Teen Titans (1982) 3 Near Mint 1 3206 410
-Tales of the New Teen Titans (1982) 4 Near Mint 1 3207 410
-Tales to Astonish (vol. 2) 1 Near Mint 10 3208 412
-Tales to Astonish (vol. 2) 2 Near Mint 3 3209 412
-Tales to Astonish (vol. 2) 3 Near Mint 3 3210 412
-Tales to Astonish (vol. 2) 4 Near Mint 2 3211 412
-Tales to Astonish (vol. 2) 5 Near Mint 1 3212 412
-Tales to Astonish (vol. 2) 6 Near Mint 1 3213 412
-Tales to Astonish (vol. 2) 7 Near Mint 1 3214 412
-Tales to Astonish (vol. 2) 8 Near Mint 1 3215 412
-Team America 1 Near Mint 1 3216 413
-Teen Titans (one-shot drug issue) 1 Near Mint 1 3217 414
-Thor, The Mighty 270 Near Mint 1 3218 415
-Thor, The Mighty 273 Near Mint 1 3219 415
-Thor, The Mighty 275 Near Mint 1 3220 415
-Thor, The Mighty 278 Near Mint 1 3221 415
-Thor, The Mighty 279 Near Mint 1 3222 415
-Thor, The Mighty 280 Near Mint 1 3223 415
-Thor, The Mighty 281 Near Mint 1 3224 415
-Thor, The Mighty 282 Near Mint 1 3225 415
-Thor, The Mighty 283 Near Mint 1 3226 415
-Thor, The Mighty 284 Near Mint 1 3227 415
-Thor, The Mighty 285 Near Mint 1 3228 415
-Thor, The Mighty 286 Near Mint 1 3229 415
-Thor, The Mighty 287 Near Mint 1 3230 415
-Thor, The Mighty 288 Near Mint 1 3231 415
-Thor, The Mighty 289 Near Mint 1 3232 415
-Thor, The Mighty 290 Near Mint 1 3233 415
-Thor, The Mighty 291 Near Mint 1 3234 415
-Thor, The Mighty 292 Near Mint 1 3235 415
-Thor, The Mighty 293 Near Mint 2 3236 415
-Thor, The Mighty 294 Near Mint 1 3237 415
-Thor, The Mighty 295 Near Mint 1 3238 415
-Thor, The Mighty 296 Near Mint 2 3239 415
-Thor, The Mighty 297 Near Mint 1 3240 415
-Thor, The Mighty 298 Near Mint 1 3241 415
-Thor, The Mighty 300 Near Mint 1 3242 415
-Thor, The Mighty 301 Near Mint 1 3243 415
-Thor, The Mighty 302 Near Mint 1 3244 415
-Thor, The Mighty 304 Near Mint 1 3245 415
-Thor, The Mighty 305 Near Mint 1 3246 415
-Thor, The Mighty 306 Near Mint 1 3247 415
-Thor, The Mighty 307 Near Mint 1 3248 415
-Thor, The Mighty 308 Near Mint 2 3249 415
-Thor, The Mighty 309 Near Mint 1 3250 415
-Thor, The Mighty 310 Near Mint 1 3251 415
-Thor, The Mighty 311 Near Mint 1 3252 415
-Thor, The Mighty 315 Near Mint 1 3253 415
-Thor, The Mighty 316 Near Mint 1 3254 415
-Thor, The Mighty 318 Near Mint 1 3255 415
-Thor, The Mighty 321 Near Mint 1 3256 415
-Thor, The Mighty (Annual) 5 Near Mint 1 3257 416
-Thor, The Mighty (Annual) 8 Near Mint 1 3258 416
-Thor, The Mighty (Annual) 9 Near Mint 1 3259 416
-Time Spirits 1 Near Mint 2 3260 417
-Time Spirits 2 Near Mint 1 3261 417
-Time Spirits 3 Near Mint 1 3262 417
-Time Spirits 4 Near Mint 1 3263 417
-Time Spirits 5 Near Mint 1 3264 417
-Time Spirits 6 Near Mint 1 3265 417
-Time Spirits 7 Near Mint 1 3266 417
-Time Spirits 8 Near Mint 1 3267 417
-Time Warp 1 Near Mint 1 3268 418
-Time Warp 2 Near Mint 1 3269 418
-Time Warp 3 Near Mint 1 3270 418
-Time Warp 4 Near Mint 1 3271 418
-Time Warp 5 Near Mint 1 3272 418
-Transformers in 3D 2 Reading 1 3273 419
-Untold Legend of the Batman 1 Near Mint 5 3274 420
-Untold Legend of the Batman 2 Near Mint 3 3275 420
-Untold Legend of the Batman 3 Near Mint 1 3276 420
-V for Vendetta 4 Near Mint 1 3277 421
-V for Vendetta 5 Near Mint 1 3278 421
-V for Vendetta 6 Near Mint 1 3279 421
-V for Vendetta 8 Near Mint 1 3280 421
-Vault of Horror 2 Near Mint 1 3281 422
-Vision and Scarlet Witch (mini-series) 1 Near Mint 1 3282 423
-Warlock Special Edition 1 Near Mint 1 3283 424
-Warlock Special Edition 4 Near Mint 1 3284 424
-Warlock Special Edition 5 Near Mint 1 3285 424
-Warlord 3 Near Mint 1 3286 425
-Warlord 5 Near Mint 1 3287 425
-Warlord 6 Near Mint 1 3288 425
-Warlord 7 Near Mint 1 3289 425
-Warlord 8 Near Mint 1 3290 425
-Warlord 9 Near Mint 1 3291 425
-Warlord 10 Near Mint 1 3292 425
-Warlord 11 Near Mint 1 3293 425
-Warlord 12 Near Mint 1 3294 425
-Warlord 13 Near Mint 1 3295 425
-Warlord 14 Near Mint 1 3296 425
-Warlord 15 Near Mint 1 3297 425
-Warlord 16 Near Mint 1 3298 425
-Warlord 17 Near Mint 1 3299 425
-Warlord 18 Near Mint 1 3300 425
-Warlord 19 Near Mint 1 3301 425
-Warlord 21 Near Mint 1 3302 425
-Warlord 22 Near Mint 1 3303 425
-Warlord 23 Near Mint 1 3304 425
-Warlord 24 Near Mint 1 3305 425
-Warlord 25 Near Mint 1 3306 425
-Warlord 26 Near Mint 1 3307 425
-Warlord 27 Near Mint 1 3308 425
-Warlord 28 Near Mint 1 3309 425
-Warlord 29 Near Mint 1 3310 425
-Warlord 30 Near Mint 1 3311 425
-Young All-Stars, The 16 Near Mint 1 3480 433
-Young All-Stars, The 17 Near Mint 1 3481 433
-Young All-Stars, The 18 Near Mint 1 3482 433
-Young All-Stars, The 19 Near Mint 1 3483 433
-Young All-Stars, The 20 Near Mint 1 3484 433
-Phantom Force 5 Near Mint 1 3485 155
-Superboy (vol. 2) 0 Zero Month Near Mint 1 3486 120
-Legion of Super-Heroes (vol. 4) 0 Zero Month Near Mint 1 3487 145
-Hardware 20 Near Mint 1 3488 22
-Superman, The Man of Steel 0 Zero Month Near Mint 1 3489 18
-Shade, The Changing Man 52 Near Mint 1 3490 446
-Maxx, The 10 Near Mint 1 3491 2
-Primal Force 0 Zero Month Near Mint 1 3492 436
-Secret Origins (vol. 2) 22 Millennium Near Mint Manhunters 1 3493 143
-Secret Origins (vol. 2) 23 Millennium Near Mint Foronic Man/Guardians of the Universe 1 3494 143
-Secret Origins (vol. 2) 46 Near Mint Headquarters of LSH, JLA, and Teen Titans 1 3495 143
-Action Comics 624 Near Mint 1 3496 142
-Action Comics 625 Near Mint 1 3497 142
-Action Comics 626 Near Mint 1 3498 142
-Hardware 3 Near Mint 1 3499 22
-Hardware 5 Near Mint 1 3500 22
-Hardware 8 Near Mint 1 3501 22
-Hardware 9 Near Mint 1 3502 22
-Hardware 10 Near Mint 1 3503 22
-Hardware 15 Near Mint 1 3504 22
-Lobo Convention Special 1 Near Mint 1 3505 437
-Shade, The Changing Man 38 Near Mint 1 3506 446
-Shade, The Changing Man 39 Near Mint 1 3507 446
-Shade, The Changing Man 37 Near Mint 1 3508 446
-Swamp Thing (Vol. 2) 66 Near Mint 1 3509 107
-Swamp Thing (Vol. 2) 67 Near Mint Hellblazer No. 1 Preview 1 3510 107
-Swamp Thing (Vol. 2) 68 Near Mint 1 3511 107
-Swamp Thing (Vol. 2) 69 Near Mint 1 3512 107
-Swamp Thing (Vol. 2) 70 Near Mint 1 3513 107
-Swamp Thing (Vol. 2) 140 Near Mint Grant Morrison 1 3514 107
-Swamp Thing (Vol. 2) 141 Near Mint Grant Morrison 1 3515 107
-Swamp Thing (Annual) 3 Near Mint 1 3516 35
-Moonshadow 2 Near Mint 1 3517 444
-R.E.B.E.L.S. '94 0 Near Mint 1 3518 438
-Steel 0 Near Mint 1 3519 121
-Hellblazer 82 Near Mint 1 3520 15
-Sandman: Gallery of Dreams 1 Near Mint 1 3521 439
-Starman (vol. 3) 0 Near Mint 1 3522 440
-Green Lantern (vol. 2) 0 Near Mint 1 3523 49
-Icon 18 Near Mint 1 3524 17
-Superman (vol. 2) 0 Near Mint 1 3525 165
-Legionnaires 0 Near Mint 1 3526 11
-Ray, The (regular series) 0 Near Mint 1 3527 265
-Superman, The Adventures of 0 Near Mint 1 3528 51
-Cerebus 186 Mother's and Daughter's Near Mint 1 3529 123
-Static 16 What are little boys made of? Near Mint 1 of 5 1 3530 33
-Books of Magic (regular series) 6 Near Mint 1 3531 435
-Dark Horse Presents 89 Near Mint Hellboy by Mignola 1 3532 306
-Hardware 21 Near Mint 1 3533 22
-Damage 0 Near Mint 1 3534 249
-Invisibles 2 Near Mint 1 3535 303
-Lone Ranger and Tonto, The 2 Near Mint 2 of 4 1 3536 305
-Superman, The Man of Steel 38 Dead Again Near Mint 1 3537 18
-Action Comics 0 Near Mint 1 3538 142
-Legion of Super-Heroes (vol. 4) 62 Near Mint 1 3539 145
-Detective Comics 0 Near Mint 1 3540 304
-Batman 0 Near Mint 1 3541 187
-Batman Shadow of the Bat 0 Near Mint 1 3542 60
-Batman: Legends of the Dark Knight 0 Near Mint 1 3543 441
-Primal Force 1 Near Mint 1 3544 436
-Superboy (vol. 2) 9 Near Mint 1 3545 120
-Sandman Mystery Theatre 8 Near Mint 1 3546 20
-Sandman Mystery Theatre 9 Near Mint 1 3547 20
-Sandman Mystery Theatre 10 Near Mint 1 3548 20
-Sandman Mystery Theatre 11 Near Mint 1 3549 20
-Sandman Mystery Theatre 12 Near Mint 1 3550 20
-Sandman Mystery Theatre 13 Near Mint 1 3551 20
-Sandman Mystery Theatre 14 Near Mint 1 3552 20
-Sandman Mystery Theatre 18 Near Mint 1 3553 20
-Sandman Mystery Theatre 20 Near Mint 1 3554 20
-Green Lantern (vol. 2) 56 Near Mint 1 3555 49
-Shade, The Changing Man 53 Near Mint 1 3556 446
-Starman (vol. 3) 1 Near Mint 1 3557 440
-Hellblazer 83 Near Mint 1 3558 15
-Ray, The (regular series) 6 Near Mint 1 3559 265
-Guardians of Metropolis 1 Near Mint 1 3560 443
-Superman, The Adventures of 517 Near Mint 1 3561 51
-Superman (vol. 2) 94 Near Mint 1 3562 165
-Icon 19 Near Mint 1 3563 17
-Steel 9 Near Mint 1 3564 121
-R.E.B.E.L.S. '94 1 Near Mint 1 3565 438
-Action Comics (Annual) 3 Near Mint 1 3566 258
-Moonshadow 3 Near Mint 1 3567 444
-Moonshadow 4 Near Mint 1 3568 444
-Shade, The Changing Man 54 Near Mint 1 3569 446
-Hellblazer 84 Near Mint 1 3570 15
-Vertigo Rave 1 Near Mint 1 3571 442
-Action Comics 704 Dead Again Near Mint 1 3572 142
-Action Comics 705 Dead Again Near Mint 1 3573 142
-Books of Magic (regular series) 7 Near Mint 1 3574 435
-Books of Magic (regular series) 8 Near Mint 1 3575 435
-Cerebus 187 Mother's and Daughter's Near Mint 1 3576 123
-Cerebus 188 Mother's and Daughter's Near Mint 1 3577 123
-Damage 7 Near Mint 1 3578 249
-Green Lantern (vol. 2) 57 Near Mint 1 3579 49
-Guardians of Metropolis 2 Near Mint 1 3580 443
-Hardware 22 Near Mint 1 3581 22
-Icon 20 Near Mint 1 3582 17
-Invisibles 3 Near Mint 1 3583 303
-Legionnaires 19 Near Mint 1 3584 11
-Legionnaires 20 Near Mint 1 3585 11
-Legion of Super-Heroes (vol. 4) 63 Near Mint 1 3586 145
-Lone Ranger and Tonto, The 3 Near Mint 3 of 4 1 3587 305
-Madman Comics 4 Near Mint 1 3588 260
-Maxx, The 11 Near Mint 1 3589 2
-Primal Force 2 Near Mint 1 3590 436
-Phantom Force 8 Near Mint 1 3591 155
-Sandman 64 Near Mint 1 3592 10
-Sandman Mystery Theatre 19 Near Mint 1 3593 20
-Sandman Mystery Theatre 21 Near Mint 1 3594 20
-Starman (vol. 3) 2 Near Mint 1 3595 440
-Static 17 What are little boys made of? Near Mint 2 of 5 1 3596 33
-Superboy (vol. 2) 10 Near Mint 1 3597 120
-Superman (vol. 2) 95 Near Mint 1 3598 165
-Superman, The Adventures of 518 Near Mint 1 3599 51
-Superman, The Man of Steel 39 Dead Again Near Mint 1 3600 18
-Static 18 What are little boys made of? Near Mint 3 of 5 1 3601 33
-Static 19 What are little boys made of? Near Mint 4 of 5 1 3602 33
-Cerebus 189 Mother's and Daughter's Near Mint Part 39 1 3603 123
-Invisibles 4 Near Mint 1 3604 303
-Invisibles 5 Arcadia Near Mint Part 1 1 3605 303
-Maxx, The 12 Near Mint 1 3606 2
-Shade, The Changing Man 55 Near Mint 1 3607 446
-Shade, The Changing Man 56 Near Mint 1 3608 446
-Books of Magic (regular series) 9 The Artificial Heart Near Mint Part 1 1 3609 435
-Moonshadow 5 Near Mint 1 3610 444
-Green Lantern (vol. 2) 58 Near Mint 1 3611 49
-Sandman 65 Near Mint 1 3612 10
-Sandman Mystery Theatre 22 Near Mint 1 3613 20
-Superman (vol. 2) 96 Dead Again Near Mint 1 3614 165
-Superman, The Man of Steel 40 Dead Again Near Mint 1 3615 18
-Action Comics 706 Near Mint Features Supergirl 1 3616 142
-Superman, The Adventures of 519 Dead Again Near Mint 1 3617 51
-Legionnaires 21 Near Mint 1 3618 11
-Legion of Super-Heroes (vol. 4) 64 Near Mint 1 3619 145
-Hellblazer 85 Near Mint 1 3620 15
-Dark Horse Presents 91 Near Mint Hellboy by Mignola 1 3621 306
-Primal Force 3 Near Mint 1 3622 436
-Superboy (vol. 2) 11 Near Mint 1 3623 120
-Lone Ranger and Tonto, The 4 Near Mint 4 of 4 1 3624 305
-Hawkman (vol. 2) 0 Zero Month Near Mint 1 3625 302
-Starman (vol. 3) 3 Near Mint 1 3626 440
-Guardians of Metropolis 3 Near Mint 1 3627 443
-Neil Gaiman's Mr. Hero 1 Near Mint 1 3628 445
-Icon 21 Mothership Connection Near Mint Conclusion 1 3629 17
-Superman, The Man of Steel 41 Near Mint 1 3630 18
-Superman, The Man of Steel 42 Near Mint 1 3631 18
-Superman (vol. 2) 97 Near Mint 1 3632 165
-Superman, The Adventures of 520 Near Mint 1 3633 51
-Shade, The Changing Man 57 Near Mint 1 3634 446
-Sandman Mystery Theatre 23 Near Mint 1 3635 20
-Sandman Mystery Theatre 24 Near Mint 1 3636 20
-Sandman 66 Near Mint 1 3637 10
-Superboy (vol. 2) 12 Near Mint 1 3638 120
-Superboy (vol. 2) 13 Near Mint 1 3639 120
-Showcase '95 1 Near Mint Supergirl, Alan Scott, Argus 1 3640 447
-Showcase '95 2 Near Mint Supergirl, Argus, Metal Men 1 3641 447
-Primal Force 4 Near Mint 1 3642 436
-Primal Force 5 Near Mint 1 3643 436
-Static 20 Near Mint 1 3644 33
-Icon 22 Near Mint 1 3645 17
-Starman (vol. 3) 4 Near Mint 1 3646 440
-Tale of One Bad Rat 1 Near Mint 1 3647 448
-Tale of One Bad Rat 2 Near Mint 1 3648 448
-Tale of One Bad Rat 3 Near Mint 1 3649 448
-Tale of One Bad Rat 4 Near Mint 1 3650 448
-Legionnaires 23 Near Mint 1 3651 11
-Warlord 31 Near Mint 1 3312 425
-Warlord 32 Near Mint 1 3313 425
-Warlord 33 Near Mint 1 3314 425
-Warlord 34 Near Mint 1 3315 425
-Warlord 35 Near Mint 1 3316 425
-Warlord 36 Near Mint 1 3317 425
-Warlord 37 Near Mint 1 3318 425
-Warlord 38 Near Mint 1 3319 425
-Warlord 39 Near Mint 1 3320 425
-Warlord 40 Near Mint 1 3321 425
-Warlord 42 Near Mint 1 3322 425
-Warlord 43 Near Mint 1 3323 425
-Warlord 44 Near Mint 1 3324 425
-Warlord 45 Near Mint 1 3325 425
-Warlord 46 Near Mint 2 3326 425
-Warlord 47 Near Mint 1 3327 425
-Warlord 48 Near Mint 1 3328 425
-Warlord 49 Near Mint 1 3329 425
-Warlord 50 Near Mint 1 3330 425
-Warlord 51 Near Mint 1 3331 425
-Warlord 52 Near Mint 1 3332 425
-Warlord 53 Near Mint 1 3333 425
-Warlord 54 Near Mint 1 3334 425
-Web of Spiderman 1 Near Mint 3 3335 426
-Web of Spiderman 2 Near Mint 1 3336 426
-Web of Spiderman 3 Near Mint 1 3337 426
-Web of Spiderman 4 Near Mint 1 3338 426
-What If? (vol. 1) 1 Near Mint 1 3339 427
-What If? (vol. 1) 2 Near Mint 1 3340 427
-What If? (vol. 1) 3 Near Mint 1 3341 427
-What If? (vol. 1) 4 Near Mint 1 3342 427
-What If? (vol. 1) 5 Near Mint 1 3343 427
-What If? (vol. 1) 6 Near Mint 1 3344 427
-What If? (vol. 1) 7 Near Mint 1 3345 427
-What If? (vol. 1) 8 Near Mint 1 3346 427
-What If? (vol. 1) 9 Near Mint 1 3347 427
-What If? (vol. 1) 10 Near Mint 1 3348 427
-What If? (vol. 1) 11 Near Mint 1 3349 427
-What If? (vol. 1) 12 Near Mint 1 3350 427
-What If? (vol. 1) 13 Near Mint 1 3351 427
-What If? (vol. 1) 14 Near Mint 1 3352 427
-What If? (vol. 1) 15 Near Mint 1 3353 427
-What If? (vol. 1) 16 Near Mint 1 3354 427
-What If? (vol. 1) 17 Near Mint 1 3355 427
-What If? (vol. 1) 18 Near Mint 1 3356 427
-What If? (vol. 1) 19 Near Mint 1 3357 427
-What If? (vol. 1) 20 Near Mint 1 3358 427
-What If? (vol. 1) 21 Near Mint 1 3359 427
-What If? (vol. 1) 22 Near Mint 1 3360 427
-What If? (vol. 1) 23 Near Mint 1 3361 427
-What If? (vol. 1) 25 Near Mint 1 3362 427
-What If? (vol. 1) 26 Near Mint 1 3363 427
-What If? (vol. 1) 27 Near Mint 2 3364 427
-What If? (vol. 1) 28 Near Mint 1 3365 427
-What If? (vol. 1) 29 Near Mint 1 3366 427
-What If? (vol. 1) 30 Near Mint 1 3367 427
-Wrath of the Spectre 1 Near Mint 1 3368 429
-Wrath of the Spectre 2 Near Mint 1 3369 429
-Wrath of the Spectre 4 Near Mint 1 3370 429
-X-Factor 1 Near Mint 1 3371 430
-X-Men and Alpha Flight (mini-series) 1 Near Mint 1 3372 431
-X-Men and the Teen Titans 1 Near Mint 1 3373 432
-X-Men, The Uncanny 21 Near Mint 1 3374 86
-X-Men, The Uncanny 22 Near Mint 1 3375 86
-X-Men, The Uncanny 23 Near Mint 1 3376 86
-X-Men, The Uncanny 24 Near Mint 1 3377 86
-X-Men, The Uncanny 25 Near Mint 1 3378 86
-X-Men, The Uncanny 26 Near Mint 1 3379 86
-X-Men, The Uncanny 27 Near Mint 1 3380 86
-X-Men, The Uncanny 28 Near Mint 1 3381 86
-X-Men, The Uncanny 32 Near Mint 1 3382 86
-X-Men, The Uncanny 33 Near Mint 1 3383 86
-X-Men, The Uncanny 36 Near Mint 1 3384 86
-X-Men, The Uncanny 38 Near Mint 1 3385 86
-X-Men, The Uncanny 39 Near Mint 1 3386 86
-X-Men, The Uncanny 40 Near Mint 1 3387 86
-X-Men, The Uncanny 41 Near Mint 1 3388 86
-X-Men, The Uncanny 43 Near Mint 1 3389 86
-X-Men, The Uncanny 45 Near Mint 1 3390 86
-X-Men, The Uncanny 46 Near Mint 1 3391 86
-X-Men, The Uncanny 47 Near Mint 1 3392 86
-X-Men, The Uncanny 48 Near Mint 1 3393 86
-X-Men, The Uncanny 49 Near Mint 1 3394 86
-X-Men, The Uncanny 50 Near Mint 1 3395 86
-X-Men, The Uncanny 51 Near Mint 1 3396 86
-X-Men, The Uncanny 52 Near Mint 1 3397 86
-X-Men, The Uncanny 54 Near Mint 1 3398 86
-X-Men, The Uncanny 55 Near Mint 1 3399 86
-X-Men, The Uncanny 56 Near Mint 1 3400 86
-X-Men, The Uncanny 76 Near Mint 1 3401 86
-X-Men, The Uncanny 80 Near Mint 1 3402 86
-X-Men, The Uncanny 81 Near Mint 1 3403 86
-X-Men, The Uncanny 83 Near Mint 1 3404 86
-X-Men, The Uncanny 85 Near Mint 1 3405 86
-X-Men, The Uncanny 86 Near Mint 1 3406 86
-X-Men, The Uncanny 87 Near Mint 1 3407 86
-X-Men, The Uncanny 88 Near Mint 1 3408 86
-X-Men, The Uncanny 90 Near Mint 1 3409 86
-X-Men, The Uncanny 91 Near Mint 1 3410 86
-X-Men, The Uncanny 96 Near Mint 1 3411 86
-X-Men, The Uncanny 97 Near Mint 1 3412 86
-X-Men, The Uncanny 98 Near Mint 1 3413 86
-X-Men, The Uncanny 99 Near Mint 1 3414 86
-X-Men, The Uncanny 100 Near Mint 1 3415 86
-X-Men, The Uncanny 101 Near Mint 1 3416 86
-X-Men, The Uncanny 102 Near Mint 1 3417 86
-X-Men, The Uncanny 103 Near Mint 1 3418 86
-X-Men, The Uncanny 104 Near Mint 1 3419 86
-X-Men, The Uncanny 105 Near Mint 1 3420 86
-X-Men, The Uncanny 106 Near Mint 1 3421 86
-X-Men, The Uncanny 107 Near Mint 1 3422 86
-X-Men, The Uncanny 108 Near Mint 1 3423 86
-X-Men, The Uncanny 109 Near Mint 1 3424 86
-X-Men, The Uncanny 110 Near Mint 1 3425 86
-X-Men, The Uncanny 111 Near Mint 1 3426 86
-X-Men, The Uncanny 112 Near Mint 1 3427 86
-X-Men, The Uncanny 113 Near Mint 1 3428 86
-X-Men, The Uncanny 114 Near Mint 1 3429 86
-X-Men, The Uncanny 115 Near Mint 1 3430 86
-X-Men, The Uncanny 116 Near Mint 1 3431 86
-X-Men, The Uncanny 117 Near Mint 1 3432 86
-X-Men, The Uncanny 118 Near Mint 1 3433 86
-X-Men, The Uncanny 119 Near Mint 1 3434 86
-X-Men, The Uncanny 120 Near Mint 1 3435 86
-X-Men, The Uncanny 121 Near Mint 1 3436 86
-X-Men, The Uncanny 122 Near Mint 1 3437 86
-X-Men, The Uncanny 123 Near Mint 1 3438 86
-X-Men, The Uncanny 124 Near Mint 1 3439 86
-X-Men, The Uncanny 125 Near Mint 1 3440 86
-X-Men, The Uncanny 126 Near Mint 1 3441 86
-X-Men, The Uncanny 127 Near Mint 1 3442 86
-X-Men, The Uncanny 128 Near Mint 1 3443 86
-X-Men, The Uncanny 129 Near Mint 1 3444 86
-X-Men, The Uncanny 131 Near Mint 1 3445 86
-X-Men, The Uncanny 133 Near Mint 1 3446 86
-X-Men, The Uncanny 134 Near Mint 1 3447 86
-X-Men, The Uncanny 136 Near Mint 1 3448 86
-X-Men, The Uncanny 137 Near Mint 1 3449 86
-X-Men, The Uncanny 138 Near Mint 1 3450 86
-X-Men, The Uncanny 139 Near Mint 1 3451 86
-X-Men, The Uncanny 140 Near Mint 1 3452 86
-X-Men, The Uncanny 141 Near Mint 1 3453 86
-X-Men, The Uncanny 142 Near Mint 1 3454 86
-X-Men, The Uncanny 143 Near Mint 1 3455 86
-X-Men, The Uncanny 144 Near Mint 1 3456 86
-X-Men, The Uncanny 148 Near Mint 1 3457 86
-X-Men, The Uncanny 151 Near Mint 1 3458 86
-X-Men, The Uncanny 160 Near Mint 1 3459 86
-X-Men, The Uncanny 161 Near Mint 1 3460 86
-X-Men, The Uncanny 162 Near Mint 1 3461 86
-X-Men, The Uncanny 163 Near Mint 1 3462 86
-X-Men, The Uncanny 164 Near Mint 1 3463 86
-X-Men, The Uncanny 183 Near Mint 1 3464 86
-X-Men, The Uncanny 184 Near Mint 1 3465 86
-X-Men, The Uncanny 185 Near Mint 1 3466 86
-X-Men, The Uncanny 187 Near Mint 1 3467 86
-X-Men, The Uncanny 188 Near Mint 1 3468 86
-X-Men, The Uncanny 189 Near Mint 1 3469 86
-X-Men, The Uncanny 190 Near Mint 1 3470 86
-X-Men, The Uncanny 191 Near Mint 1 3471 86
-X-Men, The Uncanny 192 Near Mint 1 3472 86
-X-Men, The Uncanny 193 Near Mint 1 3473 86
-X-Men, The Uncanny 202 Near Mint 1 3474 86
-X-Men, The Uncanny (Annual) 3 Near Mint 1 3475 87
-X-Men, The Uncanny (Annual) 4 Near Mint 1 3476 87
-X-Men, The Uncanny (Annual) 6 Near Mint 1 3477 87
-X-Men, The Uncanny (Annual) 8 Near Mint 1 3478 87
-X-Men, The Uncanny (Annual) 9 Near Mint 1 3479 87
-She Hulk, The Savage 2 Near Mint 4 2976 382
-She Hulk, The Savage 3 Near Mint 2 2977 382
-She Hulk, The Savage 4 Near Mint 1 2978 382
-She Hulk, The Savage 5 Near Mint 1 2979 382
-She Hulk, The Savage 6 Near Mint 1 2980 382
-She Hulk, The Savage 7 Near Mint 1 2981 382
-She Hulk, The Savage 13 Near Mint 1 2982 382
-She Hulk, The Savage 14 Near Mint 1 2983 382
-She Hulk, The Savage 15 Near Mint 1 2984 382
-She Hulk, The Savage 16 Near Mint 1 2985 382
-She Hulk, The Savage 17 Near Mint 1 2986 382
-She Hulk, The Savage 18 Near Mint 1 2987 382
-She Hulk, The Savage 19 Near Mint 1 2988 382
-She Hulk, The Savage 20 Near Mint 1 2989 382
-She Hulk, The Savage 24 Near Mint 1 2990 382
-Shogun Warriors 1 Near Mint 3 2991 383
-Shogun Warriors 2 Near Mint 2 2992 383
-Shogun Warriors 3 Near Mint 2 2993 383
-Shogun Warriors 4 Near Mint 2 2994 383
-Shogun Warriors 5 Near Mint 2 2995 383
-Shogun Warriors 6 Near Mint 1 2996 383
-Shogun Warriors 7 Near Mint 1 2997 383
-Shogun Warriors 8 Near Mint 1 2998 383
-Shogun Warriors 9 Near Mint 1 2999 383
-Shogun Warriors 10 Near Mint 1 3000 383
-Shogun Warriors 11 Near Mint 2 3001 383
-Shogun Warriors 12 Near Mint 2 3002 383
-Shogun Warriors 13 Near Mint 1 3003 383
-Shogun Warriors 14 Near Mint 1 3004 383
-Shogun Warriors 15 Near Mint 1 3005 383
-Shogun Warriors 16 Near Mint 1 3006 383
-Shogun Warriors 17 Near Mint 1 3007 383
-Shogun Warriors 18 Near Mint 1 3008 383
-Silver Surfer (one-shot) 1 Near Mint 6 3009 384
-Six from Sirius 1 Near Mint 1 3010 385
-Six from Sirius 2 Near Mint 1 3011 385
-Six from Sirius 3 Near Mint 1 3012 385
-Six from Sirius 4 Near Mint 1 3013 385
-Sonic Disrupters 1 Near Mint 1 3014 386
-Sonic Disrupters 2 Near Mint 1 3015 386
-Sonic Disrupters 3 Near Mint 1 3016 386
-Sonic Disrupters 4 Near Mint 1 3017 386
-Sonic Disrupters 5 Near Mint 1 3018 386
-Sonic Disrupters 6 Near Mint 1 3019 386
-Spanner's Galaxy 1 Near Mint 1 3020 393
-Spanner's Galaxy 2 Near Mint 1 3021 393
-Spanner's Galaxy 3 Near Mint 1 3022 393
-Spanner's Galaxy 4 Near Mint 1 3023 393
-Spanner's Galaxy 6 Near Mint 1 3024 393
-Spectacular Spiderham, Peter Porker the 1 Near Mint 1 3025 388
-Spectacular Spiderman, The 1 Near Mint 1 3026 389
-Spectacular Spiderman, The 28 Near Mint 1 3027 389
-Spectacular Spiderman, The 31 Near Mint 1 3028 389
-Spectacular Spiderman, The 36 Near Mint 1 3029 389
-Spectacular Spiderman, The 37 Near Mint 1 3030 389
-Spectacular Spiderman, The 38 Near Mint 1 3031 389
-Spectacular Spiderman, The 39 Near Mint 1 3032 389
-Spectacular Spiderman, The 40 Near Mint 1 3033 389
-Spectacular Spiderman, The 41 Near Mint 1 3034 389
-Spectacular Spiderman, The 42 Near Mint 1 3035 389
-Spectacular Spiderman, The 44 Near Mint 1 3036 389
-Spectacular Spiderman, The 45 Near Mint 1 3037 389
-Spectacular Spiderman, The 46 Near Mint 1 3038 389
-Spectacular Spiderman, The 47 Near Mint 1 3039 389
-Spectacular Spiderman, The 51 Near Mint 1 3040 389
-Spectacular Spiderman, The 53 Near Mint 1 3041 389
-Spectacular Spiderman, The 54 Near Mint 1 3042 389
-Spectacular Spiderman, The 55 Near Mint 1 3043 389
-Spectacular Spiderman, The 56 Near Mint 1 3044 389
-Spectacular Spiderman, The 57 Near Mint 1 3045 389
-Spectacular Spiderman, The 58 Near Mint 1 3046 389
-Spectacular Spiderman, The 60 Near Mint 1 3047 389
-Spectacular Spiderman, The 61 Near Mint 1 3048 389
-Spectacular Spiderman, The 62 Near Mint 1 3049 389
-Spectacular Spiderman, The (Annual) 1 Near Mint 1 3050 390
-Spectacular Spiderman, The (Annual) 2 Near Mint 1 3051 390
-Spectacular Spiderman, The (Annual) 3 Near Mint 1 3052 390
-Spiderman 1 Near Mint 1 3053 391
-Spiderman 2 Near Mint 1 3054 391
-Spiderman 3 Near Mint 1 3055 391
-Spiderman 4 Near Mint 1 3056 391
-Spiderman 5 Near Mint 1 3057 391
-Spiderman 6 Near Mint 1 3058 391
-Spiderman 7 Near Mint 1 3059 391
-Spiderwoman (vol. 1) 1 Near Mint 2 3060 394
-Spiderwoman (vol. 1) 2 Near Mint 1 3061 394
-Spiderwoman (vol. 1) 3 Near Mint 1 3062 394
-Spiderwoman (vol. 1) 4 Near Mint 1 3063 394
-Spiderwoman (vol. 1) 5 Near Mint 1 3064 394
-Spiderwoman (vol. 1) 6 Near Mint 1 3065 394
-Spiderwoman (vol. 1) 7 Near Mint 1 3066 394
-Spiderwoman (vol. 1) 8 Near Mint 1 3067 394
-Spiderwoman (vol. 1) 9 Near Mint 1 3068 394
-Spiderwoman (vol. 1) 10 Near Mint 1 3069 394
-Spiderwoman (vol. 1) 11 Near Mint 1 3070 394
-Spiderwoman (vol. 1) 12 Near Mint 1 3071 394
-Spiderwoman (vol. 1) 13 Near Mint 1 3072 394
-Spiderwoman (vol. 1) 14 Near Mint 1 3073 394
-Spiderwoman (vol. 1) 15 Near Mint 1 3074 394
-Spiderwoman (vol. 1) 16 Near Mint 1 3075 394
-Spiderwoman (vol. 1) 17 Near Mint 1 3076 394
-Spiderwoman (vol. 1) 18 Near Mint 1 3077 394
-Spiderwoman (vol. 1) 19 Near Mint 1 3078 394
-Spiderwoman (vol. 1) 20 Near Mint 1 3079 394
-Spiderwoman (vol. 1) 21 Near Mint 1 3080 394
-Spiderwoman (vol. 1) 22 Near Mint 1 3081 394
-Spiderwoman (vol. 1) 23 Near Mint 1 3082 394
-Spiderwoman (vol. 1) 24 Near Mint 1 3083 394
-Spiderwoman (vol. 1) 25 Near Mint 1 3084 394
-Spiderwoman (vol. 1) 26 Near Mint 1 3085 394
-Spiderwoman (vol. 1) 27 Near Mint 1 3086 394
-Spiderwoman (vol. 1) 28 Near Mint 1 3087 394
-Spiderwoman (vol. 1) 29 Near Mint 1 3088 394
-Spiderwoman (vol. 1) 31 Near Mint 1 3089 394
-Spiderwoman (vol. 1) 32 Near Mint 1 3090 394
-Spiderwoman (vol. 1) 33 Near Mint 1 3091 394
-Spiderwoman (vol. 1) 34 Near Mint 1 3092 394
-Spiderwoman (vol. 1) 35 Near Mint 1 3093 394
-Spiderwoman (vol. 1) 36 Near Mint 1 3094 394
-Spiderwoman (vol. 1) 37 Near Mint 1 3095 394
-Spiderwoman (vol. 1) 38 Near Mint 2 3096 394
-Spiderwoman (vol. 1) 39 Near Mint 1 3097 394
-Spiderwoman (vol. 1) 40 Near Mint 1 3098 394
-Spiderwoman (vol. 1) 41 Near Mint 1 3099 394
-Spiderwoman (vol. 1) 42 Near Mint 2 3100 394
-Spiderwoman (vol. 1) 43 Near Mint 2 3101 394
-Spiderwoman (vol. 1) 44 Near Mint 1 3102 394
-Spiderwoman (vol. 1) 45 Near Mint 1 3103 394
-Spiderwoman (vol. 1) 46 Near Mint 1 3104 394
-Spiderwoman (vol. 1) 47 Near Mint 1 3105 394
-Spiderwoman (vol. 1) 48 Near Mint 1 3106 394
-Spiderwoman (vol. 1) 49 Near Mint 1 3107 394
-Spiderwoman (vol. 1) 50 Near Mint 1 3108 394
-Spirit, The 28 Near Mint 1 3109 392
-Spirit, The 36 Near Mint 1 3110 392
-Spirit, The 37 Near Mint 1 3111 392
-Star Slayer 1 Near Mint 1 3112 396
-Star Slayer 2 Near Mint 1 3113 396
-Star Slayer 3 Near Mint 1 3114 396
-Star Slayer 4 Near Mint 1 3115 396
-Star Slayer 5 Near Mint 1 3116 396
-Star Trek 1 Near Mint 6 3117 398
-Star Trek 2 Near Mint 4 3118 398
-Star Trek 3 Near Mint 1 3119 398
-Star Trek 4 Near Mint 1 3120 398
-Star Wars 1 Near Mint 1 3121 399
-Star Wars 2 Near Mint 1 3122 399
-Star Wars 3 Near Mint 1 3123 399
-Star Wars 4 Near Mint 2 3124 399
-Star Wars 5 Near Mint 1 3125 399
-Star Wars 6 Near Mint 1 3126 399
-Star Wars 7 Near Mint 1 3127 399
-Star Wars 8 Near Mint 1 3128 399
-Star Wars 9 Near Mint 1 3129 399
-Star Wars 10 Near Mint 1 3130 399
-Star Wars 11 Near Mint 1 3131 399
-Star Wars 12 Near Mint 1 3132 399
-Star Wars 13 Near Mint 1 3133 399
-Star Wars 14 Near Mint 1 3134 399
-Star Wars 15 Near Mint 1 3135 399
-Star Wars 16 Near Mint 1 3136 399
-Star Wars 17 Near Mint 1 3137 399
-Star Wars 18 Near Mint 1 3138 399
-Star Wars 19 Near Mint 1 3139 399
-Star Wars 20 Near Mint 1 3140 399
-Star Wars 21 Near Mint 1 3141 399
-Star Wars 22 Near Mint 1 3142 399
-Star Wars 23 Near Mint 1 3143 399
-Legion of Super-Heroes (vol. 4) 66 Near Mint 1 3652 145
-Sandman Mystery Theatre (Annual) 1 Near Mint 1 3653 449
-Starman (vol. 3) 5 Near Mint 1 3654 440
-Icon 23 Near Mint 1 3655 17
-Cerebus 190 Mother's and Daughter's Near Mint 1 3656 123
-Cerebus 191 Mother's and Daughter's Near Mint 1 3657 123
-Cerebus World Tour Book 1995 1 Near Mint 1 3658 450
-Legionnaires 22 Near Mint 1 3659 11
-Legion of Super-Heroes (vol. 4) 65 Near Mint 1 3660 145
-Action Comics 707 Near Mint 1 3661 142
-Action Comics 708 Near Mint 1 3662 142
-Superman, The Adventures of 521 Near Mint 1 3663 51
-Superman (vol. 2) 98 Near Mint 1 3664 165
-Guardians of Metropolis 4 Near Mint 1 3665 443
-Absolute Vertigo 1 Near Mint 1 3666 451
-Jonah Hex: Riders of the Worm and Such 1 Near Mint 1 3667 452
-Madman Comics 5 Near Mint 1 3668 260
-Green Lantern (vol. 2) 59 Near Mint 1 3669 49
-Green Lantern (vol. 2) 60 Near Mint 1 3670 49
-Static 21 Near Mint 1 3671 33
-Maxx, The 13 Near Mint 1 3672 2
-Moonshadow 6 Near Mint 1 3673 444
-Moonshadow 7 Near Mint 1 3674 444
-Hellblazer 86 Near Mint 1 3675 15
-Hellblazer 87 Near Mint 1 3676 15
-Sandman 67 Kindly Ones, The Near Mint 1 3677 10
-Books of Magic (regular series) 10 The Artificial Heart Near Mint Part 2 1 3678 435
-Books of Magic (regular series) 11 The Artificial Heart Near Mint Part 3 1 3679 435
-Invisibles 6 Arcadia Near Mint Part 2 1 3680 303
-Invisibles 7 Arcadia Near Mint Part 3 1 3681 303
-Showcase '95 3 Near Mint Eradicator,The Question, Claw 1 3682 447
-Strangers In Paradise 1 Near Mint September 1994 Printing 1 3683 453
-Strangers In Paradise 2 Near Mint November 1994 Printing 1 3684 453
-Starman (vol. 3) 6 Near Mint 1 3685 440
-Icon 24 Near Mint 1 3686 17
-Legion of Super-Heroes (vol. 4) 67 Near Mint 1 3687 145
-Legionnaires 24 Near Mint 1 3688 11
-Power of Shazam, The 1 Near Mint 1 3689 454
-Power of Shazam, The 2 Near Mint 1 3690 454
-Superboy (vol. 2) 14 Near Mint 1 3691 120
-Green Lantern (vol. 2) 61 Near Mint 1 3692 49
-Superman, The Adventures of 522 Near Mint 1 3693 51
-Superman (vol. 2) 99 Near Mint 1 3694 165
-Superman, The Man of Steel 43 Near Mint 1 3695 18
-Metropolis S.C.U. 1 Near Mint 1 3696 455
-Metropolis S.C.U. 2 Near Mint 1 3697 455
-Metropolis S.C.U. 3 Near Mint 1 3698 455
-Xenobrood 1 Near Mint 1 3699 456
-Xenobrood 2 Near Mint 1 3700 456
-Shade, The Changing Man 58 Near Mint 1 3701 446
-Moonshadow 8 Near Mint 1 3702 444
-Maxx, The 14 Near Mint 1 3703 2
-Hellblazer 88 Near Mint 1 3704 15
-Steel 11 Near Mint 1 3705 121
-Sandman Mystery Theatre 25 Near Mint 1 3706 20
-Jonah Hex: Riders of the Worm and Such 2 Near Mint 1 3707 452
-Static 22 Near Mint 1 3708 33
-Wolff & Byrd 5 Near Mint 1 3709 457
-Metropolis S.C.U. 4 Near Mint 1 3710 455
-Invisibles 8 Near Mint 1 3711 303
-Cerebus 192 Mother's and Daughter's Near Mint 1 3712 123
-Primal Force 6 Near Mint 1 3713 436
-Showcase '95 4 Near Mint 1 3714 447
-Impulse 1 Near Mint 1 3715 458
-Action Comics 709 Near Mint 1 3716 142
-Preacher 1 Near Mint 1 3717 459
-Superman (vol. 2) 100 Near Mint Collector's Edition 1 3718 165
-Maxx, The 9 Near Mint 1 3719 2
-Sandman 68 Near Mint 1 3720 10
-Green Lantern (vol. 2) 62 Near Mint 1 3721 49
-Primal Force 7 Near Mint 1 3722 436
-Books of Magic (regular series) 13 Small Glass Worlds Near Mint Part 2 1 3723 435
-Books of Magic (regular series) 14 Near Mint 1 3724 435
-Cerebus 193 Mother's and Daughter's Near Mint 1 3725 123
-Cerebus 194 Mother's and Daughter's Near Mint 1 3726 123
-Hellblazer 90 Near Mint 1 3727 15
-Hellblazer 91 Near Mint 1 3728 15
-Icon 25 Near Mint 1 3729 17
-Impulse 2 Near Mint 1 3730 458
-Impulse 3 Near Mint 1 3731 458
-Jonah Hex: Riders of the Worm and Such 3 Near Mint 1 3732 452
-Jonah Hex: Riders of the Worm and Such 4 Near Mint 1 3733 452
-Legionnaires 25 Near Mint 1 3734 11
-Legionnaires 26 Near Mint 1 3735 11
-Legion of Super-Heroes (vol. 4) 69 Near Mint 1 3736 145
-Legion of Super-Heroes (vol. 4) 70 Near Mint 1 3737 145
-Legion of Super-Heroes (vol. 4) (Annual) 6 Near Mint 1 3738 256
-Mister Miracle (vol. 3) 5 Near Mint 1 4081 495
-Mister Miracle (vol. 3) 6 Near Mint 1 4082 495
-Mister Miracle (vol. 3) 7 Near Mint 1 4083 495
-Monkeyman and O'Brien 1 Near Mint 1 4084 496
-Monkeyman and O'Brien 2 Near Mint 1 4085 496
-New Gods (vol. 3) 7 Near Mint 1 4086 469
-New Gods (vol. 3) 8 Near Mint 1 4087 469
-New Gods (vol. 3) 9 Near Mint 1 4088 469
-New Gods (vol. 3) 10 Near Mint 1 4089 469
-New Gods (vol. 3) 11 Near Mint 1 4090 469
-New Gods (vol. 3) 12 Near Mint 1 4091 469
-New Gods (vol. 3) 13 Near Mint 1 4092 469
-New Gods (vol. 3) 14 Near Mint 1 4093 469
-Power of Shazam, The 14 Near Mint 1 4094 454
-Power of Shazam, The 15 Near Mint 1 4095 454
-Power of Shazam, The 16 Near Mint 1 4096 454
-Power of Shazam, The 17 Near Mint 1 4097 454
-Power of Shazam, The 18 Near Mint 1 4098 454
-Power of Shazam, The 19 Near Mint 1 4099 454
-Power of Shazam, The 20 Near Mint 1 4100 454
-Power of Shazam, The 21 Near Mint 1 4101 454
-Power of Shazam, The (Annual) 1 Near Mint 1 4102 497
-Sandman 74 Near Mint 1 4103 10
-Sandman 75 Near Mint 1 4104 10
-Sandman Mystery Theatre 41 Near Mint 1 4105 20
-Sandman Mystery Theatre 42 Near Mint 1 4106 20
-Sandman Mystery Theatre 43 Near Mint 1 4107 20
-Sandman Mystery Theatre 44 Near Mint 1 4108 20
-Sandman Mystery Theatre 45 Near Mint 1 4109 20
-Spirit: The Origin Years 2 Near Mint 1 4110 498
-Starman (vol. 3) 17 Near Mint 1 4111 440
-Starman (vol. 3) 18 Near Mint 1 4112 440
-Starman (vol. 3) 19 Near Mint 1 4113 440
-Starman (vol. 3) 20 Near Mint 1 4114 440
-Starman (vol. 3) 21 Near Mint 1 4115 440
-Starman (vol. 3) 22 Near Mint 1 4116 440
-Starman (vol. 3) 23 Near Mint 1 4117 440
-Static 25 Near Mint 1 4118 33
-Static 26 Near Mint 1 4119 33
-Static 27 Near Mint 1 4120 33
-Static 31 Near Mint 1 4121 33
-Static 32 Near Mint 1 4122 33
-Static 33 Near Mint 1 4123 33
-Static 34 Near Mint 1 4124 33
-Static 35 Near Mint 1 4125 33
-Static 36 Near Mint 1 4126 33
-Static 37 Near Mint 1 4127 33
-Static 38 Near Mint 1 4128 33
-Superboy (vol. 2) 27 Near Mint 1 4129 120
-Superboy (vol. 2) 28 Near Mint 1 4130 120
-Superboy (vol. 2) 29 Near Mint 1 4131 120
-Superboy (vol. 2) 30 Near Mint 1 4132 120
-Supergirl (Annual) 1 Near Mint 1 4133 499
-Superman (vol. 2) 59 Near Mint 1 4134 165
-Superman (vol. 2) 118 Near Mint 1 4135 165
-Superman (vol. 2) 119 Near Mint 1 4136 165
-Superman, The Adventures of 533 Near Mint 1 4137 51
-Superman, The Adventures of 534 Near Mint 1 4138 51
-Superman, The Adventures of 535 Near Mint 1 4139 51
-Superman, The Adventures of 536 Near Mint 1 4140 51
-Superman, The Adventures of 537 Near Mint 1 4141 51
-Superman, The Adventures of 538 Near Mint 1 4142 51
-Superman, The Adventures of 539 Near Mint 1 4143 51
-Superman, The Adventures of 540 Near Mint 1 4144 51
-Superman, The Adventures of 541 Near Mint 1 4145 51
-Superman, The Adventures of 542 Near Mint 1 4146 51
-Superman, The Adventures of (Annual) 8 Near Mint 1 4147 122
-Superman, The Man of Steel 55 Near Mint 1 4148 18
-Superman, The Man of Steel 56 Near Mint 1 4149 18
-Superman, The Man of Steel 57 Near Mint 1 4150 18
-Superman, The Man of Steel 58 Near Mint 1 4151 18
-Superman, The Man of Steel 59 Near Mint 1 4152 18
-Superman, The Man of Steel 60 Near Mint 1 4153 18
-Superman, The Man of Steel 61 Near Mint 1 4154 18
-Superman, The Man of Steel 62 Near Mint 1 4155 18
-Superman, The Man of Steel 63 Near Mint 1 4156 18
-Superman, The Man of Steel 64 Near Mint 1 4157 18
-Superman: The Man of Tomorrow 4 Near Mint 1 4158 463
-Superman: The Man of Tomorrow 5 Near Mint 1 4159 463
-Superman: The Man of Tomorrow 6 Near Mint 1 4160 463
-Superman: The Wedding Album 1 Near Mint 1 4161 500
-Teen Titans (vol. 2) 1 Near Mint Jurgens and Perez 1 4162 501
-Vigilante: City Lights Prairie Justice 3 Near Mint 1 4163 474
-Vigilante: City Lights Prairie Justice 4 Near Mint 1 4164 474
-Wanderers, The 7 Near Mint 1 4165 109
-Wanderers, The 8 Near Mint 1 4166 109
-Who's Who in the DC Universe 5 Near Mint 1 4167 428
-Wolff & Byrd 9 Near Mint 1 4168 457
-Wolff & Byrd 10 Near Mint 1 4169 457
-Wolff & Byrd 11 Near Mint 1 4170 457
-Wolff & Byrd: Case Files 1 Near Mint Collects 1-4 1 4171 5050
-Wonder Woman 109 Near Mint 1 4172 475
-Wonder Woman 110 Near Mint 1 4173 475
-Wonder Woman 111 Near Mint 1 4174 475
-Wonder Woman 112 Near Mint 1 4175 475
-Wonder Woman 113 Near Mint 1 4176 475
-Wonder Woman 114 Near Mint 1 4177 475
-Superman Adventures 1 Near Mint 1 4178 502
-Hellblazer 31 Near Mint 1 4179 15
-Forever People 1 Near Mint Kirby 1 4180 136
-Shade, The Changing Man 1 Near Mint 1 4181 446
-Justice League America 1 Near Mint 1 4182 12
-Justice League America 2 Near Mint 1 4183 12
-Justice League America 3 Near Mint 1 4184 12
-Justice League America 4 Near Mint 1 4185 12
-Justice League America 5 Near Mint 1 4186 12
-Justice League America 6 Near Mint 1 4187 12
-Cerebus 48 Near Mint 1 4188 123
-Cerebus 77 Near Mint 1 4189 123
-Cerebus 78 Near Mint 1 4190 123
-Cerebus 80 Near Mint 1 4191 123
-Cerebus 81 Near Mint 1 4192 123
-Cerebus 82 Near Mint 1 4193 123
-Cerebus 83 Near Mint 1 4194 123
-Cerebus 84 Near Mint 1 4195 123
-Cerebus 85 Near Mint 1 4196 123
-Cerebus 88 Near Mint 1 4197 123
-Cerebus 90 Near Mint 2 4198 123
-Adventure Comics 373 Near Mint Legion and Tornado Twins 1 4199 170
-Black Panther 12 Near Mint Kirby 1 4200 80
-Black Panther 5 Near Mint Kirby 1 4201 80
-Madman Comics 7 Near Mint 1 3739 260
-Preacher 2 Near Mint 1 3740 459
-Preacher 3 Near Mint 1 3741 459
-Primal Force 8 Near Mint 1 3742 436
-Primal Force 9 Near Mint 1 3743 436
-Sovereign Seven 1 Near Mint 1 3744 460
-Showcase '95 5 Near Mint 1 3745 447
-Showcase '95 6 Near Mint 1 3746 447
-Sandman 69 Near Mint Death of Morpheus 1 3747 10
-Static 24 Near Mint 1 3748 33
-Power of Shazam, The 3 Near Mint 1 3749 454
-Power of Shazam, The 4 Near Mint 1 3750 454
-Superboy (vol. 2) 16 Near Mint 1 3751 120
-Superboy (vol. 2) 17 Near Mint 1 3752 120
-Superman, The Adventures of 523 Near Mint 1 3753 51
-Superman, The Adventures of 524 Near Mint 1 3754 51
-Superman (vol. 2) (Annual) 7 Near Mint 1 3755 166
-Superman (vol. 2) 101 Near Mint 1 3756 165
-Superman (vol. 2) 102 Near Mint 1 3757 165
-Superman, The Man of Steel 45 Near Mint 1 3758 18
-Superman, The Man of Steel 46 Near Mint 1 3759 18
-Starman (vol. 3) 7 Near Mint 1 3760 440
-Starman (vol. 3) 8 Near Mint 1 3761 440
-Starman (vol. 3) 9 Near Mint 1 3762 440
-Sandman Mystery Theatre 26 Near Mint 1 3763 20
-Sandman Mystery Theatre 27 Near Mint 1 3764 20
-Sandman Mystery Theatre 28 Near Mint 1 3765 20
-Breathtaker 1 Near Mint 1 3766 461
-Power of Shazam, The (Graphic Novel) 1 Near Mint 1 3767 462
-Shade, The Changing Man 59 Near Mint 1 3768 446
-Shade, The Changing Man 60 Near Mint 1 3769 446
-Shade, The Changing Man 61 Near Mint 1 3770 446
-Invisibles 9 Near Mint 1 3771 303
-Invisibles 10 Near Mint 1 3772 303
-Maxx, The 15 Near Mint 1 3773 2
-Icon 27 Near Mint 1 3774 17
-Superman: The Man of Tomorrow 1 Near Mint 1 3775 463
-Superman, The Adventures of 525 Near Mint 1 3776 51
-Impulse 4 Near Mint 1 3777 458
-Wolff & Byrd 6 Near Mint 1 3778 457
-Superman vs. Aliens 1 Near Mint 1 3779 464
-Legionnaires 27 Near Mint 1 3780 11
-Preacher 4 Near Mint 1 3781 459
-Jonah Hex: Riders of the Worm and Such 5 Near Mint 1 3782 452
-Power of Shazam, The 5 Near Mint 1 3783 454
-Action Comics 661 Near Mint 1 3784 142
-Action Comics 710 Near Mint 1 3785 142
-Action Comics 711 Near Mint 1 3786 142
-Action Comics 712 Near Mint 1 3787 142
-Action Comics 713 Near Mint 1 3788 142
-Action Comics 715 Near Mint 1 3789 142
-Action Comics 716 Trail of Superman Near Mint 1 3790 142
-Action Comics 717 Trail of Superman Near Mint 1 3791 142
-Action Comics 718 Near Mint 1 3792 142
-Action Comics 719 Near Mint 1 3793 142
-Action Comics (Annual) 1 Near Mint Byrne story, Art Adams art 1 3794 258
-Action Comics (Annual) 7 Year One Near Mint 1 3795 258
-Kurt Busiek's Astro City 1 Near Mint 1 3796 465
-Kurt Busiek's Astro City 2 Near Mint 1 3797 465
-Kurt Busiek's Astro City 3 Near Mint 1 3798 465
-Kurt Busiek's Astro City 4 Near Mint 1 3799 465
-Kurt Busiek's Astro City 5 Near Mint 1 3800 465
-Kurt Busiek's Astro City 6 Near Mint 1 3801 465
-Books of Magic (regular series) 15 Playgrounds Near Mint Part 1 1 3802 435
-Books of Magic (regular series) 16 Playgrounds Near Mint Part 2 1 3803 435
-Books of Magic (regular series) 17 Playgrounds Near Mint Part 3 1 3804 435
-Books of Magic (regular series) 18 Playgrounds Near Mint Part 4 1 3805 435
-Books of Magic (regular series) 19 Playgrounds Near Mint Part 5 1 3806 435
-Books of Magic (regular series) 20 Playgrounds Near Mint Epilogue 1 3807 435
-Cerebus 195 Mother's and Daughter's Near Mint 1 3808 123
-Cerebus 196 Mother's and Daughter's Near Mint 1 3809 123
-Cerebus 197 Mother's and Daughter's Near Mint 1 3810 123
-Cerebus 198 Mother's and Daughter's Near Mint 1 3811 123
-Cerebus 199 Mother's and Daughter's Near Mint 1 3812 123
-Cerebus 200 Mother's and Daughter's Near Mint 1 3813 123
-Cerebus 201 Guys Near Mint 1 3814 123
-Cerebus 202 Guys Near Mint 1 3815 123
-Vertigo Voices: The Eaters 1 Near Mint 1 3816 466
-Flash 111 Dead Heat Near Mint Finale 1 3817 467
-Green Lantern (vol. 2) 65 The Siege of the Zi Charam Near Mint Part 2 1 3818 49
-Hellblazer 92 Critical Mass Near Mint Part 1 1 3819 15
-Hellblazer 93 Critical Mass Near Mint Part 2 1 3820 15
-Hellblazer 94 Critical Mass Near Mint Part 3 1 3821 15
-Hellblazer 95 Critical Mass Near Mint Part 4 1 3822 15
-Hellblazer 96 Critical Mass Near Mint Part 5 1 3823 15
-Hellblazer 97 Near Mint 1 3824 15
-Hellblazer 98 Near Mint 1 3825 15
-Hellblazer 99 Near Mint 1 3826 15
-Green Lantern (vol. 2) 63 Parallax View Near Mint Part1 1 3827 49
-Green Lantern (vol. 2) 64 Parallax View Near Mint Part 2 1 3828 49
-Grendel 2 Near Mint 1 3829 468
-Grendel 4 Near Mint 1 3830 468
-Grendel 9 Near Mint 1 3831 468
-Grendel 11 Near Mint 1 3832 468
-Icon 28 Near Mint 1 3833 17
-Icon 29 Near Mint 1 3834 17
-Icon 30 Near Mint 1 3835 17
-Icon 31 Near Mint 1 3836 17
-Icon 32 Near Mint 1 3837 17
-Icon 33 Near Mint 1 3838 17
-Icon 34 Near Mint 1 3839 17
-Impulse 5 Near Mint 1 3840 458
-Impulse 6 Near Mint 1 3841 458
-Impulse 7 Near Mint 1 3842 458
-Impulse 8 Near Mint 1 3843 458
-Impulse 9 Near Mint 1 3844 458
-Impulse 10 Near Mint 1 3845 458
-Impulse 11 Near Mint 1 3846 458
-Invisibles 11 Near Mint 1 3847 303
-Invisibles 12 Near Mint 1 3848 303
-Legionnaires 28 Near Mint 1 3849 11
-Legionnaires 29 Near Mint 1 3850 11
-Legionnaires 30 Near Mint 1 3851 11
-Legionnaires 31 Near Mint 1 3852 11
-Legionnaires 32 Near Mint 1 3853 11
-Legionnaires 33 Near Mint 1 3854 11
-Legionnaires 34 Near Mint 1 3855 11
-Legionnaires (Annual) 2 Near Mint Death of Phantom Girl 1 3856 257
-Legion of Super-Heroes (vol. 4) 71 Near Mint 1 3857 145
-Legion of Super-Heroes (vol. 4) 72 Near Mint 1 3858 145
-Legion of Super-Heroes (vol. 4) 73 Near Mint 1 3859 145
-Legion of Super-Heroes (vol. 4) 74 Near Mint 1 3860 145
-Legion of Super-Heroes (vol. 4) 75 Near Mint 1 3861 145
-Legion of Super-Heroes (vol. 4) 76 Near Mint 1 3862 145
-Legion of Super-Heroes (vol. 4) 77 Near Mint 1 3863 145
-Legion of Super-Heroes (vol. 4) 78 Near Mint 1 3864 145
-Madman Comics 8 Near Mint 1 3865 260
-Madman Comics 9 Near Mint 1 3866 260
-Madman Comics 10 Near Mint 1 3867 260
-New Gods (vol. 3) 1 Near Mint 1 3868 469
-New Gods (vol. 3) 2 Near Mint 1 3869 469
-New Gods (vol. 3) 3 Near Mint 1 3870 469
-New Gods (vol. 3) 4 Near Mint 1 3871 469
-New Gods (vol. 3) 5 Near Mint 1 3872 469
-New Gods (vol. 3) 6 Near Mint 1 3873 469
-Preacher 5 Near Mint 1 3874 459
-Preacher 6 Near Mint 1 3875 459
-Preacher 7 Near Mint 1 3876 459
-Primal Force 10 Near Mint 1 3877 436
-Primal Force 11 Near Mint 1 3878 436
-Punx 1 Near Mint Giffen story and art 1 3879 470
-Punx 2 Near Mint 1 3880 470
-Punx 3 Near Mint 1 3881 470
-Punx (Manga) Special 1 Near Mint 1 3882 471
-Torch of Liberty Special 1 Near Mint 1 3883 472
-Static 28 Near Mint 1 3884 33
-Static 29 Near Mint 1 3885 33
-Static 30 Near Mint 1 3886 33
-Starman (vol. 3) 10 Near Mint 1 3887 440
-Starman (vol. 3) 11 Near Mint 1 3888 440
-Starman (vol. 3) 12 Near Mint 1 3889 440
-Starman (vol. 3) 13 Near Mint 1 3890 440
-Starman (vol. 3) 14 Near Mint 1 3891 440
-Starman (vol. 3) 15 Near Mint 1 3892 440
-Starman (vol. 3) 16 Near Mint 1 3893 440
-Superboy (vol. 2) 18 Near Mint 1 3894 120
-Superboy (vol. 2) 19 Near Mint 1 3895 120
-Superboy (vol. 2) 20 Near Mint 1 3896 120
-Superboy (vol. 2) 21 Near Mint 1 3897 120
-Superboy (vol. 2) 22 Near Mint 1 3898 120
-Superboy (vol. 2) 23 Near Mint 1 3899 120
-Superboy (vol. 2) 24 Near Mint 1 3900 120
-Superboy (vol. 2) 25 Near Mint 1 3901 120
-Superboy (vol. 2) 26 Near Mint 1 3902 120
-Superboy (vol. 2) (Annual) 2 Near Mint 1 3903 271
-Superman (vol. 2) 103 Near Mint 1 3904 165
-Superman (vol. 2) 104 Near Mint 1 3905 165
-Superman (vol. 2) 105 Near Mint 1 3906 165
-Superman (vol. 2) 106 Near Mint 1 3907 165
-Superman (vol. 2) 107 Near Mint 1 3908 165
-Superman (vol. 2) 110 Near Mint 1 3909 165
-Superman (vol. 2) 108 Near Mint 1 3910 165
-Superman (vol. 2) 109 Near Mint 1 3911 165
-Superman, The Adventures of 526 Near Mint 1 3912 51
-Superman, The Adventures of 527 Near Mint 1 3913 51
-Superman, The Adventures of 528 Near Mint 1 3914 51
-Superman, The Adventures of 529 Near Mint 1 3915 51
-Superman, The Adventures of 530 Near Mint 1 3916 51
-Superman, The Adventures of 531 Near Mint 1 3917 51
-Superman, The Adventures of 532 Near Mint 1 3918 51
-Superman, The Adventures of (Annual) 7 Near Mint 1 3919 122
-Superman, The Man of Steel 47 Near Mint 1 3920 18
-Superman, The Man of Steel 48 Near Mint 1 3921 18
-Superman, The Man of Steel 49 Near Mint 1 3922 18
-Superman, The Man of Steel 50 Near Mint 1 3923 18
-Superman, The Man of Steel 51 Near Mint 1 3924 18
-Superman, The Man of Steel 52 Near Mint 1 3925 18
-Superman, The Man of Steel 53 Near Mint 1 3926 18
-Superman, The Man of Steel 54 Near Mint 1 3927 18
-Superman, The Man of Steel (Annual) 4 Near Mint 1 3928 55
-Superman: The Man of Tomorrow 2 Near Mint 1 3929 463
-Superman: The Man of Tomorrow 3 Near Mint 1 3930 463
-Superman/Toyman 1 Near Mint one shot 1 3931 473
-Superman vs. Aliens 2 Near Mint 1 3932 464
-Superman vs. Aliens 3 Near Mint 1 3933 464
-Wolff & Byrd 7 Near Mint 1 3934 457
-Wolff & Byrd 8 Near Mint 1 3935 457
-Vigilante: City Lights Prairie Justice 1 Near Mint 1 3936 474
-Vigilante: City Lights Prairie Justice 2 Near Mint 1 3937 474
-Wonder Woman 101 Near Mint 1 3938 475
-Wonder Woman 102 Near Mint 1 3939 475
-Wonder Woman 103 Near Mint 1 3940 475
-Wonder Woman 104 Near Mint 1 3941 475
-Wonder Woman 105 Near Mint 1 3942 475
-Wonder Woman 106 Near Mint 1 3943 475
-Wonder Woman 107 Near Mint 1 3944 475
-Wonder Woman 108 Near Mint 1 3945 475
-Underworld Unleashed 1 Near Mint 1 3946 476
-Underworld Unleashed: Apokolips 1 Near Mint 1 3947 477
-Action Comics 714 Near Mint 1 3948 142
-Power of Shazam, The 6 Near Mint 1 3949 454
-Power of Shazam, The 7 Near Mint 1 3950 454
-Power of Shazam, The 8 Near Mint 1 3951 454
-Power of Shazam, The 9 Near Mint 1 3952 454
-Power of Shazam, The 10 Near Mint 1 3953 454
-Power of Shazam, The 11 Near Mint 1 3954 454
-Power of Shazam, The 12 Near Mint 1 3955 454
-Power of Shazam, The 13 Near Mint 1 3956 454
-Sandman 8 Near Mint First Death 1 3957 10
-Sandman 70 Near Mint 1 3958 10
-Sandman 71 Near Mint 1 3959 10
-Sandman 72 Near Mint 1 3960 10
-Sandman 73 Near Mint 1 3961 10
-Sandman Midnight Theatre 1 Near Mint 1 3962 478
-Sandman Mystery Theatre 29 The Hourman Near Mint 1 3963 20
-Sandman Mystery Theatre 30 The Hourman Near Mint 1 3964 20
-Sandman Mystery Theatre 31 The Hourman Near Mint 1 3965 20
-Sandman Mystery Theatre 32 The Hourman Near Mint 1 3966 20
-Secret Origins (vol. 2) 50 Near Mint Flash of Two Worlds, Robin, Black Canary, etc. 1 3967 143
-Showcase '95 7 Near Mint 1 3968 447
-Showcase '95 8 Near Mint 1 3969 447
-Showcase '95 9 Near Mint 1 3970 447
-Showcase '95 10 Near Mint 1 3971 447
-Showcase '95 11 Near Mint 1 3972 447
-Showcase '95 12 Near Mint 1 3973 447
-Sovereign Seven 2 Near Mint 1 3974 460
-Sovereign Seven 3 Near Mint 1 3975 460
-Legion of Super-Heroes (vol. 2) 257 Near Mint 1 3976 115
-Legion of Super-Heroes (vol. 3) 16 Near Mint 1 3977 147
-Tales of the Legion of Super-Heroes (An) 5 Near Mint reprints LSH 1 3978 479
-Action Comics 720 Near Mint 1 3979 142
-Action Comics 721 Near Mint 1 3980 142
-Action Comics 722 Near Mint 1 3981 142
-Action Comics 723 Near Mint 1 3982 142
-Action Comics 724 Near Mint 1 3983 142
-Action Comics 725 Near Mint 1 3984 142
-Action Comics 726 Near Mint 1 3985 142
-Action Comics 727 Near Mint 1 3986 142
-Action Comics 728 Near Mint 1 3987 142
-Action Comics 729 Near Mint 1 3988 142
-Ambush Bug 4 Near Mint 1 3989 178
-Aztek: The Ultimate Man 1 Near Mint 1 3990 480
-Aztek: The Ultimate Man 2 Near Mint 1 3991 480
-Aztek: The Ultimate Man 3 Near Mint 1 3992 480
-Aztek: The Ultimate Man 4 Near Mint 1 3993 480
-Aztek: The Ultimate Man 5 Near Mint 1 3994 480
-Books of Magic (regular series) 21 Near Mint 1 3995 435
-Books of Magic (regular series) 22 Near Mint 1 3996 435
-Books of Magic (regular series) 23 Near Mint 1 3997 435
-Books of Magic (regular series) 24 Near Mint 1 3998 435
-Books of Magic (regular series) 25 Near Mint 1 3999 435
-Books of Magic (regular series) 26 Near Mint 1 4000 435
-Books of Magic (regular series) 27 Near Mint 1 4001 435
-Books of Magic (regular series) 28 Near Mint 1 4002 435
-Books of Magic (regular series) 29 Near Mint 1 4003 435
-Books of Magic (regular series) 30 Near Mint 1 4004 435
-Books of Magic (regular series) 31 Near Mint 1 4005 435
-DC Super-Stars 17 Near Mint Legion 1 4006 481
-Death: The Time of Your Life 1 Near Mint 1 4007 482
-Death: The Time of Your Life 2 Near Mint 1 4008 482
-Death: The Time of Your Life 3 Near Mint 1 4009 482
-Vertigo Voices: The Eaters 1 Near Mint 1 4010 466
-Kingdom Come 1 Near Mint 1 4011 483
-Kingdom Come 2 Near Mint 1 4012 483
-Kingdom Come 3 Near Mint 1 4013 483
-Kingdom Come 4 Near Mint 1 4014 483
-Dreaming, The 1 Near Mint 1 4015 484
-Dreaming, The 2 Near Mint 1 4016 484
-Dreaming, The 3 Near Mint 1 4017 484
-Dreaming, The 4 Near Mint 1 4018 484
-Dreaming, The 5 Near Mint 1 4019 484
-Dreaming, The 6 Near Mint 1 4020 484
-Dreaming, The 7 Near Mint 1 4021 484
-Elongated Man, The 1 Near Mint 1 4022 485
-Elongated Man, The 2 Near Mint 1 4023 485
-Elongated Man, The 3 Near Mint 1 4024 485
-Elongated Man, The 4 Near Mint 1 4025 485
-Final Night 1 Near Mint 1 4026 486
-Final Night 2 Near Mint 1 4027 486
-Final Night 3 Near Mint 1 4028 486
-Final Night 4 Near Mint 1 4029 486
-Ghost and Hellboy 1 Near Mint 1 4030 487
-Ghost and Hellboy 2 Near Mint 1 4031 487
-Hellboy: The Corpse and the Iron Shoes 1 Near Mint 1 4032 488
-Hellboy: Wake the Devil 1 Near Mint 1 4033 489
-Hellboy: Wake the Devil 2 Near Mint 1 4034 489
-Hellboy: Wake the Devil 3 Near Mint 1 4035 489
-Herbie 1 Near Mint One Shot (Byrne) 1 4036 490
-House of Secrets (vol. 2) 1 Near Mint 1 4037 491
-Icon 35 Near Mint 1 4038 17
-Icon 36 Near Mint 1 4039 17
-Icon 37 Near Mint 1 4040 17
-Icon 38 Near Mint 1 4041 17
-Impulse 12 Near Mint 1 4042 458
-Impulse 13 Near Mint 1 4043 458
-Impulse 14 Near Mint 1 4044 458
-Impulse 15 Near Mint 1 4045 458
-Impulse 16 Near Mint 1 4046 458
-Impulse 17 Near Mint 1 4047 458
-Impulse 18 Near Mint 1 4048 458
-Impulse 19 Near Mint 1 4049 458
-Impulse 20 Near Mint 1 4050 458
-Impulse 21 Near Mint 1 4051 458
-Invisibles 13 Near Mint 1 4052 303
-Justice Inc. 3 Near Mint Kirby 1 4053 492
-Justice League: MIdsummer's Nightmare 2 Near Mint 1 4054 493
-Justice League: MIdsummer's Nightmare 3 Near Mint 1 4055 493
-Kurt Busiek's Astro City (vol. 2) 1 Near Mint 1 4056 494
-Kurt Busiek's Astro City (vol. 2) 2 Near Mint 1 4057 494
-Legionnaires 35 Near Mint 1 4058 11
-Legionnaires 36 Near Mint 1 4059 11
-Legionnaires 37 Near Mint 1 4060 11
-Legionnaires 38 Near Mint 1 4061 11
-Legionnaires 39 Near Mint 1 4062 11
-Legionnaires 40 Near Mint 1 4063 11
-Legionnaires 41 Near Mint 1 4064 11
-Legionnaires 42 Near Mint 1 4065 11
-Legionnaires 43 Near Mint 1 4066 11
-Legionnaires 44 Near Mint 1 4067 11
-Legionnaires (Annual) 3 Near Mint 1 4068 257
-Legion of Super-Heroes (vol. 4) 79 Near Mint 1 4069 145
-Legion of Super-Heroes (vol. 4) 80 Near Mint 1 4070 145
-Legion of Super-Heroes (vol. 4) 81 Near Mint 1 4071 145
-Legion of Super-Heroes (vol. 4) 82 Near Mint 1 4072 145
-Legion of Super-Heroes (vol. 4) 83 Near Mint 1 4073 145
-Legion of Super-Heroes (vol. 4) 84 Near Mint 1 4074 145
-Legion of Super-Heroes (vol. 4) 85 Near Mint 1 4075 145
-Legion of Super-Heroes (vol. 4) 86 Near Mint 1 4076 145
-Legion of Super-Heroes (vol. 4) 87 Near Mint 1 4077 145
-Legion of Super-Heroes (vol. 4) 88 Near Mint 1 4078 145
-Legion of Super-Heroes (vol. 4) (Annual) 7 Near Mint 1 4079 256
-Mister Miracle (vol. 3) 1 Near Mint 1 4080 495
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/publisher.tab b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/publisher.tab
deleted file mode 100644
index ee43b00..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/publisher.tab
+++ /dev/null
@@ -1,41 +0,0 @@
-Valiant 5003
-Innovation 5004
-DC/Marvel 5005
-Abstract Studio 5006
-DC/Dark Horse 5007
-Hero Comics 5008
-Marvel 5009
-Monster Comics 5010
-Eclipse 5011
-Genisis West 5012
-Kitchen Sink 5013
-Vertigo/DC 5014
-Piranha Press/DC 5015
-Tundra 5016
-Image 5017
-Comico 5018
-Viz 5019
-Pacific Press 5020
-Homage 5021
-Comely Comics 5022
-Blackball Comics 5023
-Topps Comics 5024
-Epic/Marvel 5025
-Tekno Comix 5026
-Mad Love 5027
-DC 5028
-Russ Cochran 5029
-Aardvark Vanaheim 5030
-Calliope Comics 5031
-Palliard Press 5032
-Dark Horse 5033
-Unknown 5034
-Andromeda Publications 5035
-Gold Key 5036
-JC Productions (Archie) 5037
-Eternity 5038
-Exhibit A Press 5039
-Milestone 5040
-Double Diamond Press 5041
-Defiant 5042
-First 5043
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/title.tab b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/title.tab
deleted file mode 100644
index 204a56d..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/comics/title.tab
+++ /dev/null
@@ -1,505 +0,0 @@
-Cerebus Aardvark Vanaheim ongoing TRUE 123 5030
-Cerebus Bi-weekly Aardvark Vanaheim ongoing 124 5030
-Cerebus High Society Aardvark Vanaheim ongoing 126 5030
-Cerebus Jam Aardvark Vanaheim one-shot 291 5030
-Cerebus World Tour Book 1995 Aardvark Vanaheim one-shot 450 5030
-Cerebus, Free Aardvark Vanaheim one-shot 125 5030
-Normal Man Aardvark Vanaheim ongoing 369 5030
-Spectacular Spider-Man, The Aardvark Vanaheim ongoing 105 5030
-Strangers In Paradise Abstract Studio ongoing 453 5006
-Andromeda Andromeda Publications ongoing 179 5035
-Blackball Comics Blackball Comics ongoing 247 5023
-Musings Calliope Comics ongoing 106 5031
-Captain Canuck Comely Comics ongoing 196 5022
-Captain Canuck Summer Special Comely Comics one-shot 197 5022
-Elementals Comico ongoing 220 5018
-Elementals Special Comico one-shot 219 5018
-E-Man (vol 3.) Comico ongoing 140 5018
-E-Man (vol. 4) Comico 3 issue mini-series 222 5018
-Grendel Comico ongoing 468 5018
-Danger Unlimited Dark Horse 4 issue mini-series 250 5033
-Dark Horse Presents Dark Horse ongoing 306 5033
-Doc Stern...Mister Monster Dark Horse ongoing 352 5033
-Doc Stern...Mr. Monster Dark Horse ongoing 286 5033
-Ghost and Hellboy Dark Horse 2 issue mini-series 487 5033
-Give Me Liberty Dark Horse 4 issue mini-series 318 5033
-Hard Boiled Dark Horse 3 issue mini-series 169 5033
-Hellboy: Seeds Of Destruction Dark Horse 4 issue mini-series 254 5033
-Hellboy: The Corpse and the Iron Shoes Dark Horse one-shot 488 5033
-Hellboy: Wake the Devil Dark Horse 5 issue mini-series 489 5033
-Herbie Dark Horse 2 issue mini-series 490 5033
-Madman Comics Dark Horse ongoing 260 5033
-Monkeyman and O'Brien Dark Horse ongoing 496 5033
-Nexus: Alien Justice Dark Horse 3 issue mini-series 263 5033
-Nexus: The Origin Dark Horse one-shot 264 5033
-Sin City: A Dame to Kill For Dark Horse 6 issue mini-series 268 5033
-Tale of One Bad Rat Dark Horse 4 issue mini-series 448 5033
-Torch of Liberty Special Dark Horse one-shot 472 5033
-1st Issue Special DC ongoing 134 5028
-Action Comics DC ongoing TRUE 142 5028
-Action Comics (Annual) DC ongoing 258 5028
-Adam Strange DC 3 issue mini-series 57 5028
-Adventure Comics DC ongoing 170 5028
-Ambush Bug DC 4 issue mini-series 178 5028
-Ambush Bug Nothing Special DC one-shot 284 5028
-Ambush Bug Stocking Stuffer DC one-shot 320 5028
-Ambush Bug, Son of DC 6 issue mini-series 387 5028
-America vs. The Justice Society DC 4 issue mini-series 246 5028
-Angel and the Ape DC 4 issue mini-series 180 5028
-Aquaman DC ongoing 183 5028
-Arion, Lord of Atlantis DC ongoing 182 5028
-Armageddon 2001 DC 2 issue mini-series 47 5028
-Armageddon Inferno DC 4 issue mini-series 46 5028
-Aztek: The Ultimate Man DC ongoing 480 5028
-Batman DC ongoing 187 5028
-Batman and Other DC Classics DC one-shot (giveaway) 188 5028
-Batman Shadow of the Bat DC ongoing 60 5028
-Batman: Legends of the Dark Knight DC ongoing 441 5028
-Batman: The Dark Knight Returns DC 4 issue mini-series 317 5028
-Black Lightning DC ongoing 150 5028
-Black Magic (Reprint) DC ongoing 153 5028
-Black Orchid (mini-series) DC 3 issue mini-series 315 5028
-Blackhawk DC 3 issue mini-series 48 5028
-Blackhawk (vol. 1) DC ongoing 191 5028
-Blackhawk (vol. 2) DC ongoing 192 5028
-Blackhawk (vol. 2) (Annual) DC ongoing 193 5028
-Blasters Special DC one-shot 285 5028
-Blue Devil DC ongoing 141 5028
-Blue Devil (Annual) DC ongoing 194 5028
-Books of Magic (mini-series) DC 4 issue mini-series 434 5028
-Boy Commandos (Reprint) DC 2 issue mini-series 149 5028
-Breathtaker DC 3 issue mini-series 461 5028
-Clash DC 3 issue mini-series 311 5028
-Congorilla DC 4 issue mini-series 248 5028
-Cosmic Boy DC 4 issue mini-series 61 5028
-Crimson Avenger, The DC 4 issue mini-series 205 5028
-Crisis on Infinite Earths DC 12 issue mini-series 74 5028
-Damage DC ongoing 249 5028
-Darkstars DC ongoing 3 5028
-DC Comics Presents DC ongoing 138 5028
-DC Silver Age Classics Adventure Comics DC one-shot 98 5028
-DC Silver Age Classics The Brave And The Bold DC one-shot 99 5028
-DC Special DC ongoing 27 5028
-DC Super-Stars DC ongoing 481 5028
-Deadman (reprints) DC 7 issue mini-series 210 5028
-Demon, The (vol. 1) DC ongoing 135 5028
-Demon, The (vol. 2) DC ongoing 127 5028
-Detective Comics DC ongoing 304 5028
-Doc Savage (1988) DC ongoing 213 5028
-Doom Force DC one-shot 63 5028
-Dynamic Classics DC one-shot 217 5028
-Eclipso DC ongoing 64 5028
-Eclipso Special DC 2 issue mini-series 113 5028
-Eclipso: The Darkness Within DC 2 issue mini-series 218 5028
-Elongated Man, The DC 4 issue mini-series 485 5028
-Final Night DC 4 issue mini-series 486 5028
-Firestorm, The Fury Of DC ongoing 230 5028
-Firestorm, The Fury Of (Annual) DC ongoing 231 5028
-Flash DC ongoing 467 5028
-Forever People DC ongoing 136 5028
-Forever People (mini-series) DC 6 issue mini-series 232 5028
-Gilgamesh DC 4 issue mini-series 156 5028
-Golden Age, The DC 4 issue mini-series 77 5028
-Gotham by Gaslight DC one-shot 66 5028
-Green Arrow DC ongoing 235 5028
-Green Lantern (vol. 1) DC ongoing 67 5028
-Green Lantern (vol. 2) DC ongoing TRUE 49 5028
-Green Lantern, Ganthet's Tale DC one-shot 65 5028
-Green Lantern, Mosaic DC ongoing 68 5028
-Guardians of Metropolis DC 4 issue mini-series 443 5028
-Guy Gardner DC ongoing 69 5028
-Hawkman (vol. 2) DC ongoing 302 5028
-Hawkman Special DC one-shot 237 5028
-Heckler, The DC ongoing 42 5028
-Hellblazer (Annual) DC ongoing 117 5028
-Heroes for Hope DC one-shot 240 5028
-Impulse DC ongoing TRUE 458 5028
-Infinity, Inc. DC ongoing 287 5028
-Invasion DC 3 issue mini-series 70 5028
-Justice Inc. DC ongoing 492 5028
-Justice Inc. (mini-series) DC 2 issue mini-series 316 5028
-Justice League America DC ongoing 12 5028
-Justice League America (Annual) DC ongoing 288 5028
-Justice League Europe DC ongoing 323 5028
-Justice League Europe (Annual) DC ongoing 71 5028
-Justice League Quarterly DC ongoing 289 5028
-Justice League Task Force DC ongoing 24 5028
-Justice League: MIdsummer's Nightmare DC 3 issue mini-series 493 5028
-Justice Leauge Quarterly DC ongoing 28 5028
-Justice Society of America DC ongoing 25 5028
-Justice Society of America (mini-series) DC 8 issue mini-series 43 5028
-Kamandi DC ongoing 72 5028
-Kamandi at Earth's End DC 6 issue mini-series 44 5028
-Kid Eternity (mini-series) DC 3 issue mini-series 45 5028
-Kingdom Come DC 4 issue mini-series 483 5028
-L.E.G.I.O.N. DC ongoing 146 5028
-L.E.G.I.O.N. (Annual) DC ongoing 73 5028
-Legends DC 6 issue mini-series 53 5028
-Legion of Super-Heroes (vol. 2) DC ongoing 115 5028
-Legion of Super-Heroes (vol. 2) (Annual) DC ongoing 116 5028
-Legion of Super-Heroes (vol. 3) DC ongoing 147 5028
-Legion of Super-Heroes (vol. 3) (Annual) DC ongoing 292 5028
-Legion of Super-Heroes (vol. 4) DC ongoing TRUE 145 5028
-Legion of Super-Heroes (vol. 4) (Annual) DC ongoing 256 5028
-Legion of Super-Heroes Special DC one-shot 327 5028
-Legionnaires DC ongoing TRUE 11 5028
-Legionnaires (Annual) DC ongoing 257 5028
-Legionnaires 3 DC 4 issue mini-series 75 5028
-Lex Luthor, The Unauthorized Biography DC one-shot 88 5028
-Lobo DC 4 issue mini-series 128 5028
-Lobo Convention Special DC one-shot 437 5028
-Lobo Infanticide DC 4 issue mini-series 89 5028
-Lobo's Back DC 4 issue mini-series 90 5028
-Man of Steel, The DC 6 issue mini-series 91 5028
-Martian Manhunter (mini-series) DC 4 issue mini-series 331 5028
-Martian Manhunter: American Secrets DC 3 issue mini-series 38 5028
-'Mazing Man Winter Special DC one-shot 344 5028
-Metropolis S.C.U. DC 4 issue mini-series 455 5028
-Mister E DC 4 issue mini-series 350 5028
-Mister Miracle DC ongoing 307 5028
-Mister Miracle (vol. 3) DC ongoing 495 5028
-Mister Miracle Special DC one-shot 351 5028
-Mr. Miracle DC ongoing 83 5028
-Mystery in Space DC ongoing 357 5028
-New Gods DC ongoing 84 5028
-New Gods (Reprints) DC 6 issue mini-series 85 5028
-New Gods (vol. 2) DC ongoing 359 5028
-New Gods (vol. 3) DC ongoing 469 5028
-New Teen Titans, The DC ongoing 363 5028
-New Teen Titans, The (Annual) DC ongoing 364 5028
-New Teen Titans, The (vol. 2) DC ongoing 365 5028
-New Teen Titans, The (vol. 2) (Annual) DC ongoing 366 5028
-Omac DC ongoing 111 5028
-Omac (mini-series) DC 4 issue mini-series 93 5028
-Omegamen, The DC ongoing 371 5028
-Power of Shazam, The DC ongoing TRUE 454 5028
-Power of Shazam, The (Annual) DC ongoing 497 5028
-Power of Shazam, The (Graphic Novel) DC one-shot 462 5028
-Primal Force DC ongoing 436 5028
-R.E.B.E.L.S. '94 DC ongoing 438 5028
-Ragman DC 8 issue mini-series 94 5028
-Ray, The DC 6 issue mini-series 40 5028
-Ray, The (regular series) DC ongoing 265 5028
-Robin (mini-series) (vol. 1) DC 5 issue mini-series 377 5028
-Robin 3000 DC 2 issue mini-series 293 5028
-S.T.A.R. Corps DC 4 issue mini-series 298 5028
-Sandman (Vol. 1) DC ongoing 110 5028
-Secret Origins (vol. 2) DC ongoing 143 5028
-Secrets of the Legion of Super-Heroes DC 3 issue mini-series 36 5028
-Shadow Stikes, The DC ongoing 133 5028
-Shadow, The DC ongoing 96 5028
-Shadow, The (Annual) DC ongoing 131 5028
-Shadow, The (mini-series) DC 4 issue mini-series 95 5028
-Showcase '93 DC ongoing 97 5028
-Showcase '95 DC ongoing TRUE 447 5028
-Sonic Disrupters DC 12 issue mini-series 386 5028
-Sovereign Seven DC ongoing 460 5028
-Spanner's Galaxy DC 6 issue mini-series 393 5028
-Spectre, The (vol. 3) DC ongoing 294 5028
-Stanley and His Monster DC 4 issue mini-series 31 5028
-Starman DC ongoing 299 5028
-Starman (vol. 3) DC ongoing TRUE 440 5028
-Steel DC ongoing 121 5028
-Steel (Annual) DC ongoing 270 5028
-Suicide Squad DC ongoing 132 5028
-Super Powers (vol. 2) DC 6 issue mini-series 162 5028
-Super Powers (vol. 3) DC 295 5028
-Superboy (vol. 2) DC ongoing TRUE 120 5028
-Superboy (vol. 2) (Annual) DC ongoing 271 5028
-Superboy, The New Adventures of DC ongoing 148 5028
-Supergirl DC ongoing 5045 5028
-Supergirl (Annual) DC ongoing 499 5028
-Supergirl and Team Luthor DC one-shot 56 5028
-Superman (vol. 1) DC ongoing 296 5028
-Superman (vol. 1) (Annual) DC ongoing 54 5028
-Superman (vol. 2) DC ongoing TRUE 165 5028
-Superman (vol. 2) (Annual) DC ongoing 166 5028
-Superman Adventures DC ongoing 502 5028
-Superman Special DC one-shot 100 5028
-Superman, The Adventures of DC ongoing TRUE 51 5028
-Superman, The Adventures of (Annual) DC ongoing 122 5028
-Superman, The Man of Steel DC ongoing TRUE 18 5028
-Superman, The Man of Steel (Annual) DC ongoing 55 5028
-Superman/Doomsday: Hunter/Prey DC 3 issue mini-series 259 5028
-Superman/Toyman DC one-shot 473 5028
-Superman: The Legacy of Superman DC one-shot 297 5028
-Superman: The Man of Tomorrow DC ongoing 463 5028
-Superman: The Secret Years DC 4 issue mini-series 404 5028
-Superman: The Wedding Albumn DC one-shot 500 5028
-Superman's Pal Jimmy Olsen DC ongoing 82 5028
-Swamp Thing (Annual) DC ongoing 35 5028
-Swamp Thing (Vol. 2) DC ongoing 107 5028
-Sword of the Atom DC 4 issue mini-series 405 5028
-Sword of the Atom Special DC 3 issue mini-series 406 5028
-Tales of the Green Lantern Corps DC 3 issue mini-series 408 5028
-Tales of the Legion of Super-Heroes DC ongoing 409 5028
-Tales of the Legion of Super-Heroes (An) DC ongoing 479 5028
-Tales of the New Teen Titans DC ongoing 411 5028
-Tales of the New Teen Titans (1982) DC 4 issue mini-series 410 5028
-Teen Titans (one-shot drug issue) DC one-shot 414 5028
-Teen Titans (vol. 2) DC ongoing 501 5028
-Timber Wolf DC 5 issue mini-series 144 5028
-Time Warp DC ongoing 418 5028
-Trinity DC 2 issue mini-series 34 5028
-Underworld Unleashed DC 3 issue mini-series 476 5028
-Underworld Unleashed: Apokolips DC one-shot 477 5028
-Untold Legend of the Batman DC 3 issue mini-series 420 5028
-V for Vendetta DC 12 issue mini-series 421 5028
-Valor DC ongoing 13 5028
-Vigilante: City Lights Prairie Justice DC 4 issue mini-series 474 5028
-Wanderers, The DC ongoing 109 5028
-Warlord DC ongoing 425 5028
-Who's Who in the DC Universe DC ongoing 428 5028
-Who's Who in the Legion of Super Heroes DC 7 issue mini-series 104 5028
-Wonder Woman DC ongoing 475 5028
-World of Krypton DC 4 issue mini-series 50 5028
-World of Metropolis DC 4 issue mini-series 118 5028
-World of Smallville DC 4 issue mini-series 119 5028
-Worlds Collide DC one-shot 279 5028
-Wrath of the Spectre DC ongoing 429 5028
-Xenobrood DC 7 issue mini-series 456 5028
-Young All-Stars, The DC ongoing 433 5028
-Zero Hour: Crisis in Time DC 4 issue mini-series 280 5028
-Superman vs. Aliens DC/Dark Horse 3 issue mini-series 464 5007
-X-Men and the Teen Titans DC/Marvel one-shot 432 5005
-Dark Dominion Defiant ongoing 251 5042
-Warriors of Plasm Defiant ongoing 76 5042
-Hepcats Double Diamond Press ongoing 19 5041
-D.N.Agents Eclipse ongoing 212 5011
-Destroyer Duck Eclipse ongoing 81 5011
-E-Man, The Original Eclipse ongoing 373 5011
-Miracle Man Eclipse ongoing 92 5011
-Miracle Man 3D Eclipse one-shot 164 5011
-Miracle Man: Apocrypha Eclipse 3 issue mini-series 262 5011
-Ms. Tree's Thrilling Detective Adventures Eclipse ongoing 356 5011
-New D.N.Agents Eclipse ongoing 358 5011
-Akira Epic/Marvel ongoing 58 5025
-Alien Legion Epic/Marvel ongoing 171 5025
-Dreadstar Epic/Marvel ongoing 5044 5025
-Dreadstar (Annual) Epic/Marvel ongoing 216 5025
-Rocket Racoon Epic/Marvel 4 issue mini-series 378 5025
-Six from Sirius Epic/Marvel 4 issue mini-series 385 5025
-Starstruck Epic/Marvel ongoing 397 5025
-Steelgrip Starkey Epic/Marvel 6 issue mini-series 402 5025
-Stray Toasters Epic/Marvel 4 issue mini-series 114 5025
-Time Spirits Epic/Marvel ongoing 417 5025
-Video Jack Epic/Marvel ongoing 108 5025
-Mighty Mites, The Eternity ongoing 349 5038
-Wolff Case Files Exhibit A Press one-shot 5049 5039
-Wolff & Byrd Exhibit A Press ongoing TRUE 457 5039
-Wolff & Byrd: Case Files Exhibit A Press one-shot 5050 5039
-Classics Illustrated First ongoing 312 5043
-E-Man (vol. 2) First ongoing 221 5043
-Lone Wolf and Cub First ongoing 313 5043
-Shatter First ongoing 381 5043
-Star Slayer First ongoing 396 5043
-Last of the Viking Heroes Genisis West ongoing 290 5012
-Phantom Force Genisis West ongoing TRUE 155 5012
-Beagle Boys Versus Uncle Scrooge Gold Key ongoing 189 5036
-Captain Thunder and Blue Bolt Hero Comics ongoing 199 5008
-Kurt Busiek's Astro City (vol. 2) Homage ongoing 494 5021
-1963 Image ongoing 39 5017
-Darker Image Image 4 issue mini-series 5 5017
-Doom's IV Image ongoing 253 5017
-Kurt Busiek's Astro City Image ongoing 465 5017
-Maxx, The Image ongoing TRUE 2 5017
-Shaman's Tears Image ongoing 267 5017
-Spawn Image ongoing 30 5017
-Spawn/Batman Image one-shot 269 5017
-Trencher Image ongoing 32 5017
-Wetworks Image ongoing 276 5017
-WildC.A.T.S. Image ongoing 103 5017
-Wildstar Image ongoing 277 5017
-Cyberpunk (Book Two) Innovation ongoing 206 5004
-Seraphim Innovation ongoing 380 5004
-Hall of Fame Featuring the T.H.U.N.D.E.R. Agents JC Productions (Archie) ongoing 238 5037
-Megaton Man Kitchen Sink ongoing 345 5013
-Spirit, The Kitchen Sink ongoing 392 5013
-Spirit: The Origin Years Kitchen Sink ongoing 498 5013
-Big Numbers Mad Love 12 issue mini-series 168 5027
-2001: A Space Odyssey Marvel ongoing 137 5009
-Alpha Flight Marvel ongoing 172 5009
-Amazing Adventures (vol. 2) Marvel ongoing 173 5009
-Amazing Spiderman, Skating on Thin Ice Marvel one-shot (giveaway) 283 5009
-Amazing Spiderman, The Marvel ongoing 175 5009
-Amazing Spiderman, The (Annual) Marvel ongoing 176 5009
-Avengers, The Marvel ongoing 184 5009
-Avengers, The (Annual) Marvel ongoing 185 5009
-Battlestar Galactica Marvel ongoing 186 5009
-Beauty and the Beast Marvel 4 issue mini-series 190 5009
-Black Panther Marvel ongoing 80 5009
-Captain America Marvel ongoing 154 5009
-Captain America (Annual) Marvel ongoing 195 5009
-Captain Marvel Marvel ongoing 198 5009
-Cloak and Dagger Marvel ongoing 202 5009
-Conan The Barbarian Marvel ongoing 203 5009
-Conan The Barbarian (Annual) Marvel ongoing 204 5009
-Curse of the Weird Marvel 4 issue mini-series 157 5009
-Damage Control (vol. 3) Marvel 3 issue mini-series 207 5009
-Daredevil, The Man Without Fear Marvel ongoing 208 5009
-Dazzler Marvel ongoing 209 5009
-Defenders, The Marvel ongoing 211 5009
-Devil Dinosaur Marvel ongoing 308 5009
-Dr. Who Marvel ongoing 214 5009
-Dragon Slayer Marvel 2 issue mini-series 215 5009
-Eternals Marvel ongoing 223 5009
-Eternals (Annual) Marvel ongoing 224 5009
-Eternals (maxi-series) Marvel 12 issue mini-series 225 5009
-Fantastic Four Marvel ongoing 226 5009
-Fantastic Four (Annual) Marvel ongoing 227 5009
-Fantastic Four Roast Marvel one-shot 228 5009
-Fantasy Masterpieces (vol. 2) Marvel ongoing 229 5009
-Francis, Brother of the Universe Marvel one-shot 233 5009
-Ghost Rider Marvel ongoing 234 5009
-Giant Size Man-Thing Marvel ongoing 52 5009
-Hercules Marvel 4 issue mini-series 239 5009
-Howard the Duck Marvel ongoing 241 5009
-Howard the Duck (Annual) Marvel ongoing 242 5009
-Howard the Duck (mini-series) Marvel 3 issue mini-series 243 5009
-Iceman (mini-series) Marvel 4 issue mini-series 321 5009
-Incredible Hulk, The Marvel ongoing 244 5009
-Incredible Hulk, The (Annual) Marvel ongoing 245 5009
-Invaders, The Marvel 4 issue mini-series 255 5009
-Iron FIst Marvel ongoing 322 5009
-Iron Man Marvel ongoing 1 5009
-Kazar the Savage Marvel ongoing 324 5009
-King Conan Marvel ongoing 325 5009
-Kitty Pride and Wolverine Marvel 6 issue mini-series 326 5009
-Machine Man Marvel ongoing 309 5009
-Machine Man (mini-series) Marvel 4 issue mini-series 328 5009
-Magneto Marvel one-shot 152 5009
-Man-Thing Marvel ongoing 329 5009
-Marvel Age Marvel ongoing 332 5009
-Marvel Fanfare Marvel ongoing 333 5009
-Marvel Holiday Special Marvel one-shot 334 5009
-Marvel Premiere Marvel ongoing 335 5009
-Marvel Spotlight (vol. 2) Marvel ongoing 336 5009
-Marvel Super Action Marvel ongoing 337 5009
-Marvel Super Hero Contest of Champions Marvel 2 issue mini-series 338 5009
-Marvel Super Heros Secret Wars Marvel 12 issue mini-series 339 5009
-Marvel Team-Up Marvel ongoing 340 5009
-Marvel Team-Up (Annual) Marvel ongoing 341 5009
-Marvel Two-In-One Marvel ongoing 342 5009
-Marvel Two-In-One (Annual) Marvel ongoing 343 5009
-Marvels Marvel 5 issue mini-series 261 5009
-Master of Kung Fu, The Hands of Shang-Chi Marvel ongoing 330 5009
-Micronauts Marvel ongoing 346 5009
-Micronauts (Annual) Marvel ongoing 347 5009
-Micronauts: The New Voyages Marvel ongoing 348 5009
-Monster Menace Marvel 3 issue mini-series 158 5009
-Moon Knight Marvel ongoing 353 5009
-Moon Knight: Fist of Khonshu Marvel ongoing 354 5009
-New Mutants Marvel ongoing 360 5009
-New Mutants (Annual) Marvel ongoing 361 5009
-New Mutants Special Edition Marvel one-shot 362 5009
-Nick Fury Agent of SHEILD Marvel ongoing 367 5009
-Nightcrawler Marvel 4 issue mini-series 368 5009
-Nova Marvel ongoing 370 5009
-Omega the Unknown Marvel ongoing 372 5009
-Power Man and Iron Fist Marvel ongoing 375 5009
-Power Pack Marvel ongoing 376 5009
-Power Pack Holiday Special Marvel one-shot 129 5009
-Rom Spaceknight Marvel ongoing 379 5009
-She Hulk, The Savage Marvel ongoing 382 5009
-Shogun Warriors Marvel ongoing 383 5009
-Silver Surfer (one-shot) Marvel one-shot 384 5009
-Spectacular Spiderham, Peter Porker the Marvel ongoing 388 5009
-Spectacular Spiderman, The Marvel ongoing 389 5009
-Spectacular Spiderman, The (Annual) Marvel ongoing 390 5009
-Spiderman Marvel ongoing 391 5009
-Spider-Man 2099 Marvel ongoing 9 5009
-Spiderwoman (vol. 1) Marvel ongoing 394 5009
-Star Trek Marvel ongoing 398 5009
-Star Wars Marvel ongoing 399 5009
-Star Wars (Annual) Marvel ongoing 400 5009
-Starlord Special Edition Marvel one-shot 395 5009
-Tales to Astonish (vol. 2) Marvel ongoing 412 5009
-Team America Marvel ongoing 413 5009
-Thor, The Mighty Marvel ongoing 415 5009
-Thor, The Mighty (Annual) Marvel ongoing 416 5009
-Vision and Scarlet Witch (mini-series) Marvel 4 issue mini-series 423 5009
-Warlock Special Edition Marvel ongoing 424 5009
-Web of Spiderman Marvel ongoing 426 5009
-What If? (vol. 1) Marvel ongoing 427 5009
-Wolverine (mini-series) Marvel 4 issue mini-series 310 5009
-X-Factor Marvel ongoing 430 5009
-X-Men and Alpha Flight (mini-series) Marvel 2 issue mini-series 431 5009
-X-Men, The Uncanny Marvel ongoing 86 5009
-X-Men, The Uncanny (Annual) Marvel ongoing 87 5009
-Blood Syndicate Milestone ongoing 21 5040
-Hardware Milestone ongoing 22 5040
-Icon Milestone ongoing TRUE 17 5040
-Shadow Cabinet Milestone ongoing 266 5040
-Static Milestone ongoing TRUE 33 5040
-Dare Monster Comics 4 issue mini-series 62 5010
-Captain Victory Pacific Press ongoing 200 5020
-Captain Victory Special Pacific Press one-shot 201 5020
-Groo the Wanderer Pacific Press ongoing 236 5020
-Ms. Mystic Pacific Press ongoing 355 5020
-Pacific Presents Pacific Press ongoing 374 5020
-Silver Star Pacific Press ongoing 300 5020
-Sun Runners Pacific Press ongoing 403 5020
-Buck Godot, Zap Gun for Hire Palliard Press ongoing 139 5032
-Beautiful Stories for Ugly Children Piranha Press/DC ongoing 161 5015
-Tales from the Crypt Russ Cochran ongoing 407 5029
-Vault of Horror Russ Cochran ongoing 422 5029
-Weird Fantasy (Reprint) Russ Cochran ongoing 102 5029
-Weird Science Fantasy (Reprint) Russ Cochran ongoing 101 5029
-Neil Gaiman's Mr. Hero Tekno Comix ongoing 445 5026
-Bombast Topps Comics one-shot 14 5024
-Captain Glory Topps Comics one-shot 7 5024
-Lone Ranger and Tonto, The Topps Comics 4 issue mini-series 305 5024
-Night Glider Topps Comics one-shot 8 5024
-Satan's Six Topps Comics 4 issue mini-series 281 5024
-Secret City Saga Topps Comics one-shot 4 5024
-Teen Agents, Jack Kirby's Topps Comics 4 issue mini-series 272 5024
-Victory Topps Comics 5 issue mini-series 274 5024
-Cages Tundra 10 issue mini-series 167 5016
-Amazing Comics Premieres Unknown ongoing 174 5034
-Arctic Comics Unknown one-shot 181 5034
-Star Wars 3D Unknown ongoing 401 5034
-Transformers in 3D Unknown ongoing 419 5034
-Bloodshot Valiant ongoing 151 5003
-Punx Valiant ongoing 470 5003
-Punx (Manga) Special Valiant one-shot 471 5003
-Absolute Vertigo Vertigo/DC one-shot 451 5014
-Animal Man Vertigo/DC ongoing 59 5014
-Black Orchid Vertigo/DC ongoing 78 5014
-Black Orchid (Annual) Vertigo/DC ongoing 159 5014
-Books of Magic (regular series) Vertigo/DC ongoing 435 5014
-Children's Crusade, The Vertigo/DC 2 issue mini-series 163 5014
-Death, The High Cost of Living Vertigo/DC 3 issue mini-series 23 5014
-Death: The Time of Your Life Vertigo/DC 3 issue mini-series 482 5014
-Doom Patrol Vertigo/DC ongoing 252 5014
-Dreaming, The Vertigo/DC ongoing 484 5014
-Enigma Vertigo/DC 8 issue mini-series 26 5014
-Geek, The Vertigo/DC one-shot 282 5014
-Hellblazer Vertigo/DC ongoing TRUE 15 5014
-Hellblazer Special Vertigo/DC one-shot 301 5014
-House of Secrets (vol. 2) Vertigo/DC ongoing 491 5014
-Invisibles Vertigo/DC ongoing 303 5014
-Jonah Hex, Two Gun Mojo Vertigo/DC 5 issue mini-series 79 5014
-Jonah Hex: Riders of the Worm and Such Vertigo/DC 5 issue mini-series TRUE 452 5014
-Kid Eternity Vertigo/DC ongoing 16 5014
-Last One, The Vertigo/DC 6 issue mini-series 41 5014
-Moonshadow Vertigo/DC 12 issue mini-series TRUE 444 5014
-Preacher Vertigo/DC ongoing TRUE 459 5014
-Sandman Vertigo/DC ongoing TRUE 10 5014
-Sandman Midnight Theatre Vertigo/DC one-shot 478 5014
-Sandman Mystery Theatre Vertigo/DC ongoing TRUE 20 5014
-Sandman Mystery Theatre (Annual) Vertigo/DC ongoing 449 5014
-Sandman Special Vertigo/DC one-shot 130 5014
-Sandman: Gallery of Dreams Vertigo/DC one-shot 439 5014
-Scarab Vertigo/DC 8 issue mini-series 160 5014
-Sebastian O Vertigo/DC 4 issue mini-series 37 5014
-Shade, The Changing Man Vertigo/DC ongoing TRUE 446 5014
-Vamps Vertigo/DC 6 issue mini-series 273 5014
-Vertigo Jam Vertigo/DC one-shot 112 5014
-Vertigo Preview Vertigo/DC one-shot 29 5014
-Vertigo Rave Vertigo/DC one-shot 442 5014
-Vertigo Visions: Dr. Occult Vertigo/DC one-shot 275 5014
-Vertigo Visions: The Geek Vertigo/DC one-shot 6 5014
-Vertigo Voices: The Eaters Vertigo/DC one-shot 466 5014
-Witchcraft Vertigo/DC 3 issue mini-series 278 5014
-Horobi Viz ongoing 314 5019
-Nausicaa of the Vally of Wind (vol. 2) Viz ongoing 319 5019
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/AllTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/AllTests.java
deleted file mode 100644
index 392ac2c..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/AllTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.orm.projectxml;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for direct usage of EclipseLink native deployment XML with dynamic
- * persistence
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { InvalidConfig.class, SimpleMapProject.class, SimpleMapProjectNoLogin.class, EmployeeProject.class })
-public class AllTests {
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/EmployeeProject.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/EmployeeProject.java
deleted file mode 100644
index b86a0a2..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/EmployeeProject.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * mnorman - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.orm.projectxml;
-
-import static junit.framework.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Calendar;
-import java.util.List;
-
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.DatabaseLogin;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Project;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.UnitOfWork;
-import org.eclipse.persistence.testing.tests.dynamic.DynamicTestHelper;
-import org.eclipse.persistence.testing.tests.dynamic.EclipseLinkORMTest;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-/*
- * Test cases verifying the use of the simple-map-project.xml
- */
-public class EmployeeProject extends EclipseLinkORMTest {
-
- @Override
- protected DatabaseSession createSharedSession() {
- DatabaseLogin login = DynamicTestHelper.getTestLogin();
- Project project = null;
- try {
- project = DynamicTypeBuilder.loadDynamicProject("org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/employee-project.xml", login, new DynamicClassLoader(EmployeeProject.class.getClassLoader()));
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- DatabaseSession ds = project.createDatabaseSession();
- ds.login();
- new SchemaManager(ds).replaceDefaultTables();
-
- return ds;
- }
-
- @Test
- public void createNewInstance() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicType employeeType = helper.getType("Employee");
- DynamicType periodType = helper.getType("EmploymentPeriod");
-
- DynamicEntity entity = employeeType.newDynamicEntity();
- // entity.set("id", 1);
- entity.set("firstName", "First");
- entity.set("lastName", "Last");
- entity.set("salary", 12345);
-
- DynamicEntity period = periodType.newDynamicEntity();
- period.set("startDate", Calendar.getInstance());
-
- entity.set("period", period);
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(entity);
- uow.commit();
-
- ReportQuery countQuery = helper.newReportQuery("Employee", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- assertEquals(1, ((Number) session.executeQuery(countQuery)).intValue());
-
- session.release();
- }
-
- @Test
- public void readAll() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- createNewInstance();
- DynamicType type = helper.getType("Employee");
-
- List<DynamicEntity> allObjects = session.readAllObjects(type.getJavaClass());
- assertEquals(1, allObjects.size());
- }
-
- @After
- public void clearDatabase() {
- getSharedSession().executeNonSelectingSQL("DELETE FROM DX_ADDRESS");
- getSharedSession().executeNonSelectingSQL("DELETE FROM DX_SALARY");
- getSharedSession().executeNonSelectingSQL("DELETE FROM DX_EMPLOYEE");
- }
-
- @AfterClass
- public static void dropTables() {
- sharedSession.executeNonSelectingSQL("DROP TABLE DX_EMPLOYEE CASCADE CONSTRAINTS");
- sharedSession.executeNonSelectingSQL("DROP TABLE DX_SALARY CASCADE CONSTRAINTS");
- sharedSession.executeNonSelectingSQL("DROP TABLE DX_ADDRESS CASCADE CONSTRAINTS");
- }
-
-}
\ No newline at end of file
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/Employee_utf8.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/Employee_utf8.xml
deleted file mode 100644
index db4ba70..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/Employee_utf8.xml
+++ /dev/null
@@ -1,500 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<object-persistence version="1.1.2"
- 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>Employee</name>
- <class-mapping-descriptors>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>model.dynamic.employee.Address</class>
- <alias>Address</alias>
- <primary-key>
- <field table="DX_ADDRESS" name="ADDRESS_ID" xsi:type="column" />
- </primary-key>
- <events xsi:type="event-policy" />
- <querying xsi:type="query-policy" />
- <attribute-mappings>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>city</attribute-name>
- <field table="DX_ADDRESS" name="CITY" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>country</attribute-name>
- <field table="DX_ADDRESS" name="COUNTRY" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>id</attribute-name>
- <field table="DX_ADDRESS" name="ADDRESS_ID" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>postalCode</attribute-name>
- <field table="DX_ADDRESS" name="P_CODE" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>province</attribute-name>
- <field table="DX_ADDRESS" name="PROVINCE" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>street</attribute-name>
- <field table="DX_ADDRESS" name="STREET" xsi:type="column" />
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>independent</descriptor-type>
- <sequencing>
- <sequence-name>DX_ADDRESS_SEQ</sequence-name>
- <sequence-field table="DX_ADDRESS" name="ADDRESS_ID"
- xsi:type="column" />
- </sequencing>
- <instantiation />
- <copying xsi:type="instantiation-copy-policy" />
- <tables>
- <table name="DX_ADDRESS" />
- </tables>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>model.dynamic.employee.Employee</class>
- <alias>Employee</alias>
- <primary-key>
- <field table="DX_EMPLOYEE" name="EMP_ID" xsi:type="column" />
- </primary-key>
- <events xsi:type="event-policy" />
- <querying xsi:type="query-policy" />
- <attribute-mappings>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>firstName</attribute-name>
- <field table="DX_EMPLOYEE" name="F_NAME" xsi:type="column" />
- <null-value xsi:type="xsd:string"></null-value>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>id</attribute-name>
- <field table="DX_EMPLOYEE" name="EMP_ID" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>lastName</attribute-name>
- <field table="DX_EMPLOYEE" name="L_NAME" xsi:type="column" />
- <null-value xsi:type="xsd:string"></null-value>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>salary</attribute-name>
- <field table="DX_SALARY" name="SALARY" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>gender</attribute-name>
- <field table="DX_EMPLOYEE" name="GENDER" xsi:type="column" />
- <converter xsi:type="object-type-converter">
- <type-mappings>
- <type-mapping>
- <object-value xsi:type="xsd:string">Male</object-value>
- <data-value xsi:type="xsd:string">M</data-value>
- </type-mapping>
- <type-mapping>
- <object-value xsi:type="xsd:string">Female</object-value>
- <data-value xsi:type="xsd:string">F</data-value>
- </type-mapping>
- </type-mappings>
- </converter>
- </attribute-mapping>
- <attribute-mapping xsi:type="aggregate-object-mapping">
- <attribute-name>period</attribute-name>
- <reference-class>model.dynamic.employee.EmploymentPeriod</reference-class>
- <field-translations>
- <field-translation>
- <source-field name="startDate->DIRECT" xsi:type="column" />
- <target-field table="DX_EMPLOYEE" name="START_DATE"
- xsi:type="column" />
- </field-translation>
- <field-translation>
- <source-field name="endDate->DIRECT" xsi:type="column" />
- <target-field table="DX_EMPLOYEE" name="END_DATE"
- xsi:type="column" />
- </field-translation>
- </field-translations>
- </attribute-mapping>
-<!-- DirectCollection from XML does not work
- <attribute-mapping xsi:type="direct-collection-mapping">
- <attribute-name>responsibilitiesList</attribute-name>
- <container xsi:type="list-container-policy">
- <collection-type>java.util.Vector</collection-type>
- </container>
- <indirection xsi:type="value-holder-indirection-policy" />
- <selection-query xsi:type="direct-read-query">
- <maintain-cache>false</maintain-cache>
- <container xsi:type="list-container-policy">
- <collection-type>java.util.Vector</collection-type>
- </container>
- </selection-query>
- <reference-table>DX_RESPONS</reference-table>
- <direct-field table="DX_RESPONS" name="DESCRIP" xsi:type="column" />
- <reference-foreign-key>
- <field-reference>
- <source-field table="DX_RESPONS" name="EMP_ID"
- xsi:type="column" />
- <target-field table="DX_EMPLOYEE" name="EMP_ID"
- xsi:type="column" />
- </field-reference>
- </reference-foreign-key>
- </attribute-mapping>
--->
- <attribute-mapping xsi:type="one-to-one-mapping">
- <attribute-name>address</attribute-name>
- <reference-class>model.dynamic.employee.Address</reference-class>
- <private-owned>true</private-owned>
- <foreign-key>
- <field-reference>
- <source-field table="DX_EMPLOYEE" name="ADDR_ID"
- xsi:type="column" />
- <target-field table="DX_ADDRESS" name="ADDRESS_ID"
- xsi:type="column" />
- </field-reference>
- </foreign-key>
- <foreign-key-fields>
- <field table="DX_EMPLOYEE" name="ADDR_ID" xsi:type="column" />
- </foreign-key-fields>
- <indirection xsi:type="value-holder-indirection-policy" />
- <selection-query xsi:type="read-object-query">
- <reference-class>model.dynamic.employee.Address</reference-class>
- </selection-query>
- </attribute-mapping>
- <attribute-mapping xsi:type="one-to-one-mapping">
- <attribute-name>manager</attribute-name>
- <reference-class>model.dynamic.employee.Employee</reference-class>
- <foreign-key>
- <field-reference>
- <source-field table="DX_EMPLOYEE" name="MANAGER_ID"
- xsi:type="column" />
- <target-field table="DX_EMPLOYEE" name="EMP_ID"
- xsi:type="column" />
- </field-reference>
- </foreign-key>
- <foreign-key-fields>
- <field table="DX_EMPLOYEE" name="MANAGER_ID" xsi:type="column" />
- </foreign-key-fields>
- <indirection xsi:type="value-holder-indirection-policy" />
- <selection-query xsi:type="read-object-query">
- <reference-class>model.dynamic.employee.Employee</reference-class>
- </selection-query>
- </attribute-mapping>
- <attribute-mapping xsi:type="one-to-many-mapping">
- <attribute-name>managedEmployees</attribute-name>
- <reference-class>model.dynamic.employee.Employee</reference-class>
- <target-foreign-key>
- <field-reference>
- <source-field table="DX_EMPLOYEE" name="MANAGER_ID"
- xsi:type="column" />
- <target-field table="DX_EMPLOYEE" name="EMP_ID"
- xsi:type="column" />
- </field-reference>
- </target-foreign-key>
- <container xsi:type="list-container-policy">
- <collection-type>java.util.Vector</collection-type>
- </container>
- <indirection xsi:type="value-holder-indirection-policy" />
- <selection-query xsi:type="read-all-query">
- <reference-class>model.dynamic.employee.Employee</reference-class>
- <container xsi:type="list-container-policy">
- <collection-type>java.util.Vector</collection-type>
- </container>
- </selection-query>
- </attribute-mapping>
- <attribute-mapping xsi:type="one-to-many-mapping">
- <attribute-name>phoneNumbers</attribute-name>
- <reference-class>model.dynamic.employee.PhoneNumber</reference-class>
- <private-owned>true</private-owned>
- <target-foreign-key>
- <field-reference>
- <source-field table="DX_PHONE" name="EMP_ID" xsi:type="column" />
- <target-field table="DX_EMPLOYEE" name="EMP_ID"
- xsi:type="column" />
- </field-reference>
- </target-foreign-key>
- <container xsi:type="list-container-policy">
- <collection-type>java.util.Vector</collection-type>
- </container>
- <indirection xsi:type="value-holder-indirection-policy" />
- <selection-query xsi:type="read-all-query">
- <reference-class>model.dynamic.employee.PhoneNumber</reference-class>
- <container xsi:type="list-container-policy">
- <collection-type>java.util.Vector</collection-type>
- </container>
- </selection-query>
- </attribute-mapping>
- <attribute-mapping xsi:type="many-to-many-mapping">
- <attribute-name>projects</attribute-name>
- <reference-class>model.dynamic.employee.Project</reference-class>
- <relation-table>DX_PROJ_EMP</relation-table>
- <source-relation-foreign-key>
- <field-reference>
- <source-field table="DX_PROJ_EMP" name="EMP_ID"
- xsi:type="column" />
- <target-field table="DX_EMPLOYEE" name="EMP_ID"
- xsi:type="column" />
- </field-reference>
- </source-relation-foreign-key>
- <target-relation-foreign-key>
- <field-reference>
- <source-field table="DX_PROJ_EMP" name="PROJ_ID"
- xsi:type="column" />
- <target-field table="DX_PROJECT" name="PROJ_ID"
- xsi:type="column" />
- </field-reference>
- </target-relation-foreign-key>
- <container xsi:type="list-container-policy">
- <collection-type>java.util.Vector</collection-type>
- </container>
- <indirection xsi:type="value-holder-indirection-policy" />
- <selection-query xsi:type="read-all-query">
- <reference-class>model.dynamic.employee.Project</reference-class>
- <container xsi:type="list-container-policy">
- <collection-type>java.util.Vector</collection-type>
- </container>
- </selection-query>
- <insert-query xsi:type="data-modify-query" />
- <delete-query xsi:type="data-modify-query" />
- <delete-all-query xsi:type="data-modify-query" />
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>independent</descriptor-type>
- <interfaces>
- </interfaces>
- <locking xsi:type="version-locking-policy">
- <version-field table="DX_EMPLOYEE" name="VERSION"
- xsi:type="column" />
- </locking>
- <sequencing>
- <sequence-name>DX_EMP_SEQ</sequence-name>
- <sequence-field table="DX_EMPLOYEE" name="EMP_ID"
- xsi:type="column" />
- </sequencing>
- <instantiation />
- <copying xsi:type="instantiation-copy-policy" />
- <tables>
- <table name="DX_EMPLOYEE" />
- <table name="DX_SALARY" />
- </tables>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>model.dynamic.employee.EmploymentPeriod</class>
- <alias>EmploymentPeriod</alias>
- <events xsi:type="event-policy" />
- <querying xsi:type="query-policy" />
- <attribute-mappings>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>endDate</attribute-name>
- <field name="endDate->DIRECT" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>startDate</attribute-name>
- <field name="startDate->DIRECT" xsi:type="column" />
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>aggregate</descriptor-type>
- <instantiation />
- <copying xsi:type="instantiation-copy-policy" />
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>model.dynamic.employee.LargeProject</class>
- <alias>LargeProject</alias>
- <inheritance xsi:type="inheritance-policy">
- <parent-class>model.dynamic.employee.Project</parent-class>
- <read-subclasses-on-queries>false</read-subclasses-on-queries>
- </inheritance>
- <events xsi:type="event-policy" />
- <querying xsi:type="query-policy" />
- <attribute-mappings>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>budget</attribute-name>
- <field table="DX_LPROJECT" name="BUDGET" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>milestoneVersion</attribute-name>
- <field table="DX_LPROJECT" name="MILESTONE" xsi:type="column" />
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>independent</descriptor-type>
- <interfaces>
- </interfaces>
- <instantiation />
- <copying xsi:type="instantiation-copy-policy" />
- <tables>
- <table name="DX_LPROJECT" />
- </tables>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>model.dynamic.employee.PhoneNumber</class>
- <alias>PhoneNumber</alias>
- <primary-key>
- <field table="DX_PHONE" name="EMP_ID" xsi:type="column" />
- <field table="DX_PHONE" name="TYPE" xsi:type="column" />
- </primary-key>
- <events xsi:type="event-policy" />
- <querying xsi:type="query-policy">
- <queries>
- <query name="localNumbers" xsi:type="read-object-query">
- <criteria operator="and" xsi:type="logic-expression">
- <left operator="equal" xsi:type="relation-expression">
- <left name="id" xsi:type="query-key-expression">
- <base xsi:type="base-expression" />
- </left>
- <right xsi:type="parameter-expression">
- <parameter name="ID" xsi:type="column" />
- </right>
- </left>
- <right operator="equal" xsi:type="relation-expression">
- <left name="areaCode" xsi:type="query-key-expression">
- <base xsi:type="base-expression" />
- </left>
- <right xsi:type="constant-expression">
- <value xsi:type="xsd:string">613</value>
- </right>
- </right>
- </criteria>
- <arguments>
- <argument name="ID">
- <type>java.lang.Number</type>
- </argument>
- </arguments>
- <reference-class>model.dynamic.employee.PhoneNumber</reference-class>
- <cache-usage>primary-key</cache-usage>
- <lock-mode>none</lock-mode>
- </query>
- </queries>
- </querying>
- <attribute-mappings>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>areaCode</attribute-name>
- <field table="DX_PHONE" name="AREA_CODE" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>number</attribute-name>
- <field table="DX_PHONE" name="P_NUMBER" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>type</attribute-name>
- <field table="DX_PHONE" name="TYPE" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="one-to-one-mapping">
- <attribute-name>owner</attribute-name>
- <reference-class>model.dynamic.employee.Employee</reference-class>
- <foreign-key>
- <field-reference>
- <source-field table="DX_PHONE" name="EMP_ID" xsi:type="column" />
- <target-field table="DX_EMPLOYEE" name="EMP_ID"
- xsi:type="column" />
- </field-reference>
- </foreign-key>
- <foreign-key-fields>
- <field table="DX_PHONE" name="EMP_ID" xsi:type="column" />
- </foreign-key-fields>
- <indirection xsi:type="value-holder-indirection-policy" />
- <selection-query xsi:type="read-object-query">
- <reference-class>model.dynamic.employee.Employee</reference-class>
- </selection-query>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>independent</descriptor-type>
- <instantiation />
- <copying xsi:type="instantiation-copy-policy" />
- <query-keys>
- <query-key name="id" xsi:type="direct-query-key">
- <field table="DX_PHONE" name="EMP_ID" xsi:type="column" />
- </query-key>
- </query-keys>
- <tables>
- <table name="DX_PHONE" />
- </tables>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>model.dynamic.employee.Project</class>
- <alias>Project</alias>
- <primary-key>
- <field table="DX_PROJECT" name="PROJ_ID" xsi:type="column" />
- </primary-key>
- <inheritance xsi:type="inheritance-policy">
- <class-indicator-field table="DX_PROJECT" name="PROJ_TYPE"
- xsi:type="column" />
- <class-indicator-mappings>
- <class-indicator-mapping>
- <class>model.dynamic.employee.SmallProject</class>
- <class-indicator xsi:type="xsd:string">S</class-indicator>
- </class-indicator-mapping>
- <class-indicator-mapping>
- <class>model.dynamic.employee.LargeProject</class>
- <class-indicator xsi:type="xsd:string">L</class-indicator>
- </class-indicator-mapping>
- </class-indicator-mappings>
- </inheritance>
- <events xsi:type="event-policy" />
- <querying xsi:type="query-policy" />
- <attribute-mappings>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>description</attribute-name>
- <field table="DX_PROJECT" name="DESCRIP" xsi:type="column" />
- <null-value xsi:type="xsd:string"></null-value>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>id</attribute-name>
- <field table="DX_PROJECT" name="PROJ_ID" xsi:type="column" />
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>name</attribute-name>
- <field table="DX_PROJECT" name="PROJ_NAME" xsi:type="column" />
- <null-value xsi:type="xsd:string"></null-value>
- </attribute-mapping>
- <attribute-mapping xsi:type="one-to-one-mapping">
- <attribute-name>teamLeader</attribute-name>
- <reference-class>model.dynamic.employee.Employee</reference-class>
- <foreign-key>
- <field-reference>
- <source-field table="DX_PROJECT" name="LEADER_ID"
- xsi:type="column" />
- <target-field table="DX_EMPLOYEE" name="EMP_ID"
- xsi:type="column" />
- </field-reference>
- </foreign-key>
- <foreign-key-fields>
- <field table="DX_PROJECT" name="LEADER_ID" xsi:type="column" />
- </foreign-key-fields>
- <indirection xsi:type="value-holder-indirection-policy" />
- <selection-query xsi:type="read-object-query">
- <reference-class>model.dynamic.employee.Employee</reference-class>
- </selection-query>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>independent</descriptor-type>
- <interfaces>
- </interfaces>
- <locking xsi:type="version-locking-policy">
- <version-field table="DX_PROJECT" name="VERSION"
- xsi:type="column" />
- </locking>
- <sequencing>
- <sequence-name>DX_PROJ_SEQ</sequence-name>
- <sequence-field table="DX_PROJECT" name="PROJ_ID"
- xsi:type="column" />
- </sequencing>
- <instantiation />
- <copying xsi:type="instantiation-copy-policy" />
- <tables>
- <table name="DX_PROJECT" />
- </tables>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>model.dynamic.employee.SmallProject</class>
- <alias>SmallProject</alias>
- <inheritance xsi:type="inheritance-policy">
- <parent-class>model.dynamic.employee.Project</parent-class>
- <read-subclasses-on-queries>false</read-subclasses-on-queries>
- </inheritance>
- <events xsi:type="event-policy" />
- <querying xsi:type="query-policy" />
- <descriptor-type>independent</descriptor-type>
- <interfaces>
- </interfaces>
- <instantiation />
- <copying xsi:type="instantiation-copy-policy" />
- <tables>
- <table name="DX_PROJECT" />
- </tables>
- </class-mapping-descriptor>
- </class-mapping-descriptors>
-</object-persistence>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/InvalidConfig.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/InvalidConfig.java
deleted file mode 100644
index ff06c4a..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/InvalidConfig.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.orm.projectxml;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.exceptions.XMLMarshalException;
-import org.eclipse.persistence.sessions.DatabaseLogin;
-import org.junit.Test;
-
-/**
- * Test cases verifying invalid args passed to
- * {@link DynamicTypeBuilder#loadDynamicProject(String, DatabaseLogin)}
- */
-public class InvalidConfig {
-
- @Test(expected=NullPointerException.class)
- public void nullResource() throws Exception {
- DynamicTypeBuilder.loadDynamicProject((String)null, null, null);
- }
-
- @Test(expected=NullPointerException.class)
- public void nullClassLoader() throws Exception {
- File temp = File.createTempFile("foo",".txt");
- temp.deleteOnExit();
- FileInputStream fis = new FileInputStream(temp);
- DynamicTypeBuilder.loadDynamicProject(fis, new DatabaseLogin(), null);
- }
-
- @Test(expected=XMLMarshalException.class)
- public void invalidResource() throws Exception {
- DynamicClassLoader dynamicClassLoader = new DynamicClassLoader(
- InvalidConfig.class.getClassLoader());
- InputStream is = dynamicClassLoader.getResourceAsStream(
- "org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/bar.xml");
- DynamicTypeBuilder.loadDynamicProject(is, new DatabaseLogin(),
- dynamicClassLoader);
- }
-}
\ No newline at end of file
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/SimpleMapProject.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/SimpleMapProject.java
deleted file mode 100644
index c3a7aa3..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/SimpleMapProject.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * mnorman - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.orm.projectxml;
-
-import static junit.framework.Assert.*;
-
-import java.io.IOException;
-import java.math.BigInteger;
-import java.sql.Date;
-import java.util.List;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.*;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.*;
-import org.eclipse.persistence.testing.tests.dynamic.DynamicTestHelper;
-import org.eclipse.persistence.testing.tests.dynamic.EclipseLinkORMTest;
-import org.eclipse.persistence.tools.schemaframework.DynamicSchemaManager;
-import org.junit.*;
-
-/*
- * Test cases verifying the use of the simple-map-project.xml
- */
-public class SimpleMapProject extends EclipseLinkORMTest {
-
- protected String getProjectLocation() {
- return "org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/simple-map-project.xml";
- }
-
- @Override
- protected DatabaseSession createSharedSession() {
- DatabaseLogin login = DynamicTestHelper.getTestLogin();
- DynamicClassLoader dcl = new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
- Project project = null;
- try {
- project = DynamicTypeBuilder.loadDynamicProject(getProjectLocation(), login, dcl);
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- DatabaseSession ds = project.createDatabaseSession();
- ds.setLogLevel(SessionLog.FINE);
- ds.login();
-
- new DynamicSchemaManager(ds).createTables(new DynamicType[0]);
-
- return ds;
- }
-
- @Test
- public void verifyDescriptor() throws Exception {
- ClassDescriptor descriptor = getSharedSession().getClassDescriptorForAlias("simpletableType");
-
- assertNotNull(descriptor);
- assertEquals("simpletable.Simpletable", descriptor.getJavaClassName());
-
- assertEquals(3, descriptor.getMappings().size());
-
- DatabaseMapping idMapping = descriptor.getMappingForAttributeName("id");
- assertNotNull(idMapping);
- assertTrue(idMapping.isDirectToFieldMapping());
- assertEquals(BigInteger.class, idMapping.getAttributeClassification());
-
- DatabaseMapping nameMapping = descriptor.getMappingForAttributeName("name");
- assertNotNull(nameMapping);
- assertTrue(nameMapping.isDirectToFieldMapping());
- assertEquals(String.class, nameMapping.getAttributeClassification());
-
- DatabaseMapping sinceMapping = descriptor.getMappingForAttributeName("since");
- assertNotNull(sinceMapping);
- assertTrue(sinceMapping.isDirectToFieldMapping());
- assertEquals(Date.class, sinceMapping.getAttributeClassification());
- }
-
- @SuppressWarnings("deprecation")
- @Test
- public void createInstance() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicType type = helper.getType("simpletableType");
-
- ReportQuery countQuery = helper.newReportQuery("simpletableType", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- assertEquals(0, ((Number) session.executeQuery(countQuery)).intValue());
-
- DynamicEntity entity = type.newDynamicEntity();
- entity.set("id", new BigInteger("1"));
- entity.set("name", "Example");
- entity.set("since", new Date(100, 06, 06));
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(entity);
- uow.commit();
-
- assertEquals(1, ((Number) session.executeQuery(countQuery)).intValue());
- session.release();
- }
-
- @Test
- public void readAll() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- createInstance();
- DynamicType type = helper.getType("simpletableType");
-
- List<DynamicEntity> allObjects = session.readAllObjects(type.getJavaClass());
- assertEquals(1, allObjects.size());
- }
-
- @Test
- public void readById() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- createInstance();
-
- ReadObjectQuery query = helper.newReadObjectQuery( "simpletableType");
- query.setSelectionCriteria(query.getExpressionBuilder().get("id").equal(1));
-
- DynamicEntity entity = (DynamicEntity) session.executeQuery(query);
-
- assertNotNull(entity);
- }
-
- @Test
- public void delete() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- createInstance();
-
- ReadObjectQuery query = helper.newReadObjectQuery( "simpletableType");
- query.setSelectionCriteria(query.getExpressionBuilder().get("id").equal(1));
-
- UnitOfWork uow = session.acquireUnitOfWork();
-
- DynamicEntity entity = (DynamicEntity) uow.executeQuery(query);
- assertNotNull(entity);
-
- uow.deleteObject(entity);
- uow.commit();
-
- ReportQuery countQuery = helper.newReportQuery("simpletableType", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- assertEquals(0, ((Number) session.executeQuery(countQuery)).intValue());
- }
-
- @After
- public void clearTable() {
- getSharedSession().executeNonSelectingSQL("DELETE FROM SIMPLETABLE");
- }
-
- @AfterClass
- public static void removeTables() {
- sharedSession.executeNonSelectingSQL("DROP TABLE SIMPLETABLE CASCADE CONSTRAINTS");
- }
-
-}
\ No newline at end of file
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/SimpleMapProjectNoLogin.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/SimpleMapProjectNoLogin.java
deleted file mode 100644
index 677ecef..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/SimpleMapProjectNoLogin.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * mnorman - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.orm.projectxml;
-
-
-/*
- * Test cases verifying the use of the simple-map-project.xml
- */
-public class SimpleMapProjectNoLogin extends SimpleMapProject {
-
- @Override
- protected String getProjectLocation() {
- return "org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/simple-map-project-no-login.xml";
- }
-
-}
\ No newline at end of file
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/bar.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/bar.xml
deleted file mode 100644
index 0a2f82d..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/bar.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<this>is not an EclipseLink project</this>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/employee-project.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/employee-project.xml
deleted file mode 100644
index 199dfc8..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/employee-project.xml
+++ /dev/null
@@ -1,144 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<object-persistence version="Eclipse Persistence Services - 1.1.2.v20090612-r4475" 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>employee</name>
- <class-mapping-descriptors>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>model.dynamic.employee.Address</class>
- <alias>Address</alias>
- <primary-key>
- <field table="DX_ADDRESS" name="ADDR_ID" xsi:type="column"/>
- </primary-key>
- <events xsi:type="event-policy"/>
- <querying xsi:type="query-policy"/>
- <attribute-mappings>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>city</attribute-name>
- <field table="DX_ADDRESS" name="CITY" xsi:type="column"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>country</attribute-name>
- <field table="DX_ADDRESS" name="COUNTRY" xsi:type="column"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>id</attribute-name>
- <field table="DX_ADDRESS" name="ADDR_ID" xsi:type="column"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>postalCode</attribute-name>
- <field table="DX_ADDRESS" name="PCODE" xsi:type="column"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>street</attribute-name>
- <field table="DX_ADDRESS" name="STREET" xsi:type="column"/>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>independent</descriptor-type>
- <sequencing>
- <sequence-name>DX_ADDR_SEQ</sequence-name>
- <sequence-field table="DX_ADDRESS" name="ADDR_ID" xsi:type="column"/>
- </sequencing>
- <instantiation/>
- <copying xsi:type="instantiation-copy-policy"/>
- <tables>
- <table name="DX_ADDRESS"/>
- </tables>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>model.dynamic.employee.Employee</class>
- <alias>Employee</alias>
- <primary-key>
- <field table="DX_EMPLOYEE" name="EMP_ID" xsi:type="column"/>
- </primary-key>
- <events xsi:type="event-policy"/>
- <querying xsi:type="query-policy"/>
- <attribute-mappings>
- <attribute-mapping xsi:type="one-to-one-mapping">
- <attribute-name>address</attribute-name>
- <reference-class>model.dynamic.employee.Address</reference-class>
- <foreign-key>
- <field-reference>
- <source-field table="DX_EMPLOYEE" name="ADDR_FK" xsi:type="column"/>
- <target-field table="DX_ADDRESS" name="ADDR_ID" xsi:type="column"/>
- </field-reference>
- </foreign-key>
- <foreign-key-fields>
- <field table="DX_EMPLOYEE" name="ADDR_FK" xsi:type="column"/>
- </foreign-key-fields>
- <indirection xsi:type="value-holder-indirection-policy"/>
- <selection-query xsi:type="read-object-query"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>firstName</attribute-name>
- <field table="DX_EMPLOYEE" name="F_NAME" xsi:type="column"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>id</attribute-name>
- <field table="DX_EMPLOYEE" name="EMP_ID" xsi:type="column"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>lastName</attribute-name>
- <field table="DX_EMPLOYEE" name="L_NAME" xsi:type="column"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="aggregate-object-mapping">
- <attribute-name>period</attribute-name>
- <reference-class>model.dynamic.employee.EmploymentPeriod</reference-class>
- <allow-null>false</allow-null>
- <field-translations>
- <field-translation>
- <source-field name="endDate->DIRECT" xsi:type="column"/>
- <target-field table="DX_EMPLOYEE" name="END_DATE" xsi:type="column"/>
- </field-translation>
- <field-translation>
- <source-field name="startDate->DIRECT" xsi:type="column"/>
- <target-field table="DX_EMPLOYEE" name="START_DATE" xsi:type="column"/>
- </field-translation>
- </field-translations>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>salary</attribute-name>
- <field table="DX_SALARY" name="SALARY" xsi:type="column"/>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>independent</descriptor-type>
- <sequencing>
- <sequence-name>DX_EMP_SEQ</sequence-name>
- <sequence-field table="DX_EMPLOYEE" name="EMP_ID" xsi:type="column"/>
- </sequencing>
- <instantiation/>
- <copying xsi:type="instantiation-copy-policy"/>
- <tables>
- <table name="DX_EMPLOYEE"/>
- <table name="DX_SALARY"/>
- </tables>
- </class-mapping-descriptor>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>model.dynamic.employee.EmploymentPeriod</class>
- <alias>EmploymentPeriod</alias>
- <events xsi:type="event-policy"/>
- <querying xsi:type="query-policy"/>
- <attribute-mappings>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>endDate</attribute-name>
- <field name="endDate->DIRECT" xsi:type="column"/>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>startDate</attribute-name>
- <field name="startDate->DIRECT" xsi:type="column"/>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>aggregate</descriptor-type>
- <caching>
- <cache-size>-1</cache-size>
- </caching>
- <remote-caching>
- <cache-size>-1</cache-size>
- </remote-caching>
- <instantiation/>
- <copying xsi:type="instantiation-copy-policy"/>
- </class-mapping-descriptor>
- </class-mapping-descriptors>
- <login xsi:type="database-login">
- <platform-class>org.eclipse.persistence.platform.database.OraclePlatform</platform-class>
- <user-name></user-name>
- </login>
-</object-persistence>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/simple-map-project-no-login.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/simple-map-project-no-login.xml
deleted file mode 100644
index 1122346..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/simple-map-project-no-login.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<object-persistence version="1.1.2"
- 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>simpletable-dbws-or</name>
- <class-mapping-descriptors>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>simpletable.Simpletable</class>
- <alias>simpletableType</alias>
- <primary-key>
- <field table="SIMPLETABLE" name="ID" sql-typecode="3"
- xsi:type="column" />
- </primary-key>
- <events xsi:type="event-policy" />
- <querying xsi:type="query-policy">
- <queries>
- <query name="findByPrimaryKey" xsi:type="read-object-query">
- <criteria operator="equal" xsi:type="relation-expression">
- <left xsi:type="field-expression">
- <field table="SIMPLETABLE" name="ID" sql-typecode="3"
- xsi:type="column" />
- <base xsi:type="base-expression" />
- </left>
- <right xsi:type="parameter-expression">
- <parameter name="id" xsi:type="column" />
- </right>
- </criteria>
- <arguments>
- <argument name="id">
- <type>java.lang.Object</type>
- </argument>
- </arguments>
- <reference-class>simpletable.Simpletable</reference-class>
- </query>
- <query name="findAll" xsi:type="read-all-query">
- <reference-class>simpletable.Simpletable</reference-class>
- <container xsi:type="list-container-policy">
- <collection-type>java.util.Vector</collection-type>
- </container>
- </query>
- </queries>
- </querying>
- <attribute-mappings>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>id</attribute-name>
- <field table="SIMPLETABLE" name="ID" sql-typecode="3"
- xsi:type="column" />
- <attribute-classification>java.math.BigInteger</attribute-classification>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>name</attribute-name>
- <field table="SIMPLETABLE" name="NAME" sql-typecode="12"
- xsi:type="column" />
- <attribute-classification>java.lang.String</attribute-classification>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>since</attribute-name>
- <field table="SIMPLETABLE" name="SINCE" sql-typecode="93"
- xsi:type="column" />
- <attribute-classification>java.sql.Date</attribute-classification>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>independent</descriptor-type>
- <caching>
- <cache-type>weak-reference</cache-type>
- <cache-size>-1</cache-size>
- </caching>
- <remote-caching>
- <cache-type>weak-reference</cache-type>
- <cache-size>-1</cache-size>
- </remote-caching>
- <instantiation />
- <copying xsi:type="instantiation-copy-policy" />
- <tables>
- <table name="SIMPLETABLE" />
- </tables>
- </class-mapping-descriptor>
- </class-mapping-descriptors>
-</object-persistence>
\ No newline at end of file
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/simple-map-project.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/simple-map-project.xml
deleted file mode 100644
index 3f02109..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/simple-map-project.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<object-persistence version="1.1.2"
- 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>simpletable-dbws-or</name>
- <class-mapping-descriptors>
- <class-mapping-descriptor xsi:type="relational-class-mapping-descriptor">
- <class>simpletable.Simpletable</class>
- <alias>simpletableType</alias>
- <primary-key>
- <field table="SIMPLETABLE" name="ID" sql-typecode="3"
- xsi:type="column" />
- </primary-key>
- <events xsi:type="event-policy" />
- <querying xsi:type="query-policy">
- <queries>
- <query name="findByPrimaryKey" xsi:type="read-object-query">
- <criteria operator="equal" xsi:type="relation-expression">
- <left xsi:type="field-expression">
- <field table="SIMPLETABLE" name="ID" sql-typecode="3"
- xsi:type="column" />
- <base xsi:type="base-expression" />
- </left>
- <right xsi:type="parameter-expression">
- <parameter name="id" xsi:type="column" />
- </right>
- </criteria>
- <arguments>
- <argument name="id">
- <type>java.lang.Object</type>
- </argument>
- </arguments>
- <reference-class>simpletable.Simpletable</reference-class>
- </query>
- <query name="findAll" xsi:type="read-all-query">
- <reference-class>simpletable.Simpletable</reference-class>
- <container xsi:type="list-container-policy">
- <collection-type>java.util.Vector</collection-type>
- </container>
- </query>
- </queries>
- </querying>
- <attribute-mappings>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>id</attribute-name>
- <field table="SIMPLETABLE" name="ID" sql-typecode="3"
- xsi:type="column" />
- <attribute-classification>java.math.BigInteger</attribute-classification>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>name</attribute-name>
- <field table="SIMPLETABLE" name="NAME" sql-typecode="12"
- xsi:type="column" />
- <attribute-classification>java.lang.String</attribute-classification>
- </attribute-mapping>
- <attribute-mapping xsi:type="direct-mapping">
- <attribute-name>since</attribute-name>
- <field table="SIMPLETABLE" name="SINCE" sql-typecode="93"
- xsi:type="column" />
- <attribute-classification>java.sql.Date</attribute-classification>
- </attribute-mapping>
- </attribute-mappings>
- <descriptor-type>independent</descriptor-type>
- <caching>
- <cache-type>weak-reference</cache-type>
- <cache-size>-1</cache-size>
- </caching>
- <remote-caching>
- <cache-type>weak-reference</cache-type>
- <cache-size>-1</cache-size>
- </remote-caching>
- <instantiation />
- <copying xsi:type="instantiation-copy-policy" />
- <tables>
- <table name="SIMPLETABLE" />
- </tables>
- </class-mapping-descriptor>
- </class-mapping-descriptors>
- <login xsi:type="database-login">
- <platform-class>org.eclipse.persistence.platform.database.DatabasePlatform
- </platform-class>
- <connection-url></connection-url>
- </login>
-</object-persistence>
\ No newline at end of file
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/AllTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/AllTests.java
deleted file mode 100644
index 2206917..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/AllTests.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.simple;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { SimpleType.class,
- SimpleTypeCompositeKey.class,
- org.eclipse.persistence.testing.tests.dynamic.simple.mappings.AllTests.class,
- org.eclipse.persistence.testing.tests.dynamic.simple.sequencing.AllTests.class })
-public class AllTests {
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleType.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleType.java
deleted file mode 100644
index 0d471e2..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleType.java
+++ /dev/null
@@ -1,206 +0,0 @@
-package org.eclipse.persistence.testing.tests.dynamic.simple;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
-
-import java.util.Calendar;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.internal.dynamic.DynamicTypeImpl;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.IdentityMapAccessor;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.UnitOfWork;
-import org.eclipse.persistence.testing.tests.dynamic.EclipseLinkORMTest;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class SimpleType extends EclipseLinkORMTest {
-
- protected DynamicType simpleType;
-
- protected DynamicType getSimpleType() {
- if (simpleType == null) {
- this.simpleType = new DynamicHelper(getSharedSession()).getType("Simple");
-
- if (this.simpleType == null) {
- createSimpleType();
- }
- }
- return this.simpleType;
- }
-
- protected DynamicType createSimpleType() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
- Class<?> javaType = dcl.createDynamicClass("model.Simple");
-
- DynamicTypeBuilder typeBuilder = new DynamicTypeBuilder(javaType, null, "SIMPLE_TYPE");
- typeBuilder.setPrimaryKeyFields("SID");
- typeBuilder.addDirectMapping("id", int.class, "SID");
- typeBuilder.addDirectMapping("value1", String.class, "VAL_1");
- typeBuilder.addDirectMapping("value2", boolean.class, "VAL_2");
- typeBuilder.addDirectMapping("value3", Calendar.class, "VAL_3");
- typeBuilder.addDirectMapping("value4", Character.class, "VAL_4");
-
- helper.addTypes(true, true, typeBuilder.getType());
-
- return typeBuilder.getType();
- }
-
- @Test
- public void invalidDirectMappingSet_id() throws Exception {
- DynamicType type = new DynamicHelper(getSharedSession()).getType("Simple");
-
- DynamicEntity entity = type.newDynamicEntity();
-
- try {
- entity.set("id", 1l);
- } catch (Exception e) {
- return;
- }
- fail("Should have thrown DynamicException for invalid set type");
- }
-
- @Test
- public void verifyConfig() throws Exception {
- DatabaseSession session = getSharedSession();
-
- ClassDescriptor descriptor = session.getClassDescriptorForAlias("Simple");
- assertNotNull("No descriptor found for alias='Simple'", descriptor);
-
- DynamicTypeImpl simpleType = (DynamicTypeImpl) new DynamicHelper(session).getType("Simple");
- assertNotNull("'Simple' EntityType not found", simpleType);
-
- assertEquals(1 + descriptor.getPrimaryKeyFields().size(), simpleType.getMappingsRequiringInitialization().size());
-
- assertEquals(descriptor, simpleType.getDescriptor());
- }
-
- @Test
- public void find() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- createSimpleInstance(session, 1);
-
- DynamicEntity simpleInstance = find(helper, session, 1);
- assertNotNull("Could not find simple instance with id = 1", simpleInstance);
-
- simpleInstance = find(helper, session, new Integer(1));
- assertNotNull("Could not find simple instance with id = Integer(1)", simpleInstance);
- }
-
- @Test
- public void simpleInstance_CRUD() {
- Session session = getSession();
-
- IdentityMapAccessor cache = session.getIdentityMapAccessor();
-
- DynamicEntity simpleInstance = createSimpleInstance(session, 1);
- assertNotNull(simpleInstance);
-
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance));
- cache.initializeAllIdentityMaps();
- assertFalse(cache.containsObjectInIdentityMap(simpleInstance));
-
- }
-
- @Test
- public void verifyDefaultValuesFromEntityType() throws Exception {
- DynamicType simpleType = new DynamicHelper(getSharedSession()).getType("Simple");
-
- assertNotNull(simpleType);
-
- DynamicEntity simpleInstance = simpleType.newDynamicEntity();
- assertDefaultValues(simpleInstance);
- }
-
- @Test
- public void verifyDefaultValuesFromDescriptor() throws Exception {
- DynamicTypeImpl simpleType = (DynamicTypeImpl) new DynamicHelper(getSharedSession()).getType("Simple");
- assertNotNull(simpleType);
-
- DynamicEntity simpleInstance = (DynamicEntity) simpleType.getDescriptor().getObjectBuilder().buildNewInstance();
- assertDefaultValues(simpleInstance);
- }
-
- protected void assertDefaultValues(DynamicEntity simpleInstance) {
- assertNotNull(simpleInstance);
-
- assertTrue("id not set on new instance", simpleInstance.isSet("id"));
- assertEquals("id not default value", 0, simpleInstance.get("id"));
- assertFalse("value1 set on new instance", simpleInstance.isSet("value1"));
- assertTrue("value2 not set on new instance", simpleInstance.isSet("value2"));
- assertEquals("value2 not default value", false, simpleInstance.get("value2"));
- assertFalse("value3 set on new instance", simpleInstance.isSet("value3"));
- assertFalse("value4 set on new instance", simpleInstance.isSet("value4"));
- }
-
- public DynamicEntity createSimpleInstance(Session session, int id) {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicType simpleEntityType = helper.getType("Simple");
- Assert.assertNotNull(simpleEntityType);
-
- DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity();
- simpleInstance.set("id", id);
- simpleInstance.set("value2", true);
-
- ReportQuery countQuery = helper.newReportQuery("Simple", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- assertEquals(0, ((Number) session.executeQuery(countQuery)).intValue());
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstance);
- uow.commit();
-
- assertEquals(1, ((Number) session.executeQuery(countQuery)).intValue());
-
- DynamicEntity foundEntity = find(helper, session, 1);
-
- assertNotNull(foundEntity);
- assertEquals(simpleInstance.get("id"), foundEntity.get("id"));
- assertEquals(simpleInstance.get("value1"), foundEntity.get("value1"));
- assertEquals(simpleInstance.get("value2"), foundEntity.get("value2"));
-
- session.release();
-
- return simpleInstance;
- }
-
- protected DynamicEntity find(DynamicHelper helper, Session session, Object id) {
- ReadObjectQuery findQuery = helper.newReadObjectQuery("Simple");
- findQuery.setSelectionCriteria(findQuery.getExpressionBuilder().get("id").equal(id));
- return (DynamicEntity) session.executeQuery(findQuery);
- }
-
- @Before
- @After
- public void clearSimpleTypeInstances() {
- getSimpleType();
-
- getSharedSession().executeNonSelectingSQL("DELETE FROM SIMPLE_TYPE");
- getSharedSession().getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- @AfterClass
- public static void shutdown() {
- sharedSession.executeNonSelectingSQL("DROP TABLE SIMPLE_TYPE CASCADE CONSTRAINTS");
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeCompositeKey.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeCompositeKey.java
deleted file mode 100644
index f8ec8b3..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeCompositeKey.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package org.eclipse.persistence.testing.tests.dynamic.simple;
-
-import static junit.framework.Assert.*;
-
-import java.util.Calendar;
-
-import org.eclipse.persistence.dynamic.*;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.*;
-import org.junit.Assert;
-
-public class SimpleTypeCompositeKey extends SimpleType {
-
- @Override
- protected DynamicType createSimpleType() {
- DatabaseSession session = getSharedSession();
- DynamicHelper helper = new DynamicHelper(session);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> javaType = dcl.createDynamicClass("model.Simple");
-
- DynamicTypeBuilder typeBuilder = new DynamicTypeBuilder(javaType, null, "SIMPLE_TYPE");
- typeBuilder.setPrimaryKeyFields("SID1", "SID2");
- typeBuilder.addDirectMapping("id1", int.class, "SID1");
- typeBuilder.addDirectMapping("id2", int.class, "SID2");
- typeBuilder.addDirectMapping("value1", String.class, "VAL_1");
- typeBuilder.addDirectMapping("value2", boolean.class, "VAL_2");
- typeBuilder.addDirectMapping("value3", Calendar.class, "VAL_3");
- typeBuilder.addDirectMapping("value4", Character.class, "VAL_4");
-
- helper.addTypes(true, false, typeBuilder.getType());
-
- return typeBuilder.getType();
- }
-
- @Override
- protected void assertDefaultValues(DynamicEntity simpleInstance) {
- assertNotNull(simpleInstance);
-
- assertTrue("id1 not set on new instance", simpleInstance.isSet("id1"));
- assertEquals("id1 not default value", 0, simpleInstance.get("id1"));
- assertTrue("id2 not set on new instance", simpleInstance.isSet("id2"));
- assertEquals("id2 not default value", 0, simpleInstance.get("id2"));
- assertFalse("value1 set on new instance", simpleInstance.isSet("value1"));
- assertTrue("value2 not set on new instance", simpleInstance.isSet("value2"));
- assertEquals("value2 not default value", false, simpleInstance.get("value2"));
- assertFalse("value3 set on new instance", simpleInstance.isSet("value3"));
- assertFalse("value4 set on new instance", simpleInstance.isSet("value4"));
- }
-
- public DynamicEntity createSimpleInstance(Session session, int id) {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicType simpleEntityType = helper.getType("Simple");
- Assert.assertNotNull(simpleEntityType);
-
- DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity();
- simpleInstance.set("id1", id);
- simpleInstance.set("id2", id);
- simpleInstance.set("value2", true);
-
- ReportQuery countQuery = helper.newReportQuery("Simple", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- assertEquals(0, ((Number) session.executeQuery(countQuery)).intValue());
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstance);
- uow.commit();
-
- assertEquals(1, ((Number) session.executeQuery(countQuery)).intValue());
-
- DynamicEntity foundEntity = find(helper, session, 1);
-
- assertNotNull(foundEntity);
- assertEquals(simpleInstance.get("id1"), foundEntity.get("id1"));
- assertEquals(simpleInstance.get("id2"), foundEntity.get("id2"));
- assertEquals(simpleInstance.get("value1"), foundEntity.get("value1"));
- assertEquals(simpleInstance.get("value2"), foundEntity.get("value2"));
-
- return simpleInstance;
- }
-
- @Override
- protected DynamicEntity find(DynamicHelper helper, Session session, Object id) {
- ReadObjectQuery findQuery = helper.newReadObjectQuery( "Simple");
- ExpressionBuilder eb = findQuery.getExpressionBuilder();
- findQuery.setSelectionCriteria(eb.get("id1").equal(id).and(eb.get("id2").equal(id)));
- return (DynamicEntity) session.executeQuery(findQuery);
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/AllTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/AllTests.java
deleted file mode 100644
index 5ca7700..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/AllTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.simple.mappings;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { SimpleTypes_OneToOne.class, SimpleTypes_AggregateObject.class, SimpleTypes_MultiTable.class, SimpleTypes_OneToMany.class, SimpleTypes_ManyToMany.class })
-public class AllTests {
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_AggregateObject.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_AggregateObject.java
deleted file mode 100644
index 8b9652b..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_AggregateObject.java
+++ /dev/null
@@ -1,244 +0,0 @@
-package org.eclipse.persistence.testing.tests.dynamic.simple.mappings;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.internal.descriptors.changetracking.AggregateAttributeChangeListener;
-import org.eclipse.persistence.internal.dynamic.DynamicEntityImpl;
-import org.eclipse.persistence.mappings.AggregateObjectMapping;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.UnitOfWork;
-import org.eclipse.persistence.testing.tests.dynamic.EclipseLinkORMTest;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-public class SimpleTypes_AggregateObject extends EclipseLinkORMTest {
-
- @Test
- public void verifyConfig() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- ClassDescriptor descriptorA = helper.getSession().getClassDescriptorForAlias("SimpleA");
- assertNotNull("No descriptor found for alias='SimpleA'", descriptorA);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- assertNotNull("'SimpleA' EntityType not found", simpleTypeA);
- assertEquals(descriptorA, simpleTypeA.getDescriptor());
- DirectToFieldMapping a_id = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("id");
- assertEquals(int.class, a_id.getAttributeClassification());
- DirectToFieldMapping a_value1 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value1");
- assertEquals(String.class, a_value1.getAttributeClassification());
-
- ClassDescriptor descriptorB = helper.getSession().getClassDescriptorForAlias("SimpleB");
- assertNotNull("No descriptor found for alias='SimpleB'", descriptorB);
-
- DynamicType simpleTypeB = helper.getType("SimpleB");
- assertNotNull("'SimpleB' EntityType not found", simpleTypeB);
- assertEquals(descriptorB, simpleTypeB.getDescriptor());
- DirectToFieldMapping b_value2 = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("value2");
- assertEquals(boolean.class, b_value2.getAttributeClassification());
- DirectToFieldMapping b_value3 = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("value3");
- assertEquals(String.class, b_value3.getAttributeClassification());
- assertTrue(descriptorB.isAggregateDescriptor());
-
- AggregateObjectMapping a_b = (AggregateObjectMapping) descriptorA.getMappingForAttributeName("b");
- assertSame(descriptorB.getJavaClass(), a_b.getReferenceDescriptor().getJavaClass());
- assertTrue(a_b.isNullAllowed());
-
- ClassDescriptor descriptorC = helper.getSession().getClassDescriptorForAlias("SimpleC");
- assertNotNull("No descriptor found for alias='SimpleB'", descriptorB);
-
- DynamicType simpleTypeC = helper.getType("SimpleC");
- assertNotNull("'SimpleC' EntityType not found", simpleTypeC);
- assertEquals(descriptorB, simpleTypeB.getDescriptor());
- DirectToFieldMapping c_value4 = (DirectToFieldMapping) descriptorC.getMappingForAttributeName("value4");
- assertEquals(double.class, c_value4.getAttributeClassification());
- DirectToFieldMapping c_value5 = (DirectToFieldMapping) descriptorC.getMappingForAttributeName("value5");
- assertEquals(String.class, c_value5.getAttributeClassification());
- assertTrue(descriptorB.isAggregateDescriptor());
-
- AggregateObjectMapping a_c = (AggregateObjectMapping) descriptorA.getMappingForAttributeName("c");
- assertSame(descriptorC.getJavaClass(), a_c.getReferenceDescriptor().getJavaClass());
- assertFalse(a_c.isNullAllowed());
- }
-
- @Test
- public void verifyProperties() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- assertEquals(4, simpleTypeA.getNumberOfProperties());
- assertEquals("id", simpleTypeA.getPropertiesNames().get(0));
- assertEquals("value1", simpleTypeA.getPropertiesNames().get(1));
- assertEquals("b", simpleTypeA.getPropertiesNames().get(2));
- assertEquals("c", simpleTypeA.getPropertiesNames().get(3));
- }
-
- @Test
- public void createSimpleA() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- DynamicEntity a = simpleTypeA.newDynamicEntity();
-
- assertNotNull(a);
- assertTrue(a.isSet("id"));
- assertFalse(a.isSet("value1"));
- assertFalse(a.isSet("b"));
- assertTrue(a.isSet("c"));
-
- DynamicEntity c = a.<DynamicEntity> get("c");
- assertNotNull(c);
- assertTrue(c.isSet("value4"));
- assertFalse(c.isSet("value5"));
- }
-
- @Test
- public void persistSimpleA() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "A1");
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstance);
- uow.commit();
-
- ReportQuery countQuery = helper.newReportQuery("SimpleA", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCount = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCount);
- }
-
- @Test
- public void verifyChangTracking() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- persistSimpleA();
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- UnitOfWork uow = session.acquireUnitOfWork();
-
- ReadObjectQuery roq = helper.newReadObjectQuery("SimpleA");
- roq.setSelectionCriteria(roq.getExpressionBuilder().get("id").equal(1));
-
- DynamicEntityImpl sharedA = (DynamicEntityImpl) session.executeQuery(roq);
- assertNotNull(sharedA);
- assertNull(sharedA._persistence_getPropertyChangeListener());
-
- DynamicEntityImpl a = (DynamicEntityImpl) uow.executeQuery(roq);
- assertNotNull(a);
- assertNotNull(a._persistence_getPropertyChangeListener());
-
- DynamicEntityImpl c = a.<DynamicEntityImpl> get("c");
- assertNotNull(c);
- assertNotNull(c._persistence_getPropertyChangeListener());
- assertTrue(c._persistence_getPropertyChangeListener() instanceof AggregateAttributeChangeListener);
-
- uow.release();
- }
-
- @Test
- public void createSimpleAwithSimpleB() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- Assert.assertNotNull(session.getDescriptorForAlias("SimpleB"));
-
- DynamicEntity simpleInstanceB = simpleTypeB.newDynamicEntity();
- simpleInstanceB.set("value2", true);
- simpleInstanceB.set("value3", "B2");
-
- DynamicEntity simpleInstanceA = simpleTypeA.newDynamicEntity();
- simpleInstanceA.set("id", 2);
- simpleInstanceA.set("value1", "A2");
- simpleInstanceA.set("b", simpleInstanceB);
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstanceA);
- uow.commit();
-
- ReportQuery countQuery = helper.newReportQuery("SimpleA", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
-
- int simpleCountA = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCountA);
-
- }
-
- @Override
- protected DatabaseSession getSharedSession() {
- DatabaseSession shared = super.getSharedSession();
-
- DynamicHelper helper = new DynamicHelper(shared);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> simpleTypeB = dcl.createDynamicClass("model.SimpleB");
- DynamicTypeBuilder bTypeBuilder = new DynamicTypeBuilder(simpleTypeB, null);
- bTypeBuilder.addDirectMapping("value2", boolean.class, "VAL_2");
- bTypeBuilder.addDirectMapping("value3", String.class, "VAL_3");
-
- Class<?> simpleTypeC = dcl.createDynamicClass("model.SimpleC");
- DynamicTypeBuilder cTypeBuilder = new DynamicTypeBuilder(simpleTypeC, null);
- cTypeBuilder.addDirectMapping("value4", double.class, "VAL_4");
- cTypeBuilder.addDirectMapping("value5", String.class, "VAL_5");
-
- Class<?> simpleTypeA = dcl.createDynamicClass("model.SimpleA");
- DynamicTypeBuilder aTypeBuilder = new DynamicTypeBuilder(simpleTypeA, null, "SIMPLE_TYPE_A");
- aTypeBuilder.setPrimaryKeyFields("SID");
- aTypeBuilder.addDirectMapping("id", int.class, "SID");
- aTypeBuilder.addDirectMapping("value1", String.class, "VAL_1");
- aTypeBuilder.addAggregateObjectMapping("b", bTypeBuilder.getType(), true);
- aTypeBuilder.addAggregateObjectMapping("c", cTypeBuilder.getType(), false);
-
- helper.addTypes(true, true, aTypeBuilder.getType(), bTypeBuilder.getType(), cTypeBuilder.getType());
- return shared;
- }
-
- @After
- public void clearDynamicTables() {
- getSharedSession().executeNonSelectingSQL("DELETE FROM SIMPLE_TYPE_A");
- }
-
- @AfterClass
- public static void shutdown() {
- sharedSession.executeNonSelectingSQL("DROP TABLE SIMPLE_TYPE_A CASCADE CONSTRAINTS");
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_ManyToMany.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_ManyToMany.java
deleted file mode 100644
index d5dc493..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_ManyToMany.java
+++ /dev/null
@@ -1,240 +0,0 @@
-package org.eclipse.persistence.testing.tests.dynamic.simple.mappings;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-
-import java.util.Collection;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.internal.dynamic.DynamicTypeImpl;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.mappings.ManyToManyMapping;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.UnitOfWork;
-import org.eclipse.persistence.testing.tests.dynamic.EclipseLinkORMTest;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-public class SimpleTypes_ManyToMany extends EclipseLinkORMTest {
-
- private DynamicHelper helper;
- private DynamicType aType;
- private DynamicType bType;
-
- public DynamicType getAType() {
- if (this.aType == null) {
- this.aType = getHelper().getType("SimpleA");
- }
- return aType;
- }
-
- public DynamicType getBType() {
- if (this.bType == null) {
- this.bType = getHelper().getType("SimpleB");
- }
- return bType;
- }
-
- public DynamicHelper getHelper() {
- if (this.helper == null) {
- this.helper = new DynamicHelper(getSharedSession());
- }
- return this.helper;
- }
-
- @Test
- public void verifyConfig() throws Exception {
- Session session = getSession();
-
- ClassDescriptor descriptorA = session.getClassDescriptorForAlias("SimpleA");
- assertNotNull("No descriptor found for alias='SimpleA'", descriptorA);
-
- DynamicTypeImpl simpleTypeA = (DynamicTypeImpl) getAType();
- assertNotNull("'SimpleA' EntityType not found", simpleTypeA);
- assertEquals(descriptorA, simpleTypeA.getDescriptor());
- DirectToFieldMapping a_id = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("id");
- assertEquals(int.class, a_id.getAttributeClassification());
- DirectToFieldMapping a_value1 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value1");
- assertEquals(String.class, a_value1.getAttributeClassification());
-
- ClassDescriptor descriptorB = session.getClassDescriptorForAlias("SimpleB");
- assertNotNull("No descriptor found for alias='SimpleB'", descriptorB);
-
- DynamicTypeImpl simpleTypeB = (DynamicTypeImpl) getHelper().getType("SimpleB");
- assertNotNull("'SimpleB' EntityType not found", simpleTypeB);
- assertEquals(descriptorB, simpleTypeB.getDescriptor());
- DirectToFieldMapping b_id = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("id");
- assertEquals(int.class, b_id.getAttributeClassification());
- DirectToFieldMapping b_value1 = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("value1");
- assertEquals(String.class, b_value1.getAttributeClassification());
-
- ManyToManyMapping a_b = (ManyToManyMapping) descriptorA.getMappingForAttributeName("b");
- assertEquals(descriptorB, a_b.getReferenceDescriptor());
- }
-
- @Test
- public void createSimpleA() {
- Session session = getSession();
-
- DynamicTypeImpl simpleTypeA = (DynamicTypeImpl) getHelper().getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "A1");
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstance);
- uow.commit();
-
- ReportQuery countQuery = getHelper().newReportQuery("SimpleA", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCount = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCount);
- }
-
- @Test
- public void createSimpleB() {
- Session session = getSession();
-
- DynamicTypeImpl simpleTypeB = (DynamicTypeImpl) getHelper().getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- DynamicEntity simpleInstance = simpleTypeB.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "B1");
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstance);
- uow.commit();
-
- ReportQuery countQuery = getHelper().newReportQuery(simpleTypeB.getName(), new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCount = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCount);
- }
-
- @Test
- public void createAwithB() {
- Session session = getSession();
-
- DynamicTypeImpl simpleTypeA = (DynamicTypeImpl) getHelper().getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
- DynamicTypeImpl simpleTypeB = (DynamicTypeImpl) getHelper().getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- Assert.assertNotNull(session.getDescriptorForAlias("SimpleB"));
-
- DynamicEntity simpleInstanceB = simpleTypeB.newDynamicEntity();
- simpleInstanceB.set("id", 1);
- simpleInstanceB.set("value1", "B2");
-
- DynamicEntity simpleInstanceA = simpleTypeA.newDynamicEntity();
- simpleInstanceA.set("id", 1);
- simpleInstanceA.set("value1", "A2");
- simpleInstanceA.<Collection<DynamicEntity>> get("b").add(simpleInstanceA);
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstanceB);
- uow.registerNewObject(simpleInstanceA);
- uow.commit();
-
- ReportQuery countQueryB = getHelper().newReportQuery("SimpleB", new ExpressionBuilder());
- countQueryB.addCount();
- countQueryB.setShouldReturnSingleValue(true);
- int simpleCountB = ((Number) session.executeQuery(countQueryB)).intValue();
- Assert.assertEquals(1, simpleCountB);
-
- ReportQuery countQueryA = getHelper().newReportQuery("SimpleA", new ExpressionBuilder());
- countQueryA.addCount();
- countQueryA.setShouldReturnSingleValue(true);
- int simpleCountA = ((Number) session.executeQuery(countQueryA)).intValue();
- Assert.assertEquals(1, simpleCountA);
- }
-
- @Test
- public void createAwithExistingB() {
- // TODO Assert.fail("Not Yet Implemented");
- }
-
- @Test
- public void removeRelationshop() {
- Session session = getSession();
- createAwithB();
-
- UnitOfWork uow = session.acquireUnitOfWork();
-
- ReadObjectQuery roq = getHelper().newReadObjectQuery("SimpleA");
- roq.setSelectionCriteria(roq.getExpressionBuilder().get("id").equal(1));
- DynamicEntity a = (DynamicEntity) session.executeQuery(roq);
- assertNotNull(a);
-
- List<DynamicEntity> bs = a.<List<DynamicEntity>> get("b");
- assertNotNull(bs);
- assertEquals(1, bs.size());
- bs.remove(0);
-
- uow.commit();
- }
-
- @Test
- public void addAtoB() {
- // TODO Assert.fail("Not Yet Implemented");
- }
-
- @Override
- protected DatabaseSession createSharedSession() {
- DatabaseSession shared = super.createSharedSession();
- DynamicHelper helper = new DynamicHelper(shared);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> simpleTypeA = dcl.createDynamicClass("model.SimpleA");
- DynamicTypeBuilder aFactory = new DynamicTypeBuilder(simpleTypeA, null, "SIMPLE_TYPE_A");
- aFactory.setPrimaryKeyFields("SID");
-
- Class<?> simpleTypeB = dcl.createDynamicClass("model.SimpleB");
- DynamicTypeBuilder bFactory = new DynamicTypeBuilder(simpleTypeB, null, "SIMPLE_TYPE_B");
- bFactory.setPrimaryKeyFields("SID");
-
- bFactory.addDirectMapping("id", int.class, "SID");
- bFactory.addDirectMapping("value1", String.class, "VAL_1");
-
- aFactory.addDirectMapping("id", int.class, "SID");
- aFactory.addDirectMapping("value1", String.class, "VAL_1");
- aFactory.addManyToManyMapping("b", bFactory.getType(), "SIMPLE_A_B");
-
- helper.addTypes(true, true, aFactory.getType(), bFactory.getType());
-
- return shared;
- }
-
- @After
- public void clearDynamicTables() {
- getSharedSession().executeNonSelectingSQL("DELETE FROM SIMPLE_A_B");
- getSharedSession().executeNonSelectingSQL("DELETE FROM SIMPLE_TYPE_A");
- getSharedSession().executeNonSelectingSQL("DELETE FROM SIMPLE_TYPE_B");
- }
-
- @AfterClass
- public static void shutdown() {
- sharedSession.executeNonSelectingSQL("DROP TABLE SIMPLE_A_B CASCADE CONSTRAINTS");
- sharedSession.executeNonSelectingSQL("DROP TABLE SIMPLE_TYPE_A CASCADE CONSTRAINTS");
- sharedSession.executeNonSelectingSQL("DROP TABLE SIMPLE_TYPE_B CASCADE CONSTRAINTS");
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_MultiTable.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_MultiTable.java
deleted file mode 100644
index f902888..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_MultiTable.java
+++ /dev/null
@@ -1,188 +0,0 @@
-package org.eclipse.persistence.testing.tests.dynamic.simple.mappings;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.internal.dynamic.DynamicEntityImpl;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.UnitOfWork;
-import org.eclipse.persistence.testing.tests.dynamic.EclipseLinkORMTest;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-public class SimpleTypes_MultiTable extends EclipseLinkORMTest {
-
- @Test
- public void verifyConfig() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- ClassDescriptor descriptorA = helper.getSession().getClassDescriptorForAlias("SimpleA");
- assertNotNull("No descriptor found for alias='SimpleA'", descriptorA);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- assertNotNull("'SimpleA' EntityType not found", simpleTypeA);
- assertEquals(descriptorA, simpleTypeA.getDescriptor());
-
- assertTrue(descriptorA.hasMultipleTables());
- assertEquals(3, descriptorA.getTables().size());
-
- DirectToFieldMapping a_id = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("id");
- assertEquals(int.class, a_id.getAttributeClassification());
- DirectToFieldMapping a_value1 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value1");
- assertEquals(String.class, a_value1.getAttributeClassification());
-
- DirectToFieldMapping a_value2 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value2");
- assertEquals(boolean.class, a_value2.getAttributeClassification());
-
- DirectToFieldMapping a_value3 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value3");
- assertEquals(String.class, a_value3.getAttributeClassification());
-
- DirectToFieldMapping a_value4 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value4");
- assertEquals(double.class, a_value4.getAttributeClassification());
-
- DirectToFieldMapping a_value5 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value5");
- assertEquals(String.class, a_value5.getAttributeClassification());
- }
-
- @Test
- public void verifyProperties() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- assertEquals(6, simpleTypeA.getNumberOfProperties());
- assertEquals("id", simpleTypeA.getPropertiesNames().get(0));
- assertEquals(int.class, simpleTypeA.getPropertyType(0));
- assertEquals("value1", simpleTypeA.getPropertiesNames().get(1));
- assertEquals(String.class, simpleTypeA.getPropertyType(1));
- assertEquals("value2", simpleTypeA.getPropertiesNames().get(2));
- assertEquals(boolean.class, simpleTypeA.getPropertyType(2));
- assertEquals("value3", simpleTypeA.getPropertiesNames().get(3));
- assertEquals(String.class, simpleTypeA.getPropertyType(3));
- assertEquals("value4", simpleTypeA.getPropertiesNames().get(4));
- assertEquals(double.class, simpleTypeA.getPropertyType(4));
- assertEquals("value5", simpleTypeA.getPropertiesNames().get(5));
- assertEquals(String.class, simpleTypeA.getPropertyType(5));
-
- }
-
- @Test
- public void createSimpleA() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- DynamicEntity a = simpleTypeA.newDynamicEntity();
-
- assertNotNull(a);
- assertTrue(a.isSet("id"));
- assertFalse(a.isSet("value1"));
- assertTrue(a.isSet("value2"));
- assertFalse(a.isSet("value3"));
- assertTrue(a.isSet("value4"));
- assertFalse(a.isSet("value5"));
- }
-
- @Test
- public void persistSimpleA() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "A1");
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstance);
- uow.commit();
-
- ReportQuery countQuery = helper.newReportQuery("SimpleA", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCount = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCount);
-
- session.release();
- }
-
- @Test
- public void verifyChangeTracking() {
- persistSimpleA();
-
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- UnitOfWork uow = session.acquireUnitOfWork();
-
- ReadObjectQuery findQuery = helper.newReadObjectQuery("SimpleA");
- findQuery.setSelectionCriteria(findQuery.getExpressionBuilder().get("id").equal(1));
- DynamicEntityImpl a = (DynamicEntityImpl) uow.executeQuery(findQuery);
-
- assertNotNull(a);
- assertNotNull(a._persistence_getPropertyChangeListener());
-
- uow.release();
- session.release();
- }
-
- @Override
- protected DatabaseSession createSharedSession() {
- DatabaseSession shared = super.createSharedSession();
- DynamicHelper helper = new DynamicHelper(shared);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> simpleTypeA = dcl.createDynamicClass("model.SimpleA");
-
- DynamicTypeBuilder typeBuilder = new DynamicTypeBuilder(simpleTypeA, null, "SIMPLE_TYPE_A", "SIMPLE_TYPE_B", "SIMPLE_TYPE_C");
- typeBuilder.setPrimaryKeyFields("SIMPLE_TYPE_A.SID");
- typeBuilder.addDirectMapping("id", int.class, "SIMPLE_TYPE_A.SID");
- typeBuilder.addDirectMapping("value1", String.class, "SIMPLE_TYPE_A.VAL_1");
- typeBuilder.addDirectMapping("value2", boolean.class, "SIMPLE_TYPE_B.VAL_2");
- typeBuilder.addDirectMapping("value3", String.class, "SIMPLE_TYPE_B.VAL_3");
- typeBuilder.addDirectMapping("value4", double.class, "SIMPLE_TYPE_C.VAL_4");
- typeBuilder.addDirectMapping("value5", String.class, "SIMPLE_TYPE_C.VAL_5");
-
- shared.login();
- helper.addTypes(true, true, typeBuilder.getType());
-
- return shared;
- }
-
- @After
- public void clearDynamicTables() {
- getSharedSession().executeNonSelectingSQL("DELETE FROM SIMPLE_TYPE_C");
- getSharedSession().executeNonSelectingSQL("DELETE FROM SIMPLE_TYPE_B");
- getSharedSession().executeNonSelectingSQL("DELETE FROM SIMPLE_TYPE_A");
- }
-
- @AfterClass
- public static void shutdown() {
- sharedSession.executeNonSelectingSQL("DROP TABLE SIMPLE_TYPE_A CASCADE CONSTRAINTS");
- sharedSession.executeNonSelectingSQL("DROP TABLE SIMPLE_TYPE_B CASCADE CONSTRAINTS");
- sharedSession.executeNonSelectingSQL("DROP TABLE SIMPLE_TYPE_C CASCADE CONSTRAINTS");
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_OneToMany.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_OneToMany.java
deleted file mode 100644
index 86e2894..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_OneToMany.java
+++ /dev/null
@@ -1,400 +0,0 @@
-package org.eclipse.persistence.testing.tests.dynamic.simple.mappings;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.exceptions.DatabaseException;
-import org.eclipse.persistence.exceptions.DynamicException;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.UnitOfWork;
-import org.eclipse.persistence.testing.tests.dynamic.EclipseLinkORMTest;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-public class SimpleTypes_OneToMany extends EclipseLinkORMTest {
-
- @Test
- public void verifyConfig() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- ClassDescriptor descriptorA = helper.getSession().getClassDescriptorForAlias("SimpleA");
- assertNotNull("No descriptor found for alias='SimpleA'", descriptorA);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- assertNotNull("'SimpleA' EntityType not found", simpleTypeA);
- assertEquals(descriptorA, simpleTypeA.getDescriptor());
- DirectToFieldMapping a_id = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("id");
- assertEquals(int.class, a_id.getAttributeClassification());
- DirectToFieldMapping a_value1 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value1");
- assertEquals(String.class, a_value1.getAttributeClassification());
-
- ClassDescriptor descriptorB = helper.getSession().getClassDescriptorForAlias("SimpleB");
- assertNotNull("No descriptor found for alias='SimpleB'", descriptorB);
-
- DynamicType simpleTypeB = helper.getType("SimpleB");
- assertNotNull("'SimpleB' EntityType not found", simpleTypeB);
- assertEquals(descriptorB, simpleTypeB.getDescriptor());
- DirectToFieldMapping b_id = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("id");
- assertEquals(int.class, b_id.getAttributeClassification());
- DirectToFieldMapping b_value1 = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("value1");
- assertEquals(String.class, b_value1.getAttributeClassification());
-
- OneToManyMapping a_b = (OneToManyMapping) descriptorA.getMappingForAttributeName("b");
- assertEquals(descriptorB, a_b.getReferenceDescriptor());
- }
-
- @Test
- public void verifyNewSimpleA() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicEntity newA = helper.getType("SimpleA").newDynamicEntity();
-
- assertNotNull(newA);
- assertTrue(newA.isSet("id"));
- assertFalse(newA.isSet("value1"));
- assertTrue(newA.isSet("b"));
-
- Object b = newA.get("b");
- assertNotNull(b);
- assertTrue(b instanceof Collection);
- }
-
- @Test
- public void verifyNewSimpleA_InvalidB_Map() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicEntity newA = helper.getType("SimpleA").newDynamicEntity();
-
- try {
- newA.set("b", new HashMap());
- } catch (DynamicException e) {
- return;
- }
- fail("DynamicException expected putting Map in 'b'");
- }
-
- @Test
- public void verifyNewSimpleA_InvalidB_Object() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicEntity newA = helper.getType("SimpleA").newDynamicEntity();
-
- try {
- newA.set("b", new Object());
- } catch (DynamicException e) {
- return;
- }
- fail("DynamicException expected putting Object in 'b'");
- }
-
- @Test
- public void verifyNewSimpleA_InvalidB_A() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicEntity newA = helper.getType("SimpleA").newDynamicEntity();
-
- try {
- newA.set("b", helper.getType("SimpleA").newDynamicEntity());
- } catch (DynamicException e) {
- return;
- }
- fail("DynamicException expected putting A in 'b'");
- }
-
- @Test
- public void verifyNewSimpleA_InvalidB_B() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicEntity newA = helper.getType("SimpleA").newDynamicEntity();
-
- try {
- newA.set("b", helper.getType("SimpleB").newDynamicEntity());
- } catch (DynamicException e) {
- return;
- }
- fail("DynamicException expected putting B in 'b'");
- }
-
- @Test
- public void verifyNewSimpleA_InvalidB_NULL() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicEntity newA = helper.getType("SimpleA").newDynamicEntity();
-
- try {
- newA.set("b", null);
- } catch (DynamicException e) {
- return;
- }
- fail("DynamicException expected putting NULL in 'b'");
- }
-
- @Test
- public void createSimpleA() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "A1");
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstance);
- uow.commit();
-
- ReportQuery countQuery = helper.newReportQuery("SimpleA", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCount = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCount);
-
- session.release();
- }
-
- @Test
- public void createSimpleB() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- DynamicEntity simpleInstance = simpleTypeB.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "B1");
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstance);
- uow.commit();
-
- ReportQuery countQuery = helper.newReportQuery("SimpleB", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCount = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCount);
-
- }
-
- @Test
- public void createAwithB() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- Assert.assertNotNull(session.getDescriptorForAlias("SimpleB"));
-
- DynamicEntity simpleInstanceB = simpleTypeB.newDynamicEntity();
- simpleInstanceB.set("id", 1);
- simpleInstanceB.set("value1", "B2");
-
- DynamicEntity simpleInstanceA = simpleTypeA.newDynamicEntity();
- simpleInstanceA.set("id", 1);
- simpleInstanceA.set("value1", "A2");
- simpleInstanceA.<Collection<DynamicEntity>> get("b").add(simpleInstanceB);
-
- simpleInstanceB.set("a", simpleInstanceA);
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstanceB);
- uow.registerNewObject(simpleInstanceA);
- uow.commit();
-
- ReportQuery countQuery = helper.newReportQuery("SimpleB", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCountB = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCountB);
-
- countQuery = helper.newReportQuery("SimpleA", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCountA = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCountA);
-
- session.release();
- }
-
- @Test
- public void createAwithBCollection() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- Assert.assertNotNull(session.getDescriptorForAlias("SimpleB"));
-
- DynamicEntity simpleInstanceB = simpleTypeB.newDynamicEntity();
- simpleInstanceB.set("id", 1);
- simpleInstanceB.set("value1", "B2");
-
- DynamicEntity simpleInstanceA = simpleTypeA.newDynamicEntity();
- simpleInstanceA.set("id", 1);
- simpleInstanceA.set("value1", "A2");
-
- Collection<DynamicEntity> bs = new ArrayList<DynamicEntity>();
- bs.add(simpleInstanceB);
- simpleInstanceA.set("b", bs);
-
- simpleInstanceB.set("a", simpleInstanceA);
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstanceB);
- uow.registerNewObject(simpleInstanceA);
- uow.commit();
-
- ReportQuery countQuery = helper.newReportQuery("SimpleB", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCountB = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCountB);
-
- countQuery = helper.newReportQuery("SimpleA", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCountA = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCountA);
-
- session.release();
- }
-
- @Test
- public void removeAwithB_PrivateOwned() {
- createAwithB();
-
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicType simpleAType = helper.getType("SimpleA");
- ((OneToManyMapping) simpleAType.getDescriptor().getMappingForAttributeName("b")).setIsPrivateOwned(true);
-
- Session session = getSession();
-
- UnitOfWork uow = session.acquireUnitOfWork();
-
- ReadObjectQuery findQuery = helper.newReadObjectQuery("SimpleA");
- findQuery.setSelectionCriteria(findQuery.getExpressionBuilder().get("id").equal(1));
- DynamicEntity a = (DynamicEntity) uow.executeQuery(findQuery);
-
- assertNotNull(a);
- ReportQuery countQuery = helper.newReportQuery("SimpleB", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCountB = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCountB);
- countQuery = helper.newReportQuery("SimpleA", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCountA = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCountA);
-
- uow.deleteObject(a);
- // em.remove(a.get("b", List.class).get(0));
-
- uow.commit();
-
- countQuery = helper.newReportQuery("SimpleB", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- simpleCountB = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(0, simpleCountB);
- countQuery = helper.newReportQuery("SimpleA", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- simpleCountA = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(0, simpleCountA);
-
- }
-
- @Test
- public void createAwithExistingB() {
- // TODO Assert.fail("Not Yet Implemented");
- }
-
- @Test
- public void removeBfromA() {
- // TODO Assert.fail("Not Yet Implemented");
- }
-
- @Test
- public void addAtoB() {
- // TODO Assert.fail("Not Yet Implemented");
- }
-
- @Override
- protected DatabaseSession createSharedSession() {
- DatabaseSession shared = super.createSharedSession();
- DynamicHelper helper = new DynamicHelper(shared);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- // Create Dynamic Classes
- Class<?> simpleTypeA = dcl.createDynamicClass("model.SimpleA");
- Class<?> simpleTypeB = dcl.createDynamicClass("model.SimpleB");
-
- // Build dynamic types with mappings
- DynamicTypeBuilder aTypeBuilder = new DynamicTypeBuilder(simpleTypeA, null, "SIMPLE_TYPE_A");
- aTypeBuilder.setPrimaryKeyFields("SID");
-
- DynamicTypeBuilder bTypeBuilder = new DynamicTypeBuilder(simpleTypeB, null, "SIMPLE_TYPE_B");
- bTypeBuilder.setPrimaryKeyFields("SID");
-
- bTypeBuilder.addDirectMapping("id", int.class, "SID");
- bTypeBuilder.addDirectMapping("value1", String.class, "VAL_1");
- bTypeBuilder.addOneToOneMapping("a", aTypeBuilder.getType(), "A_FK");
-
- aTypeBuilder.addDirectMapping("id", int.class, "SID");
- aTypeBuilder.addDirectMapping("value1", String.class, "VAL_1");
- aTypeBuilder.addOneToManyMapping("b", bTypeBuilder.getType(), "A_FK");
-
- helper.addTypes(true, true, aTypeBuilder.getType(), bTypeBuilder.getType());
-
- return shared;
- }
-
- @After
- public void clearDynamicTables() {
- getSharedSession().executeNonSelectingSQL("DELETE FROM SIMPLE_TYPE_B");
- getSharedSession().executeNonSelectingSQL("DELETE FROM SIMPLE_TYPE_A");
- }
-
- @AfterClass
- public static void shutdown() {
- try {
- sharedSession.executeNonSelectingSQL("DROP TABLE SIMPLE_TYPE_A CASCADE CONSTRAINTS");
- sharedSession.executeNonSelectingSQL("DROP TABLE SIMPLE_TYPE_B CASCADE CONSTRAINTS");
- } catch (DatabaseException dbe) {
- // ignore
- }
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_OneToOne.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_OneToOne.java
deleted file mode 100644
index 9303121..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_OneToOne.java
+++ /dev/null
@@ -1,224 +0,0 @@
-package org.eclipse.persistence.testing.tests.dynamic.simple.mappings;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.fail;
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.exceptions.DatabaseException;
-import org.eclipse.persistence.exceptions.DynamicException;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.mappings.OneToOneMapping;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Project;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.UnitOfWork;
-import org.eclipse.persistence.testing.tests.dynamic.DynamicTestHelper;
-import org.eclipse.persistence.testing.tests.dynamic.EclipseLinkORMTest;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-public class SimpleTypes_OneToOne extends EclipseLinkORMTest {
-
- @Test
- public void verifyConfig() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- ClassDescriptor descriptorA = helper.getSession().getClassDescriptorForAlias("SimpleA");
- assertNotNull("No descriptor found for alias='SimpleA'", descriptorA);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- assertNotNull("'SimpleA' EntityType not found", simpleTypeA);
- assertEquals(descriptorA, simpleTypeA.getDescriptor());
- DirectToFieldMapping a_id = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("id");
- assertEquals(int.class, a_id.getAttributeClassification());
- DirectToFieldMapping a_value1 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value1");
- assertEquals(String.class, a_value1.getAttributeClassification());
-
- ClassDescriptor descriptorB = helper.getSession().getClassDescriptorForAlias("SimpleB");
- assertNotNull("No descriptor found for alias='SimpleB'", descriptorB);
-
- DynamicType simpleTypeB = helper.getType("SimpleB");
- assertNotNull("'SimpleB' EntityType not found", simpleTypeB);
- assertEquals(descriptorB, simpleTypeB.getDescriptor());
- DirectToFieldMapping b_id = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("id");
- assertEquals(int.class, b_id.getAttributeClassification());
- DirectToFieldMapping b_value1 = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("value1");
- assertEquals(String.class, b_value1.getAttributeClassification());
-
- OneToOneMapping a_b = (OneToOneMapping) descriptorA.getMappingForAttributeName("b");
- assertEquals(descriptorB, a_b.getReferenceDescriptor());
- }
-
- @Test
- public void createSimpleA() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "A1");
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstance);
- uow.commit();
-
- ReportQuery countQuery = helper.newReportQuery("SimpleA", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCount = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCount);
- }
-
- @Test
- public void createSimpleB() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- DynamicEntity simpleInstance = simpleTypeB.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "B1");
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstance);
- uow.commit();
-
- ReportQuery countQuery = helper.newReportQuery("SimpleB", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- int simpleCount = ((Number) session.executeQuery(countQuery)).intValue();
- Assert.assertEquals(1, simpleCount);
- }
-
- @Test
- public void createSimpleAwithSimpleB() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = getSession();
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
- Assert.assertNotNull(session.getDescriptorForAlias("SimpleB"));
-
- DynamicEntity simpleInstanceB = simpleTypeB.newDynamicEntity();
- simpleInstanceB.set("id", 2);
- simpleInstanceB.set("value1", "B2");
-
- DynamicEntity simpleInstanceA = simpleTypeA.newDynamicEntity();
- simpleInstanceA.set("id", 2);
- simpleInstanceA.set("value1", "A2");
- simpleInstanceA.set("b", simpleInstanceB);
-
- UnitOfWork uow = session.acquireUnitOfWork();
- uow.registerNewObject(simpleInstanceA);
- uow.registerNewObject(simpleInstanceB);
- uow.commit();
-
- assertEquals(2, getQuerySQLTracker(session).getTotalSQLINSERTCalls());
- // There is no reason for a shallow insert and an update in this mapping
- assertEquals("No update expected for new objects with 1:1", 0, getQuerySQLTracker(session).getTotalSQLUPDATECalls());
-
- ReportQuery countQuery = helper.newReportQuery("SimpleB", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- Assert.assertEquals(1, ((Number) session.executeQuery(countQuery)).intValue());
-
- countQuery = helper.newReportQuery("SimpleA", new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
- Assert.assertEquals(1, ((Number) session.executeQuery(countQuery)).intValue());
-
- }
-
- /*
- * Invalid relationship set
- */
- @Test
- public void createSimpleAwithSimpleA() {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- DynamicEntity simpleInstanceA1 = simpleTypeA.newDynamicEntity();
- simpleInstanceA1.set("id", 1);
- simpleInstanceA1.set("value1", "A1");
-
- DynamicEntity simpleInstanceA2 = simpleTypeA.newDynamicEntity();
- simpleInstanceA2.set("id", 2);
- simpleInstanceA2.set("value1", "A2");
-
- try {
- simpleInstanceA2.set("b", simpleInstanceA1);
- } catch (DynamicException e){
- return;
- }
-
- fail("DynamicException expected for invalid set of 'b'");
- }
-
- @Override
- protected DatabaseSession createSharedSession() {
- Project project = new Project(DynamicTestHelper.getTestLogin());
- DatabaseSession shared = project.createDatabaseSession();
- DynamicHelper helper = new DynamicHelper(shared);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> simpleTypeB = dcl.createDynamicClass("model.SimpleB");
- DynamicTypeBuilder bFactory = new DynamicTypeBuilder(simpleTypeB, null, "SIMPLE_TYPE_B");
- bFactory.setPrimaryKeyFields("SID");
- bFactory.addDirectMapping("id", int.class, "SID");
- bFactory.addDirectMapping("value1", String.class, "VAL_1");
-
- Class<?> simpleTypeA = dcl.createDynamicClass("model.SimpleA");
- DynamicTypeBuilder aFactory = new DynamicTypeBuilder(simpleTypeA, null, "SIMPLE_TYPE_A");
- aFactory.setPrimaryKeyFields("SID");
- aFactory.addDirectMapping("id", int.class, "SID");
- aFactory.addDirectMapping("value1", String.class, "VAL_1");
- aFactory.addOneToOneMapping("b", bFactory.getType(), "B_FK");
-
- helper.addTypes(false, true, aFactory.getType(), bFactory.getType());
-
- shared.getSessionLog().setLevel(SessionLog.FINE);
- shared.login();
-
- new SchemaManager(shared).replaceDefaultTables();
-
- return shared;
- }
-
- @After
- public void clearDynamicTables() {
- getSharedSession().executeNonSelectingSQL("DELETE FROM SIMPLE_TYPE_A");
- getSharedSession().executeNonSelectingSQL("DELETE FROM SIMPLE_TYPE_B");
- }
-
- @AfterClass
- public static void shutdown() {
- try {
- sharedSession.executeNonSelectingSQL("DROP TABLE SIMPLE_TYPE_A CASCADE CONSTRAINTS");
- sharedSession.executeNonSelectingSQL("DROP TABLE SIMPLE_TYPE_B CASCADE CONSTRAINTS");
- } catch (DatabaseException dbe) {
- // ignore
- }
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/AllTests.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/AllTests.java
deleted file mode 100644
index 1267cc2..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/AllTests.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.simple.sequencing;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { DefaultSequencing.class, TableSequencing.class, UnaryTableSequencing.class, NativeSequencing.class })
-public class AllTests {
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/BaseSequencingTest.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/BaseSequencingTest.java
deleted file mode 100644
index d328df7..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/BaseSequencingTest.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.simple.sequencing;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.exceptions.DatabaseException;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.IdentityMapAccessor;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.UnitOfWork;
-import org.eclipse.persistence.sessions.server.Server;
-import org.eclipse.persistence.testing.tests.dynamic.DynamicTestHelper;
-import org.eclipse.persistence.testing.tests.dynamic.EclipseLinkORMTest;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Test;
-
-public abstract class BaseSequencingTest extends EclipseLinkORMTest {
-
- public static final String TABLE_NAME = "SIMPLE_TABLE_SEQ";
-
- public static final String ENTITY_TYPE = "Simple";
-
- @Test
- public void verifyConfig() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
-
- ClassDescriptor descriptor = helper.getSession().getClassDescriptorForAlias(ENTITY_TYPE);
- assertNotNull("No descriptor found for alias: " + ENTITY_TYPE, descriptor);
-
- DynamicType simpleType = helper.getType(ENTITY_TYPE);
- assertNotNull("EntityType not found for alias: " + ENTITY_TYPE, simpleType);
-
- assertEquals(descriptor, simpleType.getDescriptor());
-
- assertTrue("Descriptor does not use sequencing", descriptor.usesSequenceNumbers());
- verifySequencingConfig(helper.getSession(), descriptor);
- }
-
- protected abstract void verifySequencingConfig(Session session, ClassDescriptor descriptor);
-
- @Test
- public void createSingleInstances() throws Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = acquireSession();
-
- DynamicEntity simpleInstance = createSimpleInstance(helper, session, 1);
-
- ReportQuery countQuery = helper.newReportQuery(ENTITY_TYPE, new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
-
- assertEquals(1, count(helper, session));
-
- IdentityMapAccessor cache = session.getIdentityMapAccessor();
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance));
- cache.initializeAllIdentityMaps();
-
- DynamicEntity findResult = find(helper, session, 1);
-
- assertNotNull(findResult);
- assertEquals(simpleInstance.get("id"), findResult.get("id"));
- assertEquals(simpleInstance.get("value1"), findResult.get("value1"));
-
- session.release();
- }
-
- @Test
- public void createTwoInstances() throws DatabaseException, Exception {
- DynamicHelper helper = new DynamicHelper(getSharedSession());
- Session session = acquireSession();
-
- DynamicEntity simpleInstance1 = createSimpleInstance(helper, session, 1);
- DynamicEntity simpleInstance2 = createSimpleInstance(helper, session, 2);
-
- ReportQuery countQuery = helper.newReportQuery(ENTITY_TYPE, new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
-
- assertEquals(2, count(helper, session));
-
- IdentityMapAccessor cache = session.getIdentityMapAccessor();
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance1));
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance2));
-
- cache.initializeAllIdentityMaps();
-
- DynamicEntity findResult1 = find(helper, session, 1);
- DynamicEntity findResult2 = find(helper, session, 2);
-
- assertNotNull(findResult1);
- assertNotNull(findResult2);
- assertEquals(simpleInstance1.get("id"), findResult1.get("id"));
- assertEquals(simpleInstance2.get("value1"), findResult2.get("value1"));
-
- session.release();
- }
-
- protected Session acquireSession() throws DatabaseException, Exception {
- if (getSharedSession().isServerSession()) {
- return ((Server) getSharedSession()).acquireClientSession();
- }
- return getSharedSession();
- }
-
- protected DynamicEntity find(DynamicHelper helper, Session session, int id) {
- ReadObjectQuery findQuery = helper.newReadObjectQuery(ENTITY_TYPE);
- findQuery.setSelectionCriteria(findQuery.getExpressionBuilder().get("id").equal(id));
- return (DynamicEntity) session.executeQuery(findQuery);
- }
-
- protected int count(DynamicHelper helper, Session session) {
- ReportQuery countQuery = helper.newReportQuery(ENTITY_TYPE, new ExpressionBuilder());
- countQuery.addCount();
- countQuery.setShouldReturnSingleValue(true);
-
- return ((Number) session.executeQuery(countQuery)).intValue();
- }
-
- protected DynamicEntity createSimpleInstance(DynamicHelper helper, Session session, int expectedId) {
- DynamicType simpleEntityType = helper.getType(ENTITY_TYPE);
- Assert.assertNotNull(simpleEntityType);
-
- DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity();
- simpleInstance.set("value1", TABLE_NAME);
-
- UnitOfWork uow = session.acquireUnitOfWork();
-
- assertEquals(0, simpleInstance.get("id"));
- uow.registerNewObject(simpleInstance);
- assertEquals(0, simpleInstance.get("id"));
-
- // uow.assignSequenceNumber(simpleInstance);
-
- uow.commit();
- assertEquals(expectedId, simpleInstance.get("id"));
-
- return simpleInstance;
- }
-
- @Override
- protected DatabaseSession createSharedSession() {
- if (sharedSession == null) {
- sharedSession = DynamicTestHelper.createEmptySession();
- sharedSession.login();
-
- DynamicHelper helper = new DynamicHelper(sharedSession);
- DynamicClassLoader dcl = DynamicClassLoader.lookup(getSharedSession());
-
- Class<?> dynamicType = dcl.createDynamicClass("model.sequencing." + ENTITY_TYPE);
- DynamicTypeBuilder typeBuilder = new DynamicTypeBuilder(dynamicType, null, TABLE_NAME);
- typeBuilder.setPrimaryKeyFields("SID");
- typeBuilder.addDirectMapping("id", int.class, "SID");
- typeBuilder.addDirectMapping("value1", String.class, "VAL_1");
-
- configureSequencing(sharedSession, typeBuilder);
-
- helper.addTypes(true, true, typeBuilder.getType());
- }
-
- return sharedSession;
- }
-
- protected abstract void configureSequencing(DatabaseSession session, DynamicTypeBuilder typeBuilder);
-
- @After
- public void clearSimpleTypeInstances() throws Exception {
- getSharedSession().executeNonSelectingSQL("DELETE FROM " + TABLE_NAME);
- resetSequence(getSharedSession());
- getSharedSession().getSequencingControl().initializePreallocated();
- }
-
- protected abstract void resetSequence(DatabaseSession session);
-
- @AfterClass
- public static void shutdown() {
- sharedSession.executeNonSelectingSQL("DROP TABLE " + TABLE_NAME + " CASCADE CONSTRAINTS");
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/DefaultSequencing.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/DefaultSequencing.java
deleted file mode 100644
index e96cc5c..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/DefaultSequencing.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.simple.sequencing;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.sequencing.TableSequence;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Session;
-import org.junit.AfterClass;
-
-public class DefaultSequencing extends BaseSequencingTest {
-
- @Override
- protected void configureSequencing(DatabaseSession session, DynamicTypeBuilder typeBuilder) {
- TableSequence defaultSequence = (TableSequence) session.getLogin().getDefaultSequence();
- defaultSequence.setTableName("TEST_SEQ");
- typeBuilder.configureSequencing(ENTITY_TYPE + "_SEQ", "SID");
- }
-
- @Override
- protected void verifySequencingConfig(Session session, ClassDescriptor descriptor) {
- // TODO Auto-generated method stub
- }
-
- @Override
- protected void resetSequence(DatabaseSession session) {
- session.executeNonSelectingSQL("UPDATE TEST_SEQ SET SEQ_COUNT = 0");
- }
-
- @AfterClass
- public static void shutdown() {
- sharedSession.executeNonSelectingSQL("DROP TABLE TEST_SEQ CASCADE CONSTRAINTS");
- BaseSequencingTest.shutdown();
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/NativeSequencing.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/NativeSequencing.java
deleted file mode 100644
index 37330fd..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/NativeSequencing.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.simple.sequencing;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.internal.sessions.AbstractSession;
-import org.eclipse.persistence.sequencing.NativeSequence;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Session;
-import org.junit.AfterClass;
-
-public class NativeSequencing extends BaseSequencingTest {
-
- @Override
- protected void configureSequencing(DatabaseSession session, DynamicTypeBuilder typeBuilder) {
- NativeSequence sequence = new NativeSequence();
- sequence.setPreallocationSize(5);
- ((AbstractSession) session).getProject().getLogin().setDefaultSequence(sequence);
- sequence.onConnect(session.getPlatform());
- typeBuilder.configureSequencing(sequence, ENTITY_TYPE + "_SEQ", "SID");
- }
-
- @Override
- protected void verifySequencingConfig(Session session, ClassDescriptor descriptor) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- protected void resetSequence(DatabaseSession session) {
- session.executeNonSelectingSQL("DROP SEQUENCE " + ENTITY_TYPE + "_SEQ");
- session.executeNonSelectingSQL("CREATE SEQUENCE " + ENTITY_TYPE + "_SEQ INCREMENT BY 5 START WITH 5");
- }
-
- @AfterClass
- public static void shutdown() {
- sharedSession.executeNonSelectingSQL("DROP SEQUENCE " + ENTITY_TYPE + "_SEQ");
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/TableSequencing.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/TableSequencing.java
deleted file mode 100644
index 17ce8dd..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/TableSequencing.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.simple.sequencing;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.internal.sessions.AbstractSession;
-import org.eclipse.persistence.sequencing.TableSequence;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Session;
-import org.junit.AfterClass;
-
-public class TableSequencing extends BaseSequencingTest {
-
- @Override
- protected void configureSequencing(DatabaseSession session, DynamicTypeBuilder typeBuilder) {
- TableSequence sequence = new TableSequence();
- sequence.setTableName("TEST_SEQ");
- sequence.setCounterFieldName("SEQ_VALUE");
- sequence.setNameFieldName("SEQ_NAME");
- sequence.setPreallocationSize(5);
- ((AbstractSession) session).getProject().getLogin().setDefaultSequence(sequence);
- sequence.onConnect(session.getPlatform());
- typeBuilder.configureSequencing(sequence, ENTITY_TYPE + "_SEQ", "SID");
- }
-
- @Override
- protected void verifySequencingConfig(Session session, ClassDescriptor descriptor) {
- // TODO Auto-generated method stub
- }
-
- protected void resetSequence(DatabaseSession session) {
- session.executeNonSelectingSQL("UPDATE TEST_SEQ SET SEQ_VALUE = 0");
- }
-
- @AfterClass
- public static void shutdown() {
- sharedSession.executeNonSelectingSQL("DROP TABLE TEST_SEQ CASCADE CONSTRAINTS");
- BaseSequencingTest.shutdown();
-
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/UnaryTableSequencing.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/UnaryTableSequencing.java
deleted file mode 100644
index 044f254..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/tests/dynamic/simple/sequencing/UnaryTableSequencing.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.testing.tests.dynamic.simple.sequencing;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.internal.sessions.AbstractSession;
-import org.eclipse.persistence.sequencing.UnaryTableSequence;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Session;
-import org.junit.AfterClass;
-
-public class UnaryTableSequencing extends BaseSequencingTest {
-
- @Override
- protected void configureSequencing(DatabaseSession session, DynamicTypeBuilder typeBuilder) {
- UnaryTableSequence sequence = new UnaryTableSequence("TEST_SEQ");
- sequence.setCounterFieldName("SEQ_VALUE");
- sequence.setPreallocationSize(5);
- ((AbstractSession) session).getProject().getLogin().setDefaultSequence(sequence);
- sequence.onConnect(session.getPlatform());
- typeBuilder.configureSequencing(sequence, "TEST_SEQ", "SID");
- }
-
- @Override
- protected void verifySequencingConfig(Session session, ClassDescriptor descriptor) {
- // TODO Auto-generated method stub
- }
-
- protected void resetSequence(DatabaseSession session) {
- session.executeNonSelectingSQL("UPDATE TEST_SEQ SET SEQ_VALUE = 0");
- }
-
- @AfterClass
- public static void shutdown() {
- sharedSession.executeNonSelectingSQL("DROP TABLE TEST_SEQ CASCADE CONSTRAINTS");
- BaseSequencingTest.shutdown();
-
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/util/QuerySQLTracker.java b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/util/QuerySQLTracker.java
deleted file mode 100644
index c8ec499..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/src/org/eclipse/persistence/testing/util/QuerySQLTracker.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- * - ported from earlier Oracle TopLink examples
- ******************************************************************************/
-package org.eclipse.persistence.testing.util;
-
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.persistence.internal.helper.Helper;
-import org.eclipse.persistence.logging.DefaultSessionLog;
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.logging.SessionLogEntry;
-import org.eclipse.persistence.queries.DatabaseQuery;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.SessionEvent;
-import org.eclipse.persistence.sessions.SessionEventAdapter;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.1.2
- */
-public class QuerySQLTracker extends SessionEventAdapter {
- private List<QueryResult> queries;
-
- /**
- * Constructs and installs the event listener and sql tracking session log
- *
- * @param session
- */
- private QuerySQLTracker(Session session) {
- session.getEventManager().addListener(this);
- session.setSessionLog(new SQLTrackingSessionLog(session, this));
- reset();
- }
-
- public static QuerySQLTracker install(Session session) {
- if (session.getSessionLog() instanceof SQLTrackingSessionLog) {
- return ((SQLTrackingSessionLog) session.getSessionLog())
- .getTracker();
- }
- return new QuerySQLTracker(session);
- }
-
- /**
- * Helper method to retrieve a tracker from a session where it was installed
- * If the session exists but does not have a tracler installed then an
- * exception is thrown.
- */
- public static QuerySQLTracker getTracker(Session session) {
- if (session == null) {
- return null;
- }
- SessionLog sessionLog = session.getSessionLog();
-
- if (sessionLog instanceof QuerySQLTracker.SQLTrackingSessionLog) {
- return ((QuerySQLTracker.SQLTrackingSessionLog) sessionLog)
- .getTracker();
- }
- throw new RuntimeException(
- "Could not retireve QuerySQLTracke from session: " + session);
- }
-
- /**
- * Reset the lists of SQL and queries being tracked
- */
- public void reset() {
- this.queries = new ArrayList<QueryResult>();
- }
-
- public List<QueryResult> getQueries() {
- return this.queries;
- }
-
- protected QuerySQLTracker.QueryResult getCurrentResult() {
- if (getQueries().size() == 0) {
- getQueries().add(new QueryResult(null));
- // throw new RuntimeException("Received SQL without a Query ???");
- }
- return getQueries().get(getQueries().size() - 1);
- }
-
- public int getTotalSQLCalls() {
- int totalSQLCalls = 0;
-
- for (QueryResult result : getQueries()) {
- totalSQLCalls += result.sqlStatements.size();
- }
-
- return totalSQLCalls;
- }
-
- public int getTotalSQLCalls(String startsWith) {
- int sqlCalls = 0;
-
- for (QueryResult result : getQueries()) {
- for (String sql : result.sqlStatements) {
- String sub = sql.substring(0, startsWith.length());
- if (sub.equalsIgnoreCase(startsWith)) {
- sqlCalls++;
- }
- }
- }
-
- return sqlCalls;
- }
-
- public int getTotalSQLSELECTCalls() {
- return getTotalSQLCalls("SELECT");
- }
-
- public int getTotalSQLINSERTCalls() {
- return getTotalSQLCalls("INSERT");
- }
-
- public int getTotalSQLUPDATECalls() {
- return getTotalSQLCalls("UPDATE");
- }
-
- public int getTotalSQLDELETECalls() {
- return getTotalSQLCalls("DELETE");
- }
-
- public void preExecuteQuery(SessionEvent event) {
- //System.err.println("*** QuerySQLTracker.preExecuteQuery(" + event.getQuery() + ")");
- //Thread.dumpStack();
- QueryResult result = new QueryResult(event.getQuery());
- getQueries().add(result);
- }
-
- public void postExecuteQuery(SessionEvent event) {
- if (getCurrentResult().query == null) {
- getCurrentResult().setQuery(event.getQuery());
- }
- getCurrentResult().setResult(event.getResult());
- }
-
- protected class QueryResult {
- private DatabaseQuery query;
- private String resultString = null;
- private List<String> sqlStatements = new ArrayList<String>();
-
- QueryResult(DatabaseQuery q) {
- query = q;
- }
-
- protected void setQuery(DatabaseQuery query) {
- this.query = query;
- }
-
- protected void setResult(Object queryResult) {
- StringWriter writer = new StringWriter();
- writer.write(Helper.getShortClassName(query));
- writer.write("[" + System.identityHashCode(query) + "]");
- writer.write(" result = ");
-
- Object result = queryResult;
- if (queryResult instanceof Collection) {
- result = ((Collection) queryResult).toArray();
- }
-
- if (result == null) {
- writer.write("NONE");
- } else {
- if (result instanceof Object[]) {
- Object[] results = (Object[]) result;
- writer.write("<" + results.length + "> [");
- for (int index = 0; index < results.length; index++) {
- if (index > 0) {
- writer.write(", ");
- }
- writer.write(results[index] + "");
- }
- writer.write("]");
- resultString = writer.toString();
- } else {
- writer.write(result.toString());
- }
- }
-
- this.resultString = writer.toString();
- }
-
- public void addSQL(String sql) {
- sqlStatements.add(sql);
- }
-
- public String toString() {
- if (this.resultString == null) {
- setResult(null);
- }
- return this.resultString;
- }
- }
-
- /**
- * This custom SessionLog implementation wraps the existing one and redirects
- * all SQL calls to the tracker. All messages are also passed to the original
- * tracker.
- */
- public class SQLTrackingSessionLog extends DefaultSessionLog {
-
- private QuerySQLTracker tracker;
-
- private SessionLog originalLog;
-
- protected SQLTrackingSessionLog(Session session,
- QuerySQLTracker aTracker) {
- this.tracker = aTracker;
- this.originalLog = session.getSessionLog();
- setSession(session);
- setWriter(this.originalLog.getWriter());
- }
-
- public QuerySQLTracker getTracker() {
- return this.tracker;
- }
-
- public synchronized void log(SessionLogEntry entry) {
-
- if (entry.getNameSpace() != null
- && entry.getNameSpace().equalsIgnoreCase(SessionLog.SQL)) {
- getTracker().getCurrentResult().addSQL(entry.getMessage());
- }
- super.log(entry);
- }
-
- @Override
- public int getLevel(String category) {
- return this.originalLog.getLevel(category);
- }
-
- @Override
- public void setLevel(int level, String category) {
- this.originalLog.setLevel(level, category);
- }
-
- @Override
- public int getLevel() {
- return this.originalLog.getLevel();
- }
-
- @Override
- public void setLevel(int level) {
- this.originalLog.setLevel(level);
- }
-
- @Override
- public boolean shouldPrintConnection() {
- return this.originalLog.shouldPrintConnection();
- }
-
- @Override
- public boolean shouldPrintDate() {
- return this.originalLog.shouldPrintDate();
- }
-
- @Override
- public boolean shouldPrintSession() {
- return this.originalLog.shouldPrintSession();
- }
-
- @Override
- public boolean shouldPrintThread() {
- return this.originalLog.shouldPrintThread();
- }
- }
-
- public void printResults(String prefix) {
- System.out.println(prefix + "-QuerySQLTracker-Queries:");
-
- int sql = 0;
- for (int index = 0; index < getQueries().size(); index++) {
- QueryResult result = getQueries().get(index);
-
- System.out.println("\t" + (index + 1) + "> " + result);
-
- for (int sqlNum = 0; sqlNum < result.sqlStatements.size(); sqlNum++) {
- sql++;
- System.out.println("\t\t" + (index + 1) + "." + (sqlNum + 1)
- + "-" + sql + "> " + result.sqlStatements.get(sqlNum));
- }
- }
-
- System.out.println(prefix + "-QuerySQLTracker-Queries: "
- + getQueries().size());
- System.out.println(prefix + "-QuerySQLTracker-INSERT: "
- + getTotalSQLINSERTCalls());
- System.out.println(prefix + "-QuerySQLTracker-SELECT: "
- + getTotalSQLSELECTCalls());
- System.out.println(prefix + "-QuerySQLTracker-UPDATE: "
- + getTotalSQLUPDATECalls());
- System.out.println(prefix + "-QuerySQLTracker-DELETE: "
- + getTotalSQLDELETECalls());
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/test.properties b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/test.properties
deleted file mode 100644
index af212cb..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/test.properties
+++ /dev/null
@@ -1,72 +0,0 @@
-# Testing environment properties.
-
-# Link to dependencies not in SVN, assumes default location, if you store elsewhere you need to edit these.
-oracle.extensions.depend.dir=../../../../../extension.oracle.lib.external
-# toplink.jar=../../../extension.oracle.lib.external/toplink.jar
-# toplink-essentials.jar=../../../extension.oracle.lib.external/toplink-essentials.jar
-# toplink-essentials-agent.jar=../../../extension.oracle.lib.external/toplink-essentials-agent.jar
-# hibernate.dir=../../../extension.hibernate.lib.external/
-# openjpa.dir=../../../extension.openjpa.lib.external/
-# Set your target database properties here or give it by -Dtest.properties=file option.
-
-#jdbc.driver.jar=../../../extension.oracle.lib.external/ojdbc5_11.jar
-#db.driver=oracle.jdbc.OracleDriver
-#db.url=jdbc:oracle:thin:@localhost:1521:orcl
-#db.user=scott
-#db.pwd=tiger
-#db.platform=org.eclipse.persistence.platform.database.OraclePlatform
-
-# jdbc.driver.jar=../../../extension.lib.external/mysql-connector-java-5.0.7-bin.jar
-# db.driver=com.mysql.jdbc.Driver
-# db.url=jdbc:mysql://localhost/mysql
-# db.user=user
-# db.pwd=password
-# db.platform=org.eclipse.persistence.platform.database.MySQLPlatform
-
-#jdbc.driver.jar=../../../extension.lib.external/mysql-connector-java-5.0.7-bin.jar
-#db.driver=com.mysql.jdbc.Driver
-#db.url=jdbc:mysql://tlsvrdb4.ca.oracle.com/COREDEV1
-#db.user=COREDEV1
-#db.pwd=password
-#db.platform=org.eclipse.persistence.platform.database.MySQLPlatform
-
-jdbc.driver.jar=../../../../../extension.oracle.lib.external/ojdbc5_11.jar
-db.driver=oracle.jdbc.OracleDriver
-db.url=jdbc:oracle:thin:@localhost:1521:ORCL
-db.user=scott
-db.pwd=tiger
-db.platform=org.eclipse.persistence.platform.database.oracle.Oracle11Platform
-
-# Logging option for debugging.
-logging.level=fine
-# logging.level=finest
-# logging.level=off
-
-# Weaving options, switch to ignore for no weaving
-test.agent=-javaagent:${eclipselink.jar.run}
-# test.agent=-Dignore
-test.weaving=-Dignore
-# test.weaving=-DTEST_NO_WEAVING=true
-
-# Test class to be run.
-test.class=org.eclipse.persistence.testing.tests.jpa.FullRegressionTestSuite
-# test.class=org.eclipse.persistence.testing.tests.jpa.advanced.EntityManagerJUnitTestSuite
-# test.class=org.eclipse.persistence.testing.tests.jpa.AllCMP3TestRunModel
-
-# Test runner properties.
-run.dir=run
-report.dir=report
-# This is relative to the run directory.
-eclipselink.jar.run=../../../eclipselink.jar
-
-# Server properties
-# Valid values of server.name are weblogic, oc4j, ...
-server.name=weblogic
-
-# A property specifying if PromptTestRunner should save the test results to the database
-should.save.results=false
-
-# The baseline version that the performance tests will compare this version with.
-# By default, it is the version that the last success runs were against.
-# To this version as a baseline, you can specify a non-existing baseline version and run the performance tests.
-# performance.baseline.version=1.0_:SNAPSHOT_-_20080402
\ No newline at end of file
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/classes/model.Issue.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/classes/model.Issue.xml
deleted file mode 100644
index c3df8bd..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/classes/model.Issue.xml
+++ /dev/null
@@ -1,203 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>model.Issue</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <attributes>
- <class-attribute>
- <name>comments</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- <get-method-handle>
- <method-declaring-type-name>model.Issue</method-declaring-type-name>
- <method-signature>getComments()</method-signature>
- </get-method-handle>
- <set-method-handle>
- <method-declaring-type-name>model.Issue</method-declaring-type-name>
- <method-signature>setComments(java.lang.String)</method-signature>
- </set-method-handle>
- </class-attribute>
- <class-attribute>
- <name>condition</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- <get-method-handle>
- <method-declaring-type-name>model.Issue</method-declaring-type-name>
- <method-signature>getCondition()</method-signature>
- </get-method-handle>
- <set-method-handle>
- <method-declaring-type-name>model.Issue</method-declaring-type-name>
- <method-signature>setCondition(java.lang.String)</method-signature>
- </set-method-handle>
- </class-attribute>
- <class-attribute>
- <name>copies</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>id</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- <get-method-handle>
- <method-declaring-type-name>model.Issue</method-declaring-type-name>
- <method-signature>getId()</method-signature>
- </get-method-handle>
- <set-method-handle>
- <method-declaring-type-name>model.Issue</method-declaring-type-name>
- <method-signature>setId(int)</method-signature>
- </set-method-handle>
- </class-attribute>
- <class-attribute>
- <name>number</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>title</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>org.eclipse.persistence.indirection.ValueHolderInterface</type-name>
- </type-handle>
- </type-declaration>
- <value-type-handle>
- <type-name>model.Title</type-name>
- </value-type-handle>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>Issue</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- <method>
- <name>getComments</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- <accessed-attribute-handle>
- <attribute-declaring-type-name>model.Issue</attribute-declaring-type-name>
- <attribute-name>comments</attribute-name>
- </accessed-attribute-handle>
- </method>
- <method>
- <name>getCondition</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- <accessed-attribute-handle>
- <attribute-declaring-type-name>model.Issue</attribute-declaring-type-name>
- <attribute-name>condition</attribute-name>
- </accessed-attribute-handle>
- </method>
- <method>
- <name>getId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </return-type-declaration>
- <accessed-attribute-handle>
- <attribute-declaring-type-name>model.Issue</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </accessed-attribute-handle>
- </method>
- <method>
- <name>setComments</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- <accessed-attribute-handle>
- <attribute-declaring-type-name>model.Issue</attribute-declaring-type-name>
- <attribute-name>comments</attribute-name>
- </accessed-attribute-handle>
- </method>
- <method>
- <name>setCondition</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- <accessed-attribute-handle>
- <attribute-declaring-type-name>model.Issue</attribute-declaring-type-name>
- <attribute-name>condition</attribute-name>
- </accessed-attribute-handle>
- </method>
- <method>
- <name>setId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- <accessed-attribute-handle>
- <attribute-declaring-type-name>model.Issue</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </accessed-attribute-handle>
- </method>
- </methods>
-</class>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/classes/model.Publisher.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/classes/model.Publisher.xml
deleted file mode 100644
index 1423fea..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/classes/model.Publisher.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>model.Publisher</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <attributes>
- <class-attribute>
- <name>id</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- <get-method-handle>
- <method-declaring-type-name>model.Publisher</method-declaring-type-name>
- <method-signature>getId()</method-signature>
- </get-method-handle>
- <set-method-handle>
- <method-declaring-type-name>model.Publisher</method-declaring-type-name>
- <method-signature>setId(int)</method-signature>
- </set-method-handle>
- </class-attribute>
- <class-attribute>
- <name>name</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- <get-method-handle>
- <method-declaring-type-name>model.Publisher</method-declaring-type-name>
- <method-signature>getName()</method-signature>
- </get-method-handle>
- <set-method-handle>
- <method-declaring-type-name>model.Publisher</method-declaring-type-name>
- <method-signature>setName(java.lang.String)</method-signature>
- </set-method-handle>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>Publisher</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- <method>
- <name>getId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </return-type-declaration>
- <accessed-attribute-handle>
- <attribute-declaring-type-name>model.Publisher</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </accessed-attribute-handle>
- </method>
- <method>
- <name>getName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </return-type-declaration>
- <accessed-attribute-handle>
- <attribute-declaring-type-name>model.Publisher</attribute-declaring-type-name>
- <attribute-name>name</attribute-name>
- </accessed-attribute-handle>
- </method>
- <method>
- <name>setId</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- <accessed-attribute-handle>
- <attribute-declaring-type-name>model.Publisher</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </accessed-attribute-handle>
- </method>
- <method>
- <name>setName</name>
- <modifier>1</modifier>
- <return-type-declaration>
- <type-handle>
- <type-name>void</type-name>
- </type-handle>
- </return-type-declaration>
- <method-parameters>
- <method-parameter>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </method-parameter>
- </method-parameters>
- <accessed-attribute-handle>
- <attribute-declaring-type-name>model.Publisher</attribute-declaring-type-name>
- <attribute-name>name</attribute-name>
- </accessed-attribute-handle>
- </method>
- </methods>
-</class>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/classes/model.Title.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/classes/model.Title.xml
deleted file mode 100644
index 53fed8e..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/classes/model.Title.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>model.Title</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <attributes>
- <class-attribute>
- <name>format</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>com.sun.org.apache.xpath.internal.operations.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>id</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>name</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>publisher</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>model.Publisher</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>Title</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- </methods>
-</class>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/comics.mwp b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/comics.mwp
deleted file mode 100644
index 90d6e3a..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/comics.mwp
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project type="relational">
- <name>comics</name>
- <product-version>1.0.2</product-version>
- <schema-version>7.0</schema-version>
- <class-repository>
- <user-type-names>
- <name>model.Issue</name>
- <name>model.Publisher</name>
- <name>model.Title</name>
- </user-type-names>
- </class-repository>
- <descriptor-names>
- <descriptor-name>model.Issue</descriptor-name>
- <descriptor-name>model.Publisher</descriptor-name>
- <descriptor-name>model.Title</descriptor-name>
- </descriptor-names>
- <defaults-policy type="relational">
- <use-method-accessing>false</use-method-accessing>
- <caching-policy>
- <cache-expiry/>
- </caching-policy>
- <cache-all-statements>false</cache-all-statements>
- <bind-all-parameters>true</bind-all-parameters>
- </defaults-policy>
- <deployment-xml-file>../../src/META-INF/dynamic-comics-map.xml</deployment-xml-file>
- <table-repository>
- <platform-name>Derby</platform-name>
- <login-infos>
- <login-info>
- <name>dev</name>
- <driver-class>org.apache.derby.jdbc.ClientDriver</driver-class>
- <url>jdbc:derby://localhost:1527/dynamic-comics;create=true</url>
- <user-name>app</user-name>
- <password>6C8656CCFAFC3835FE6EA99641C9C127</password>
- <save-password>true</save-password>
- </login-info>
- </login-infos>
- <deployment-login-spec-handle>
- <login-spec-name>dev</login-spec-name>
- </deployment-login-spec-handle>
- <development-login-spec-handle>
- <login-spec-name>dev</login-spec-name>
- </development-login-spec-handle>
- <table-names>
- <name>ISSUE</name>
- <name>PUBLISHER</name>
- <name>TITLE</name>
- </table-names>
- </table-repository>
- <sequencing>
- <preallocation-size>50</preallocation-size>
- </sequencing>
- <table-generation>
- <default-primary-key-name>ID</default-primary-key-name>
- <primary-key-search-pattern>*ID</primary-key-search-pattern>
- </table-generation>
-</project>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/descriptors/model.Issue.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/descriptors/model.Issue.xml
deleted file mode 100644
index 3ed29cd..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/descriptors/model.Issue.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<descriptor type="relational">
- <name>model.Issue</name>
- <class-handle>
- <type-name>model.Issue</type-name>
- </class-handle>
- <transactional-policy type="relational">
- <descriptor-alias>Issue</descriptor-alias>
- <refresh-cache-policy/>
- <caching-policy/>
- <query-manager type="relational"/>
- <locking-policy type="relational"/>
- <primary-key-policy>
- <primary-key-handles>
- <column-handle>
- <column-table-name>ISSUE</column-table-name>
- <column-name>ID</column-name>
- </column-handle>
- </primary-key-handles>
- </primary-key-policy>
- </transactional-policy>
- <mappings>
- <mapping type="direct-to-field">
- <name>comments</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Issue</attribute-declaring-type-name>
- <attribute-name>comments</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>ISSUE</column-table-name>
- <column-name>COMMENTS</column-name>
- </column-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>condition</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Issue</attribute-declaring-type-name>
- <attribute-name>condition</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>ISSUE</column-table-name>
- <column-name>CONDITION</column-name>
- </column-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>copies</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Issue</attribute-declaring-type-name>
- <attribute-name>copies</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>ISSUE</column-table-name>
- <column-name>COPIES</column-name>
- </column-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>id</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Issue</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>ISSUE</column-table-name>
- <column-name>ID</column-name>
- </column-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>number</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Issue</attribute-declaring-type-name>
- <attribute-name>number</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>ISSUE</column-table-name>
- <column-name>NUM</column-name>
- </column-handle>
- </mapping>
- <mapping type="one-to-one">
- <name>title</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Issue</attribute-declaring-type-name>
- <attribute-name>title</attribute-name>
- </attribute-handle>
- <reference-descriptor-handle>
- <descriptor-name>model.Title</descriptor-name>
- </reference-descriptor-handle>
- <indirection-type>value-holder-indirection</indirection-type>
- <reference-handle>
- <reference-table-name>ISSUE</reference-table-name>
- <reference-name>ISSUE_TITLE</reference-name>
- </reference-handle>
- </mapping>
- </mappings>
- <primary-table-handle>
- <table-name>ISSUE</table-name>
- </primary-table-handle>
-</descriptor>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/descriptors/model.Publisher.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/descriptors/model.Publisher.xml
deleted file mode 100644
index f72d710..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/descriptors/model.Publisher.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<descriptor type="relational">
- <name>model.Publisher</name>
- <class-handle>
- <type-name>model.Publisher</type-name>
- </class-handle>
- <transactional-policy type="relational">
- <descriptor-alias>Publisher</descriptor-alias>
- <refresh-cache-policy/>
- <caching-policy/>
- <query-manager type="relational"/>
- <locking-policy type="relational"/>
- <primary-key-policy>
- <primary-key-handles>
- <column-handle>
- <column-table-name>PUBLISHER</column-table-name>
- <column-name>ID</column-name>
- </column-handle>
- </primary-key-handles>
- </primary-key-policy>
- </transactional-policy>
- <mappings>
- <mapping type="direct-to-field">
- <name>id</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Publisher</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>PUBLISHER</column-table-name>
- <column-name>ID</column-name>
- </column-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>name</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Publisher</attribute-declaring-type-name>
- <attribute-name>name</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>PUBLISHER</column-table-name>
- <column-name>NAME</column-name>
- </column-handle>
- </mapping>
- </mappings>
- <primary-table-handle>
- <table-name>PUBLISHER</table-name>
- </primary-table-handle>
-</descriptor>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/descriptors/model.Title.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/descriptors/model.Title.xml
deleted file mode 100644
index 1d593b4..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/descriptors/model.Title.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<descriptor type="relational">
- <name>model.Title</name>
- <class-handle>
- <type-name>model.Title</type-name>
- </class-handle>
- <transactional-policy type="relational">
- <descriptor-alias>Title</descriptor-alias>
- <refresh-cache-policy/>
- <caching-policy/>
- <query-manager type="relational"/>
- <locking-policy type="relational"/>
- <primary-key-policy>
- <primary-key-handles>
- <column-handle>
- <column-table-name>TITLE</column-table-name>
- <column-name>ID</column-name>
- </column-handle>
- </primary-key-handles>
- </primary-key-policy>
- </transactional-policy>
- <mappings>
- <mapping type="direct-to-field">
- <name>format</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Title</attribute-declaring-type-name>
- <attribute-name>format</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>TITLE</column-table-name>
- <column-name>FORMAT</column-name>
- </column-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>id</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Title</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>TITLE</column-table-name>
- <column-name>ID</column-name>
- </column-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>name</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Title</attribute-declaring-type-name>
- <attribute-name>name</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>TITLE</column-table-name>
- <column-name>NAME</column-name>
- </column-handle>
- </mapping>
- <mapping type="one-to-one">
- <name>publisher</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.Title</attribute-declaring-type-name>
- <attribute-name>publisher</attribute-name>
- </attribute-handle>
- <reference-descriptor-handle>
- <descriptor-name>model.Publisher</descriptor-name>
- </reference-descriptor-handle>
- <reference-handle>
- <reference-table-name>TITLE</reference-table-name>
- <reference-name>TITLE_PUBLISHER</reference-name>
- </reference-handle>
- </mapping>
- </mappings>
- <primary-table-handle>
- <table-name>TITLE</table-name>
- </primary-table-handle>
-</descriptor>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/tables/ISSUE.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/tables/ISSUE.xml
deleted file mode 100644
index 9b81010..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/tables/ISSUE.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<table>
- <short-name>ISSUE</short-name>
- <columns>
- <column>
- <name>COMMENTS</name>
- <type>VARCHAR</type>
- <size>200</size>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>CONDITION</name>
- <type>VARCHAR</type>
- <size>20</size>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>COPIES</name>
- <type>SMALLINT</type>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>ID</name>
- <type>INTEGER</type>
- <unique>true</unique>
- <primary-key>true</primary-key>
- </column>
- <column>
- <name>NUM</name>
- <type>SMALLINT</type>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>PAID</name>
- <type>DOUBLE</type>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>TTITLE_ID</name>
- <type>INTEGER</type>
- </column>
- <column>
- <name>VALUE</name>
- <type>DOUBLE</type>
- </column>
- </columns>
- <references>
- <table-association>
- <name>ISSUE_TITLE</name>
- <target-table-handle>
- <table-name>TITLE</table-name>
- </target-table-handle>
- <on-database>true</on-database>
- <column-pairs>
- <column-pair>
- <source-column-handle>
- <column-table-name>ISSUE</column-table-name>
- <column-name>TTITLE_ID</column-name>
- </source-column-handle>
- <target-column-handle>
- <column-table-name>TITLE</column-table-name>
- <column-name>ID</column-name>
- </target-column-handle>
- </column-pair>
- </column-pairs>
- </table-association>
- </references>
-</table>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/tables/PUBLISHER.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/tables/PUBLISHER.xml
deleted file mode 100644
index d51725f..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/tables/PUBLISHER.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<table>
- <short-name>PUBLISHER</short-name>
- <columns>
- <column>
- <name>ID</name>
- <type>INTEGER</type>
- <unique>true</unique>
- <primary-key>true</primary-key>
- </column>
- <column>
- <name>NAME</name>
- <type>VARCHAR</type>
- <size>20</size>
- <allows-null>true</allows-null>
- </column>
- </columns>
-</table>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/tables/TITLE.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/tables/TITLE.xml
deleted file mode 100644
index 493f954..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/comics/tables/TITLE.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<table>
- <short-name>TITLE</short-name>
- <columns>
- <column>
- <name>FORMAT</name>
- <type>VARCHAR</type>
- <size>100</size>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>ID</name>
- <type>INTEGER</type>
- <unique>true</unique>
- <primary-key>true</primary-key>
- </column>
- <column>
- <name>NAME</name>
- <type>VARCHAR</type>
- <size>40</size>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>PUB_ID</name>
- <type>INTEGER</type>
- </column>
- </columns>
- <references>
- <table-association>
- <name>TITLE_PUBLISHER</name>
- <target-table-handle>
- <table-name>PUBLISHER</table-name>
- </target-table-handle>
- <on-database>true</on-database>
- <column-pairs>
- <column-pair>
- <source-column-handle>
- <column-table-name>TITLE</column-table-name>
- <column-name>PUB_ID</column-name>
- </source-column-handle>
- <target-column-handle>
- <column-table-name>PUBLISHER</column-table-name>
- <column-name>ID</column-name>
- </target-column-handle>
- </column-pair>
- </column-pairs>
- </table-association>
- </references>
-</table>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/classes/model.dynamic.employee.Address.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/classes/model.dynamic.employee.Address.xml
deleted file mode 100644
index f6c16c6..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/classes/model.dynamic.employee.Address.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>model.dynamic.employee.Address</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <attributes>
- <class-attribute>
- <name>city</name>
- <modifier>1</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.Object</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>country</name>
- <modifier>1</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.Object</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>id</name>
- <modifier>1</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.Object</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>postalCode</name>
- <modifier>1</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.Object</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>street</name>
- <modifier>1</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.Object</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>Address</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- </methods>
-</class>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/classes/model.dynamic.employee.Employee.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/classes/model.dynamic.employee.Employee.xml
deleted file mode 100644
index 43c867c..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/classes/model.dynamic.employee.Employee.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>model.dynamic.employee.Employee</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <attributes>
- <class-attribute>
- <name>address</name>
- <modifier>1</modifier>
- <type-declaration>
- <type-handle>
- <type-name>org.eclipse.persistence.indirection.ValueHolderInterface</type-name>
- </type-handle>
- </type-declaration>
- <value-type-handle>
- <type-name>model.dynamic.employee.Address</type-name>
- </value-type-handle>
- </class-attribute>
- <class-attribute>
- <name>firstName</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>id</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>lastName</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.String</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>period</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>model.dynamic.employee.EmploymentPeriod</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>salary</name>
- <modifier>2</modifier>
- <type-declaration>
- <type-handle>
- <type-name>int</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>Employee</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- </methods>
-</class>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/classes/model.dynamic.employee.EmploymentPeriod.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/classes/model.dynamic.employee.EmploymentPeriod.xml
deleted file mode 100644
index eab0aa5..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/classes/model.dynamic.employee.EmploymentPeriod.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<class>
- <name>model.dynamic.employee.EmploymentPeriod</name>
- <modifier>1</modifier>
- <superclass-handle>
- <type-name>java.lang.Object</type-name>
- </superclass-handle>
- <attributes>
- <class-attribute>
- <name>endDate</name>
- <modifier>1</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.Object</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- <class-attribute>
- <name>startDate</name>
- <modifier>1</modifier>
- <type-declaration>
- <type-handle>
- <type-name>java.lang.Object</type-name>
- </type-handle>
- </type-declaration>
- </class-attribute>
- </attributes>
- <methods>
- <method>
- <name>EmploymentPeriod</name>
- <constructor>true</constructor>
- <modifier>1</modifier>
- </method>
- </methods>
-</class>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/descriptors/model.dynamic.employee.Address.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/descriptors/model.dynamic.employee.Address.xml
deleted file mode 100644
index 2e34dd3..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/descriptors/model.dynamic.employee.Address.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<descriptor type="relational">
- <name>model.dynamic.employee.Address</name>
- <class-handle>
- <type-name>model.dynamic.employee.Address</type-name>
- </class-handle>
- <transactional-policy type="relational">
- <descriptor-alias>Address</descriptor-alias>
- <refresh-cache-policy/>
- <caching-policy/>
- <query-manager type="relational"/>
- <locking-policy type="relational"/>
- <primary-key-policy>
- <primary-key-handles>
- <column-handle>
- <column-table-name>DX_ADDRESS</column-table-name>
- <column-name>ADDR_ID</column-name>
- </column-handle>
- </primary-key-handles>
- </primary-key-policy>
- </transactional-policy>
- <mappings>
- <mapping type="direct-to-field">
- <name>city</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.dynamic.employee.Address</attribute-declaring-type-name>
- <attribute-name>city</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>DX_ADDRESS</column-table-name>
- <column-name>CITY</column-name>
- </column-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>country</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.dynamic.employee.Address</attribute-declaring-type-name>
- <attribute-name>country</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>DX_ADDRESS</column-table-name>
- <column-name>COUNTRY</column-name>
- </column-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>id</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.dynamic.employee.Address</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>DX_ADDRESS</column-table-name>
- <column-name>ADDR_ID</column-name>
- </column-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>postalCode</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.dynamic.employee.Address</attribute-declaring-type-name>
- <attribute-name>postalCode</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>DX_ADDRESS</column-table-name>
- <column-name>PCODE</column-name>
- </column-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>street</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.dynamic.employee.Address</attribute-declaring-type-name>
- <attribute-name>street</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>DX_ADDRESS</column-table-name>
- <column-name>STREET</column-name>
- </column-handle>
- </mapping>
- </mappings>
- <primary-table-handle>
- <table-name>DX_ADDRESS</table-name>
- </primary-table-handle>
- <uses-sequencing>true</uses-sequencing>
- <sequence-number-name>DX_ADDR_SEQ</sequence-number-name>
- <sequence-number-table-handle>
- <table-name>DX_ADDRESS</table-name>
- </sequence-number-table-handle>
- <sequence-number-column-handle>
- <column-table-name>DX_ADDRESS</column-table-name>
- <column-name>ADDR_ID</column-name>
- </sequence-number-column-handle>
-</descriptor>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/descriptors/model.dynamic.employee.Employee.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/descriptors/model.dynamic.employee.Employee.xml
deleted file mode 100644
index ed1c4cc..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/descriptors/model.dynamic.employee.Employee.xml
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<descriptor type="relational">
- <name>model.dynamic.employee.Employee</name>
- <class-handle>
- <type-name>model.dynamic.employee.Employee</type-name>
- </class-handle>
- <transactional-policy type="relational">
- <descriptor-alias>Employee</descriptor-alias>
- <refresh-cache-policy/>
- <caching-policy/>
- <query-manager type="relational"/>
- <locking-policy type="relational"/>
- <primary-key-policy>
- <primary-key-handles>
- <column-handle>
- <column-table-name>DX_EMPLOYEE</column-table-name>
- <column-name>EMP_ID</column-name>
- </column-handle>
- </primary-key-handles>
- </primary-key-policy>
- </transactional-policy>
- <mappings>
- <mapping type="one-to-one">
- <name>address</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.dynamic.employee.Employee</attribute-declaring-type-name>
- <attribute-name>address</attribute-name>
- </attribute-handle>
- <reference-descriptor-handle>
- <descriptor-name>model.dynamic.employee.Address</descriptor-name>
- </reference-descriptor-handle>
- <indirection-type>value-holder-indirection</indirection-type>
- <reference-handle>
- <reference-table-name>DX_EMPLOYEE</reference-table-name>
- <reference-name>DX_EMPLOYEE_DX_ADDRESS</reference-name>
- </reference-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>firstName</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.dynamic.employee.Employee</attribute-declaring-type-name>
- <attribute-name>firstName</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>DX_EMPLOYEE</column-table-name>
- <column-name>F_NAME</column-name>
- </column-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>id</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.dynamic.employee.Employee</attribute-declaring-type-name>
- <attribute-name>id</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>DX_EMPLOYEE</column-table-name>
- <column-name>EMP_ID</column-name>
- </column-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>lastName</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.dynamic.employee.Employee</attribute-declaring-type-name>
- <attribute-name>lastName</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>DX_EMPLOYEE</column-table-name>
- <column-name>L_NAME</column-name>
- </column-handle>
- </mapping>
- <mapping type="aggregate">
- <name>period</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.dynamic.employee.Employee</attribute-declaring-type-name>
- <attribute-name>period</attribute-name>
- </attribute-handle>
- <reference-descriptor-handle>
- <descriptor-name>model.dynamic.employee.EmploymentPeriod</descriptor-name>
- </reference-descriptor-handle>
- <paths-to-fields>
- <aggregate-path-to-field>
- <field-description>DIRECT</field-description>
- <column-handle>
- <column-table-name>DX_EMPLOYEE</column-table-name>
- <column-name>END_DATE</column-name>
- </column-handle>
- <mapping-handles>
- <mapping-handle>
- <mapping-descriptor-name>model.dynamic.employee.EmploymentPeriod</mapping-descriptor-name>
- <mapping-name>endDate</mapping-name>
- </mapping-handle>
- </mapping-handles>
- </aggregate-path-to-field>
- <aggregate-path-to-field>
- <field-description>DIRECT</field-description>
- <column-handle>
- <column-table-name>DX_EMPLOYEE</column-table-name>
- <column-name>START_DATE</column-name>
- </column-handle>
- <mapping-handles>
- <mapping-handle>
- <mapping-descriptor-name>model.dynamic.employee.EmploymentPeriod</mapping-descriptor-name>
- <mapping-name>startDate</mapping-name>
- </mapping-handle>
- </mapping-handles>
- </aggregate-path-to-field>
- </paths-to-fields>
- </mapping>
- <mapping type="direct-to-field">
- <name>salary</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.dynamic.employee.Employee</attribute-declaring-type-name>
- <attribute-name>salary</attribute-name>
- </attribute-handle>
- <column-handle>
- <column-table-name>DX_SALARY</column-table-name>
- <column-name>SALARY</column-name>
- </column-handle>
- </mapping>
- </mappings>
- <primary-table-handle>
- <table-name>DX_EMPLOYEE</table-name>
- </primary-table-handle>
- <uses-sequencing>true</uses-sequencing>
- <sequence-number-name>DX_EMP_SEQ</sequence-number-name>
- <sequence-number-table-handle>
- <table-name>DX_EMPLOYEE</table-name>
- </sequence-number-table-handle>
- <sequence-number-column-handle>
- <column-table-name>DX_EMPLOYEE</column-table-name>
- <column-name>EMP_ID</column-name>
- </sequence-number-column-handle>
- <multi-table-info-policy>
- <secondary-table-holders>
- <table-holder>
- <table-handle>
- <table-name>DX_SALARY</table-name>
- </table-handle>
- <primary-keys-have-same-name>true</primary-keys-have-same-name>
- </table-holder>
- </secondary-table-holders>
- </multi-table-info-policy>
-</descriptor>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/descriptors/model.dynamic.employee.EmploymentPeriod.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/descriptors/model.dynamic.employee.EmploymentPeriod.xml
deleted file mode 100644
index 1d6ec9e..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/descriptors/model.dynamic.employee.EmploymentPeriod.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<descriptor type="aggregate">
- <name>model.dynamic.employee.EmploymentPeriod</name>
- <class-handle>
- <type-name>model.dynamic.employee.EmploymentPeriod</type-name>
- </class-handle>
- <mappings>
- <mapping type="direct-to-field">
- <name>endDate</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.dynamic.employee.EmploymentPeriod</attribute-declaring-type-name>
- <attribute-name>endDate</attribute-name>
- </attribute-handle>
- </mapping>
- <mapping type="direct-to-field">
- <name>startDate</name>
- <attribute-handle>
- <attribute-declaring-type-name>model.dynamic.employee.EmploymentPeriod</attribute-declaring-type-name>
- <attribute-name>startDate</attribute-name>
- </attribute-handle>
- </mapping>
- </mappings>
-</descriptor>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/employee.mwp b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/employee.mwp
deleted file mode 100644
index 744ab20..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/employee.mwp
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project type="relational">
- <name>employee</name>
- <product-version>1.1.2</product-version>
- <schema-version>7.0</schema-version>
- <class-repository>
- <user-type-names>
- <name>model.dynamic.employee.Address</name>
- <name>model.dynamic.employee.Employee</name>
- <name>model.dynamic.employee.EmploymentPeriod</name>
- </user-type-names>
- </class-repository>
- <descriptor-names>
- <descriptor-name>model.dynamic.employee.Address</descriptor-name>
- <descriptor-name>model.dynamic.employee.Employee</descriptor-name>
- <descriptor-name>model.dynamic.employee.EmploymentPeriod</descriptor-name>
- </descriptor-names>
- <defaults-policy type="relational">
- <use-method-accessing>false</use-method-accessing>
- <caching-policy>
- <cache-expiry/>
- </caching-policy>
- <cache-all-statements>false</cache-all-statements>
- <bind-all-parameters>true</bind-all-parameters>
- </defaults-policy>
- <deployment-xml-file>../../src/org/eclipse/persistence/testing/tests/dynamic/orm/projectxml/employee-project.xml</deployment-xml-file>
- <table-repository>
- <platform-name>Oracle</platform-name>
- <table-names>
- <name>DX_ADDRESS</name>
- <name>DX_EMPLOYEE</name>
- <name>DX_SALARY</name>
- </table-names>
- </table-repository>
- <sequencing>
- <preallocation-size>50</preallocation-size>
- </sequencing>
- <table-generation>
- <default-primary-key-name>ID</default-primary-key-name>
- <primary-key-search-pattern>*ID</primary-key-search-pattern>
- </table-generation>
-</project>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/tables/DX_ADDRESS.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/tables/DX_ADDRESS.xml
deleted file mode 100644
index fd49277..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/tables/DX_ADDRESS.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<table>
- <short-name>DX_ADDRESS</short-name>
- <columns>
- <column>
- <name>ADDR_ID</name>
- <type>NUMBER</type>
- <size>20</size>
- <unique>true</unique>
- <primary-key>true</primary-key>
- </column>
- <column>
- <name>CITY</name>
- <type>VARCHAR2</type>
- <size>20</size>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>COUNTRY</name>
- <type>VARCHAR2</type>
- <size>20</size>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>PCODE</name>
- <type>VARCHAR2</type>
- <size>20</size>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>STREET</name>
- <type>VARCHAR2</type>
- <size>20</size>
- <allows-null>true</allows-null>
- </column>
- </columns>
-</table>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/tables/DX_EMPLOYEE.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/tables/DX_EMPLOYEE.xml
deleted file mode 100644
index 1b7fa9d..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/tables/DX_EMPLOYEE.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<table>
- <short-name>DX_EMPLOYEE</short-name>
- <columns>
- <column>
- <name>ADDR_FK</name>
- <type>VARCHAR2</type>
- <size>20</size>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>EMP_ID</name>
- <type>NUMBER</type>
- <size>10</size>
- <unique>true</unique>
- <primary-key>true</primary-key>
- </column>
- <column>
- <name>END_DATE</name>
- <type>DATE</type>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>F_NAME</name>
- <type>VARCHAR2</type>
- <size>20</size>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>L_NAME</name>
- <type>VARCHAR2</type>
- <size>20</size>
- <allows-null>true</allows-null>
- </column>
- <column>
- <name>START_DATE</name>
- <type>DATE</type>
- <allows-null>true</allows-null>
- </column>
- </columns>
- <references>
- <table-association>
- <name>DX_EMPLOYEE_DX_ADDRESS</name>
- <target-table-handle>
- <table-name>DX_ADDRESS</table-name>
- </target-table-handle>
- <on-database>true</on-database>
- <column-pairs>
- <column-pair>
- <source-column-handle>
- <column-table-name>DX_EMPLOYEE</column-table-name>
- <column-name>ADDR_FK</column-name>
- </source-column-handle>
- <target-column-handle>
- <column-table-name>DX_ADDRESS</column-table-name>
- <column-name>ADDR_ID</column-name>
- </target-column-handle>
- </column-pair>
- </column-pairs>
- </table-association>
- </references>
-</table>
diff --git a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/tables/DX_SALARY.xml b/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/tables/DX_SALARY.xml
deleted file mode 100644
index 5725de6..0000000
--- a/dynamic/branches/1.1.0/eclipselink.core.test.dynamic/workbench/employee/tables/DX_SALARY.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<table>
- <short-name>DX_SALARY</short-name>
- <columns>
- <column>
- <name>EMP_ID</name>
- <type>NUMBER</type>
- <size>20</size>
- <unique>true</unique>
- <primary-key>true</primary-key>
- </column>
- <column>
- <name>SALARY</name>
- <type>NUMBER</type>
- <allows-null>true</allows-null>
- </column>
- </columns>
-</table>
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/.classpath b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/.classpath
deleted file mode 100644
index 9ef286c..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/.classpath
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
- <classpathentry kind="var" path="ORACLE_JDBC_LIB"/>
- <classpathentry combineaccessrules="false" kind="src" path="/javax.persistence 1.99"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.asm"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.core"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.oracle"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.jpa"/>
- <classpathentry combineaccessrules="false" kind="src" path="/eclipselink.core.test.dynamic"/>
- <classpathentry excluding="**/.svn/**" kind="src" path="src"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/.project b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/.project
deleted file mode 100644
index 53da15b..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>eclipselink.jpa.test.dynamic</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/.settings/org.eclipse.jdt.core.prefs b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index ab1d3f1..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,74 +0,0 @@
-#Tue Aug 11 13:46:58 EDT 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/META-INF/persistence.xml b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/META-INF/persistence.xml
deleted file mode 100644
index ffb90d3..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/META-INF/persistence.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence version="1.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_1_0.xsd">
- <persistence-unit name="empty" transaction-type="RESOURCE_LOCAL">
- <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
- <exclude-unlisted-classes>true</exclude-unlisted-classes>
- <properties>
- <property name="eclipselink.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:orcl"/>
- <property name="eclipselink.jdbc.user" value="scott"/>
- <property name="eclipselink.jdbc.password" value="tiger"/>
- <property name="eclipselink.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
- <property name="eclipselink.jdbc.read-connections.min" value="1"/>
- <property name="eclipselink.jdbc.write-connections.min" value="1"/>
- <property name="eclipselink.logging.timestamp" value="false"/>
- <property name="eclipselink.logging.thread" value="false"/>
- <property name="eclipselink.logging.session" value="false"/>
- <property name="eclipselink.logging.exceptions" value="false"/>
- <property name="eclipselink.logging.level" value="FINE"/>
- </properties>
- </persistence-unit>
-</persistence>
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/example/employee/EmployeeDynamicMappings.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/example/employee/EmployeeDynamicMappings.java
deleted file mode 100644
index 4f7a186..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/example/employee/EmployeeDynamicMappings.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example.employee;
-
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.persistence.EntityManagerFactory;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.internal.dynamic.DynamicTypeImpl;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-import org.eclipse.persistence.mappings.OneToOneMapping;
-
-/**
- * Factory for the creation of the dynamic {@link DynamicTypeImpl}'s required
- * for the employee example.
- *
- * @author dclarke
- * @since EclipseLink - Dynamic Incubator (1.1.0-branch)
- */
-public class EmployeeDynamicMappings {
-
- public static void createTypes(EntityManagerFactory emf, String packageName, boolean createMissingTables) {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- String packagePrefix = packageName.endsWith(".") ? packageName : packageName + ".";
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> employeeClass = dcl.createDynamicClass(packagePrefix + "Employee");
- Class<?> addressClass = dcl.createDynamicClass(packagePrefix + "Address");
- Class<?> phoneClass = dcl.createDynamicClass(packagePrefix + "PhoneNumber");
- Class<?> periodClass = dcl.createDynamicClass(packagePrefix + "EmploymentPeriod");
- Class<?> projectClass = dcl.createDynamicClass(packagePrefix + "Project");
- Class<?> smallProjectClass = dcl.createDynamicClass(packagePrefix + "SmallProject", projectClass);
- Class<?> largeProjectClass = dcl.createDynamicClass(packagePrefix + "LargeProject", projectClass);
-
- JPADynamicTypeBuilder employee = new JPADynamicTypeBuilder(employeeClass, null, "D_EMPLOYEE", "D_SALARY");
- JPADynamicTypeBuilder address = new JPADynamicTypeBuilder(addressClass, null, "D_ADDRESS");
- JPADynamicTypeBuilder phone = new JPADynamicTypeBuilder(phoneClass, null, "D_PHONE");
- JPADynamicTypeBuilder period = new JPADynamicTypeBuilder(periodClass, null);
- JPADynamicTypeBuilder project = new JPADynamicTypeBuilder(projectClass, null, "D_PROJECT");
- JPADynamicTypeBuilder smallProject = new JPADynamicTypeBuilder(smallProjectClass, project.getType(), "D_PROJECT");
- JPADynamicTypeBuilder largeProject = new JPADynamicTypeBuilder(largeProjectClass, project.getType(), "D_LPROJECT");
-
- configureAddress(address);
- configureEmployee(employee, address, phone, period, project);
- configurePhone(phone, employee);
- configurePeriod(period);
- configureProject(project, smallProject, largeProject, employee);
- configureSmallProject(smallProject, project);
- configureLargeProject(largeProject, project);
-
- employee.addManyToManyMapping("projects", project.getType(), "D_PROJ_EMP");
-
- helper.addTypes(true, true, employee.getType(), address.getType(), phone.getType(), period.getType(), project.getType(), smallProject.getType(), largeProject.getType());
- }
-
- private static void configurePhone(JPADynamicTypeBuilder phone, JPADynamicTypeBuilder employee) {
- phone.setPrimaryKeyFields("PHONE_TYPE", "EMP_ID");
-
- phone.addDirectMapping("type", String.class, "PHONE_TYPE");
- phone.addDirectMapping("ownerId", int.class, "EMP_ID").readOnly();
- phone.addDirectMapping("areaCode", String.class, "AREA_CODE");
- phone.addDirectMapping("number", String.class, "PNUMBER");
-
- phone.addOneToOneMapping("owner", employee.getType(), "EMP_ID");
- }
-
- private static void configureAddress(JPADynamicTypeBuilder address) {
- address.setPrimaryKeyFields("ADDR_ID");
-
- address.addDirectMapping("id", int.class, "ADDR_ID");
- address.addDirectMapping("street", String.class, "STREET");
- address.addDirectMapping("city", String.class, "CITY");
- address.addDirectMapping("province", String.class, "PROV");
- address.addDirectMapping("postalCode", String.class, "P_CODE");
- address.addDirectMapping("country", String.class, "COUNTRY");
-
- address.configureSequencing("ADDR_SEQ", "ADDR_ID");
- }
-
- private static void configureEmployee(JPADynamicTypeBuilder employee, JPADynamicTypeBuilder address, JPADynamicTypeBuilder phone, JPADynamicTypeBuilder period, JPADynamicTypeBuilder project) {
- employee.setPrimaryKeyFields("EMP_ID");
-
- employee.addDirectMapping("id", int.class, "D_EMPLOYEE.EMP_ID");
- employee.addDirectMapping("firstName", String.class, "D_EMPLOYEE.F_NAME");
- employee.addDirectMapping("lastName", String.class, "D_EMPLOYEE.L_NAME");
- employee.addDirectMapping("gender", String.class, "D_EMPLOYEE.GENDER");
- employee.addDirectMapping("salary", int.class, "D_SALARY.SALARY");
-
- OneToOneMapping addressMapping = employee.addOneToOneMapping("address", address.getType(), "ADDR_ID");
- addressMapping.setCascadeAll(true);
- addressMapping.setIsPrivateOwned(true);
-
- employee.addOneToOneMapping("manager", employee.getType(), "MANAGER_ID");
-
- OneToManyMapping phoneMapping = employee.addOneToManyMapping("phoneNumbers", phone.getType(), "OWNER_ID");
- phoneMapping.setCascadeAll(true);
- phoneMapping.setIsPrivateOwned(true);
-
- employee.addAggregateObjectMapping("period", period.getType(), true);
- employee.addOneToManyMapping("managedEmployees", employee.getType(), "MANAGER_ID");
-
- employee.configureSequencing("EMP_SEQ", "EMP_ID");
- }
-
- private static void configurePeriod(JPADynamicTypeBuilder period) {
- period.addDirectMapping("startDate", Date.class, "START_DATE");
- period.addDirectMapping("endDate", Date.class, "END_DATE");
- }
-
- private static void configureProject(JPADynamicTypeBuilder project, JPADynamicTypeBuilder smallProject, JPADynamicTypeBuilder largeProject, JPADynamicTypeBuilder employee) {
- project.setPrimaryKeyFields("PROJ_ID");
-
- project.addDirectMapping("id", int.class, "PROJ_ID");
- project.addDirectMapping("name", String.class, "NAME");
- project.addDirectMapping("description", String.class, "DESCRIP");
-
- project.addOneToOneMapping("teamLeader", employee.getType(), "EMP_ID");
-
- ClassDescriptor descriptor = project.getType().getDescriptor();
-
- descriptor.getInheritancePolicy().setClassIndicatorFieldName("PROJ_TYPE");
- descriptor.getInheritancePolicy().addClassIndicator(smallProject.getType().getJavaClass(), "S");
- descriptor.getInheritancePolicy().addClassIndicator(largeProject.getType().getJavaClass(), "L");
- descriptor.getInheritancePolicy().addClassIndicator(project.getType().getJavaClass(), "P");
-
- project.configureSequencing("PROJ_SEQ", "PROJ_ID");
- }
-
- private static void configureLargeProject(JPADynamicTypeBuilder largeProject, JPADynamicTypeBuilder project) {
- largeProject.setPrimaryKeyFields("PROJ_ID");
-
- ClassDescriptor descriptor = largeProject.getType().getDescriptor();
- descriptor.getInheritancePolicy().setClassIndicatorFieldName("PROJ_TYPE");
- descriptor.getInheritancePolicy().setParentClass(project.getType().getJavaClass());
-
- largeProject.addDirectMapping("budget", double.class, "BUDGET");
- largeProject.addDirectMapping("milestone", Calendar.class, "MILESTONE");
- }
-
- private static void configureSmallProject(JPADynamicTypeBuilder smallProject, JPADynamicTypeBuilder project) {
- smallProject.setPrimaryKeyFields("PROJ_ID");
-
- ClassDescriptor descriptor = smallProject.getType().getDescriptor();
- descriptor.getInheritancePolicy().setParentClass(project.getType().getJavaClass());
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/example/employee/Queries.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/example/employee/Queries.java
deleted file mode 100644
index 634c2ed..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/example/employee/Queries.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example.employee;
-
-import java.util.Collection;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.ReadAllQuery;
-
-/**
- * Simple query examples for the XML mapped Employee domain model.
- *
- * @author dclarke
- * @since EclipseLink - Dynamic Incubator (1.1.0-branch)
- */
-public class Queries {
-
- /**
- * Simple example using dynamic JP QL to retrieve all Employee instances
- * sorted by lastName and firstName.
- */
- public List<DynamicEntity> readAllEmployeesUsingJPQL(EntityManager em) {
- return em.createQuery("SELECT e FROM Employee e ORDER BY e.id ASC").getResultList();
- }
-
- public List<DynamicEntity> joinFetchJPQL(EntityManager em) {
- return em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address ORDER BY e.lastName ASC, e.firstName ASC").getResultList();
- }
-
- public List<DynamicEntity> joinFetchHint(EntityManager em) {
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.manager.address.city = 'Ottawa' ORDER BY e.lastName ASC, e.firstName ASC");
- query.setHint(QueryHints.FETCH, "e.address");
- query.setHint(QueryHints.FETCH, "e.manager");
- query.setHint(QueryHints.FETCH, "e.manager.address");
- query.setHint(QueryHints.BATCH, "e.manager.phoneNumbers");
- List<DynamicEntity> emps = query.getResultList();
-
- for (DynamicEntity emp : emps) {
- emp.<DynamicEntity> get("manager").<Collection> get("phoneNumbers").size();
- }
-
- return emps;
- }
-
- public static int minimumEmployeeId(EntityManager em) {
- return ((Number) em.createQuery("SELECT MIN(e.id) FROM Employee e").getSingleResult()).intValue();
- }
-
- public DynamicEntity minimumEmployee(EntityManager em) {
- Query q = em.createQuery("SELECT e FROM Employee e WHERE e.id in (SELECT MIN(ee.id) FROM Employee ee)");
-
- return (DynamicEntity) q.getSingleResult();
- }
-
- public List<DynamicEntity> findEmployeesUsingGenderIn(EntityManager em) {
- return em.createQuery("SELECT e FROM Employee e WHERE e.gender IN (:GENDER1, :GENDER2)").setParameter("GENDER1", "Male").setParameter("GENDER2", "Female").getResultList();
- }
-
- public List<DynamicEntity> findUsingNativeReadAllQuery(EntityManager em) {
- ClassDescriptor descriptor = JpaHelper.getEntityManager(em).getServerSession().getDescriptorForAlias("Employee");
- ReadAllQuery raq = new ReadAllQuery(descriptor.getJavaClass());
- ExpressionBuilder eb = raq.getExpressionBuilder();
- raq.setSelectionCriteria(eb.get("gender").equal("Male"));
-
- Query query = JpaHelper.createQuery(raq, em);
-
- return query.getResultList();
- }
-
- public DynamicEntity minEmployeeWithAddressAndPhones(EntityManager em) {
- return (DynamicEntity) em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT MIN(p.id) FROM PhoneNumber p)").getSingleResult();
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/example/employee/Sample.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/example/employee/Sample.java
deleted file mode 100644
index 40ab3e1..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/example/employee/Sample.java
+++ /dev/null
@@ -1,714 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example.employee;
-
-import java.util.*;
-
-import javax.persistence.*;
-
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.DeleteAllQuery;
-import org.eclipse.persistence.queries.ReportQuery;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink - Dynamic Incubator (1.1.0-branch)
- */
-@SuppressWarnings("deprecation")
-public class Sample {
- private EntityManagerFactory emf;
- public DynamicEntity[] employees;
- public DynamicEntity[] smallProjects;
- public DynamicEntity[] largeProjects;
-
- public Sample(EntityManagerFactory emf) {
- this.emf = emf;
-
- this.employees = new DynamicEntity[] { basicEmployeeExample1(), basicEmployeeExample2(), basicEmployeeExample3(), basicEmployeeExample4(), basicEmployeeExample5(), basicEmployeeExample6(), basicEmployeeExample7(), basicEmployeeExample8(), basicEmployeeExample9(), basicEmployeeExample10(), basicEmployeeExample11(), basicEmployeeExample12() };
-
- this.smallProjects = new DynamicEntity[] { basicSmallProjectExample1(), basicSmallProjectExample2(), basicSmallProjectExample3(), basicSmallProjectExample4(), basicSmallProjectExample5(), basicSmallProjectExample7(), basicSmallProjectExample8(), basicSmallProjectExample9(), basicSmallProjectExample10() };
-
- this.largeProjects = new DynamicEntity[] { basicLargeProjectExample1(), basicLargeProjectExample2(), basicLargeProjectExample3(), basicLargeProjectExample4(), basicLargeProjectExample5() };
-
- // Setup management hierarchy
- addManagedEmployees(0, new int[] { 2, 3, 4 });
- addManagedEmployees(1, new int[] { 5, 0 });
- addManagedEmployees(2, new int[] {});
- addManagedEmployees(3, new int[] {});
- addManagedEmployees(4, new int[] {});
- addManagedEmployees(5, new int[] {});
- addManagedEmployees(6, new int[] {});
- addManagedEmployees(7, new int[] {});
- addManagedEmployees(8, new int[] {});
- addManagedEmployees(9, new int[] { 7, 8, 10, 11 });
- addManagedEmployees(10, new int[] { 6 });
- addManagedEmployees(11, new int[] { 1 });
-
- // Setup Employee-Project associations
- addProjects(0, new int[] { 0, 1, 2 }, new int[] {});
- addProjects(1, new int[] { 3, 4, 0 }, new int[] {});
- addProjects(2, new int[] { 3 }, new int[] { 3, 4 });
- addProjects(4, new int[] { 3, 1 }, new int[] { 2, 4 });
- addProjects(5, new int[] {}, new int[] { 1 });
- addProjects(6, new int[] {}, new int[] { 1 });
-
- // Setup LargeProject leads
- this.largeProjects[0].set("teamLeader", this.employees[1]);
- this.largeProjects[3].set("teamLeader", this.employees[2]);
- this.largeProjects[4].set("teamLeader", this.employees[2]);
-
- }
-
- private DynamicEntity newInstance(String entityAlias) {
- ClassDescriptor descriptor = JpaHelper.getServerSession(this.emf).getDescriptorForAlias(entityAlias);
- return (DynamicEntity) descriptor.getInstantiationPolicy().buildNewInstance();
- }
-
- private Class getDynamicClass(String entityAlias) {
- ClassDescriptor descriptor = JpaHelper.getServerSession(this.emf).getDescriptorForAlias(entityAlias);
- return descriptor.getJavaClass();
- }
-
- private DynamicEntity addPhoneNumber(DynamicEntity employee, String type, String areaCode, String number) {
- DynamicEntity phone = newInstance("PhoneNumber");
- phone.set("type", type);
- phone.set("areaCode", areaCode);
- phone.set("number", number);
- phone.set("owner", employee);
- employee.<Collection> get("phoneNumbers").add(phone);
- return phone;
- }
-
- private void setPeriod(DynamicEntity employee, Date startDate, Date endDate) {
- DynamicEntity period = newInstance("EmploymentPeriod");
- period.set("startDate", startDate);
- period.set("endDate", endDate);
- employee.set("period", period);
- }
-
- public DynamicEntity basicEmployeeExample1() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Bob");
- employee.set("lastName", "Smith");
- employee.set("gender", "Male");
- employee.set("salary", 35000);
-
- setPeriod(employee, new Date(1993, 0, 1), new Date(1996, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Toronto");
- address.set("postalCode", "L5J2B5");
- address.set("province", "ONT");
- address.set("street", "1450 Acme Cr., Suite 4");
- address.set("country", "Canada");
- employee.set("address", address);
-
- // employee.add("responsibilities", "Water the office plants.");
- // employee.add("responsibilities", "Maintain the kitchen facilities.");
- addPhoneNumber(employee, "Work", "613", "5558812");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample10() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Jill");
- employee.set("lastName", "May");
- employee.set("gender", "Female");
-
- setPeriod(employee, new Date(1991, 10, 111), null);
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Calgary");
- address.set("postalCode", "J5J2B5");
- address.set("province", "AB");
- address.set("street", "1111 Mooseland Rd.");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.set("salary", 56232);
- addPhoneNumber(employee, "Work", "613", "5558812");
- addPhoneNumber(employee, "Work Fax", "613", "5555943");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample11() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Sarah-Lou");
- employee.set("lastName", "Smitty");
- employee.set("gender", "Female");
-
- setPeriod(employee, new Date(1993, 0, 1), new Date(1996, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Arnprior");
- address.set("postalCode", "W1A2B5");
- address.set("province", "ONT");
- address.set("street", "1 Hawthorne Drive");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.set("salary", 75000);
- addPhoneNumber(employee, "Work Fax", "613", "5555943");
- addPhoneNumber(employee, "Home", "613", "5551234");
- addPhoneNumber(employee, "Cellular", "416", "5551111");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample12() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Jim-Bob");
- employee.set("lastName", "Jefferson");
- employee.set("gender", "Male");
-
- setPeriod(employee, new Date(1995, 0, 12), new Date(2001, 11, 31));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Yellowknife");
- address.set("postalCode", "Y5J2N5");
- address.set("province", "YK");
- address.set("street", "1112 Gold Rush Rd.");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.set("salary", 50000);
- addPhoneNumber(employee, "Home", "613", "5551234");
- addPhoneNumber(employee, "Cellular", "416", "5551111");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample2() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "John");
- employee.set("lastName", "Way");
- employee.set("gender", "Male");
- employee.set("salary", 53000);
-
- setPeriod(employee, new Date(1991, 10, 11), null);
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Ottawa");
- address.set("postalCode", "K5J2B5");
- address.set("province", "ONT");
- address.set("street", "12 Merivale Rd., Suite 5");
- address.set("country", "Canada");
- employee.set("address", address);
-
- // employee.add("responsibilities",
- // "Hire people when more people are required.");
- // employee.add("responsibilities",
- // "Lay off employees when less people are required.");
- addPhoneNumber(employee, "Work", "613", "5558812");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample3() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Charles");
- employee.set("lastName", "Chanley");
- employee.set("gender", "Male");
- employee.set("salary", 43000);
-
- setPeriod(employee, new Date(1995, 0, 1), new Date(2001, 11, 31));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Montreal");
- address.set("postalCode", "Q2S5Z5");
- address.set("province", "QUE");
- address.set("street", "1 Canadien Place");
- address.set("country", "Canada");
- employee.set("address", address);
-
- // employee.add("responsibilities",
- // "Perform code reviews as required.");
- addPhoneNumber(employee, "Pager", "976", "5556666");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample4() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Emanual");
- employee.set("lastName", "Smith");
- employee.set("gender", "Male");
- employee.set("salary", 49631);
-
- setPeriod(employee, new Date(2001, 11, 31), new Date(1995, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Vancouver");
- address.set("postalCode", "N5J2N5");
- address.set("province", "BC");
- address.set("street", "20 Mountain Blvd., Floor 53, Suite 6");
- address.set("country", "Canada");
- employee.set("address", address);
-
- // employee.add("responsibilities",
- // "Have to fix the Database problem.");
- addPhoneNumber(employee, "Work Fax", "613", "5555943");
- addPhoneNumber(employee, "Cellular", "416", "5551111");
- addPhoneNumber(employee, "Pager", "976", "5556666");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample5() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Sarah");
- employee.set("lastName", "Way");
- employee.set("gender", "Female");
- employee.set("salary", 87000);
-
- setPeriod(employee, new Date(2001, 6, 31), new Date(1995, 4, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Prince Rupert");
- address.set("postalCode", "K3K5D5");
- address.set("province", "BC");
- address.set("street", "3254 Parkway Place");
- address.set("country", "Canada");
- employee.set("address", address);
-
- // employee.add("responsibilities", "Write code documentation.");
- addPhoneNumber(employee, "Work", "613", "5558812");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
- addPhoneNumber(employee, "Home", "613", "5551234");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample6() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Marcus");
- employee.set("lastName", "Saunders");
- employee.set("gender", "Male");
- employee.set("salary", 54300);
-
- setPeriod(employee, new Date(2001, 11, 31), new Date(1995, 0, 12));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Perth");
- address.set("postalCode", "Y3Q2N9");
- address.set("province", "ONT");
- address.set("street", "234 Caledonia Lane");
- address.set("country", "Canada");
- employee.set("address", address);
-
- // employee.add("responsibilities", "Write user specifications.");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
- addPhoneNumber(employee, "Work", "613", "5558812");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample7() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Nancy");
- employee.set("lastName", "White");
- employee.set("gender", "Female");
- employee.set("salary", 31000);
-
- setPeriod(employee, new Date(1996, 0, 1), new Date(1993, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Metcalfe");
- address.set("postalCode", "Y4F7V6");
- address.set("province", "ONT");
- address.set("street", "2 Anderson Rd.");
- address.set("country", "Canada");
- employee.set("address", address);
-
- addPhoneNumber(employee, "Home", "613", "5551234");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample8() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Fred");
- employee.set("lastName", "Jones");
- employee.set("gender", "Male");
- employee.set("salary", 500000);
-
- setPeriod(employee, new Date(2001, 11, 31), new Date(1995, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Victoria");
- address.set("postalCode", "Z5J2N5");
- address.set("province", "BC");
- address.set("street", "382 Hyde Park Blvd.");
- address.set("country", "Canada");
- employee.set("address", address);
-
- addPhoneNumber(employee, "Cellular", "416", "5551111");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample9() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Betty");
- employee.set("lastName", "Jones");
- employee.set("gender", "Female");
- employee.set("salary", 500001);
-
- setPeriod(employee, new Date(2001, 11, 31), new Date(1995, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Smith Falls");
- address.set("postalCode", "C6C6C6");
- address.set("province", "ONT");
- address.set("street", "89 Chocolate Drive");
- address.set("country", "Canada");
- employee.set("address", address);
-
- addPhoneNumber(employee, "Work", "613", "5558812");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- private void setCalendar(DynamicEntity entity, String name, int year, int month, int day, int hour, int minute, int seconds) {
- Calendar cal = entity.<Calendar> get(name);
-
- if (cal == null) {
- cal = Calendar.getInstance();
- entity.set(name, cal);
- }
- cal.set(year, month, day, hour, minute, seconds);
- }
-
- public DynamicEntity basicLargeProjectExample1() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "Sales Reporting");
- largeProject.set("description", "A reporting application to report on the corporations database through TopLink.");
- largeProject.set("budget", (double) 5000);
- setCalendar(largeProject, "milestone", 1991, 10, 11, 12, 0, 0);
-
- return largeProject;
- }
-
- public DynamicEntity basicLargeProjectExample2() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "Light Reporter");
- largeProject.set("description", "A lightweight application to report on the corporations database through TopLink.");
- largeProject.set("budget", 100.98);
- setCalendar(largeProject, "milestone", 1999, 11, 25, 11, 40, 44);
-
- return largeProject;
- }
-
- public DynamicEntity basicLargeProjectExample3() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "TOPEmployee Management");
- largeProject.set("description", "A management application to report on the corporations database through TopLink.");
- largeProject.set("budget", 4000.98);
- setCalendar(largeProject, "milestone", 1997, 10, 12, 1, 0, 0);
-
- return largeProject;
- }
-
- public DynamicEntity basicLargeProjectExample4() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "Enterprise System");
- largeProject.set("description", "A enterprise wide application to report on the corporations database through TopLink.");
- largeProject.set("budget", 40.98);
- setCalendar(largeProject, "milestone", 1996, 8, 6, 6, 40, 44);
-
- return largeProject;
- }
-
- public DynamicEntity basicLargeProjectExample5() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "Problem Reporting System");
- largeProject.set("description", "A PRS application to report on the corporations database through TopLink.");
- largeProject.set("budget", 101.98);
- setCalendar(largeProject, "milestone", 1997, 9, 6, 1, 40, 44);
-
- return largeProject;
- }
-
- public DynamicEntity basicSmallProjectExample1() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Enterprise");
- smallProject.set("description", "A enterprise wide application to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample10() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Staff Query Tool");
- smallProject.set("description", "A tool to help staff query various things.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample2() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Sales Reporter");
- smallProject.set("description", "A reporting application using JDK to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample3() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "TOP-Employee Manager");
- smallProject.set("description", "A management application to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample4() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Problem Reporter");
- smallProject.set("description", "A PRS application to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample5() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Feather Reporter");
- smallProject.set("description", "An extremely lightweight application to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample6() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Makework");
- smallProject.set("description", "A makework project.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample7() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Marketing Query Tool");
- smallProject.set("description", "A tool to help marketing query various things.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample8() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Shipping Query Tool");
- smallProject.set("description", "A tool to help shipping query various things.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample9() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Accounting Query Tool");
- smallProject.set("description", "A tool to help accounting query various things.");
- return smallProject;
- }
-
- private void addManagedEmployees(int managerIndex, int[] employeeIndeces) {
- DynamicEntity manager = this.employees[managerIndex];
-
- if (manager.<Collection> get("managedEmployees").isEmpty()) {
- for (int index = 0; index < employeeIndeces.length; index++) {
- manager.<Collection> get("managedEmployees").add(this.employees[employeeIndeces[index]]);
- }
- }
- }
-
- private void addProjects(int empIndex, int[] smallProjIndeces, int[] largeProjIndeces) {
- DynamicEntity employee = this.employees[empIndex];
-
- for (int index = 0; index < smallProjIndeces.length; index++) {
- employee.<Collection> get("projects").add(this.smallProjects[smallProjIndeces[index]]);
- }
-
- for (int index = 0; index < largeProjIndeces.length; index++) {
- employee.<Collection> get("projects").add(this.largeProjects[largeProjIndeces[index]]);
- }
- }
-
- /**
- * Register all of the population in the provided EntityManager to be
- * persisted This method should only be called from within a test case. It
- * asserts that the provided EntityManager is in a transaction and that the
- * database tables are empty.
- */
- public void persistAll(EntityManager em) {
- Assert.assertTrue("EntityManager not in Transaction", em.getTransaction().isActive());
-
- // Verify that the database tables are empty
- assertCount(em, "Employee", 0);
- assertCount(em, "Address", 0);
- assertCount(em, "PhoneNumber", 0);
- assertCount(em, "Project", 0);
-
- for (int index = 0; index < this.employees.length; index++) {
- em.persist(this.employees[index]);
- }
- for (int index = 0; index < this.smallProjects.length; index++) {
- em.persist(this.smallProjects[index]);
- }
- for (int index = 0; index < this.largeProjects.length; index++) {
- em.persist(this.largeProjects[index]);
- }
-
- em.flush();
- verifyCounts(em);
- }
-
- public void verifyCounts(EntityManager em) {
- assertCount(em, "Employee", this.employees.length);
- assertCount(em, "Address", this.employees.length);
- assertCount(em, "Project", this.smallProjects.length + this.largeProjects.length);
- }
-
- /**
- * Verify that the provided entity type has no rows in the database using a
- * native ReportQuery.
- *
- * @param entityClass
- * @param count
- */
- public void assertCount(EntityManager em, String entityAlias, int count) {
- Class entityClass = getDynamicClass(entityAlias);
- ReportQuery query = new ReportQuery(entityClass, new ExpressionBuilder());
- query.addCount();
- query.setShouldReturnSingleValue(true);
-
- int dbCount = ((Number) JpaHelper.getEntityManager(em).getUnitOfWork().executeQuery(query)).intValue();
- Assert.assertEquals("Incorrect quantity found of " + entityClass, count, dbCount);
- }
-
- /**
- * Verify that the provided list of Employee instances matches the sample
- * population.
- *
- * @param employees
- */
- public void assertSame(List<DynamicEntity> dbEmps) {
- Assert.assertEquals("Incorrect quantity of employees", this.employees.length, dbEmps.size());
- Collections.sort(dbEmps, new DynamicEntityComparator());
-
- List<DynamicEntity> sampleEmps = new ArrayList<DynamicEntity>();
- for (int index = 0; index < this.employees.length; index++) {
- sampleEmps.add(this.employees[index]);
- }
- Collections.sort(sampleEmps, new DynamicEntityComparator());
-
- for (int index = 0; index < this.employees.length; index++) {
- DynamicEntity emp = sampleEmps.get(index);
- DynamicEntity dbEmp = dbEmps.get(index);
-
- Assert.assertEquals("First name does not match on employees[" + index + "]", emp.<String> get("firstName"), dbEmp.<String> get("firstName"));
- Assert.assertEquals("Last name does not match on employees[" + index + "]", emp.<String> get("lastName"), dbEmp.<String> get("lastName"));
- Assert.assertEquals("Salary does not match on employees[" + index + "]", emp.<Integer> get("salary"), dbEmp.<Integer> get("salary"));
- }
- }
-
- /**
- * Simple comparator used to order the employees for use within assertSame
- */
- class DynamicEntityComparator implements Comparator<DynamicEntity> {
-
- public int compare(DynamicEntity emp1, DynamicEntity emp2) {
- return emp1.<Integer> get("id") - emp2.<Integer> get("id");
- }
-
- }
-
- /**
- * Extract the id's from the sample Employee instances.
- *
- * @param em
- * @return
- */
- public int[] getEmployeeIds(EntityManager em) {
- int[] ids = new int[this.employees.length];
-
- for (int index = 0; index < this.employees.length; index++) {
- ids[index] = this.employees[index].<Integer> get("id");
- }
-
- return ids;
- }
-
- /**
- * Reset the database so that only the sample population exists.
- *
- * @param em
- */
- public void resetDatabase(EntityManager em) {
- em.getTransaction().begin();
-
- DeleteAllQuery deleteEmpsQuery = new DeleteAllQuery(getDynamicClass("Employee"));
- ExpressionBuilder eb = deleteEmpsQuery.getExpressionBuilder();
- deleteEmpsQuery.setSelectionCriteria(eb.get("id").notIn(getEmployeeIds(em)));
- deleteEmpsQuery.setFlushOnExecute(true);
-
- JpaHelper.getEntityManager(em).getUnitOfWork().executeQuery(deleteEmpsQuery);
-
- em.getTransaction().commit();
- }
-
- public void resetSalary(EntityManager em) {
- boolean startedTX = !em.getTransaction().isActive();
-
- if (startedTX) {
- em.getTransaction().begin();
- }
-
- for (int index = 0; index < this.employees.length; index++) {
- DynamicEntity emp = this.employees[index];
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.firstName = :FNAME AND e.lastName = :LNAME");
- query.setParameter("FNAME", emp.<String> get("firstName"));
- query.setParameter("LNAME", emp.<String> get("lastName"));
-
- DynamicEntity dbEmp = (DynamicEntity) query.getSingleResult();
- dbEmp.set("salary", this.employees[index].<Integer> get("salary"));
- }
-
- if (startedTX) {
- em.getTransaction().commit();
- }
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/example/employee/Transactions.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/example/employee/Transactions.java
deleted file mode 100644
index 1b5d7e9..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/example/employee/Transactions.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example.employee;
-
-import java.util.Collection;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.FlushModeType;
-
-import org.eclipse.persistence.config.PessimisticLock;
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink - Dynamic Incubator (1.1.0-branch)
- */
-public class Transactions {
-
- private ClassDescriptor getDescriptor(EntityManager em, String entityAlias) {
- return JpaHelper.getEntityManager(em).getServerSession().getDescriptorForAlias(entityAlias);
- }
-
- /**
- * New entities with new related related entities can be persisted using
- * <code>EntityManager.persist(newEntity)</code>. The cascade setting on the
- * mappings determine how the related entities are handled. In this case
- * Employee has its relationship to Address and PhoneNumber configured with
- * cascade-all so the associated new entities will also be persisted.
- */
- public DynamicEntity createUsingPersist(EntityManager em) {
- DynamicHelper helper = new JPADynamicHelper(em);
-
- DynamicType empType = helper.getType("Employee");
- DynamicType addrType = helper.getType("Address");
- DynamicType phoneType = helper.getType("PhoneNumber");
-
- DynamicEntity emp = (DynamicEntity) empType.newDynamicEntity();
- emp.set("firstName", "Sample");
- emp.set("lastName", "Employee");
- emp.set("gender", "Male");
- emp.set("salary", 123456);
-
- DynamicEntity address = (DynamicEntity) addrType.newDynamicEntity();
- emp.set("address", address);
-
- DynamicEntity phone = (DynamicEntity) phoneType.newDynamicEntity();
- phone.set("type", "Mobile");
- phone.set("areaCode", "613");
- phone.set("number", "555-1212");
- phone.set("owner", emp);
- emp.<Collection<DynamicEntity>> get("phoneNumbers").add(phone);
-
- em.getTransaction().begin();
- em.persist(emp);
- em.getTransaction().commit();
-
- return emp;
- }
-
- /**
- *
- */
- public DynamicEntity createUsingMerge(EntityManager em) {
- ClassDescriptor empDescriptor = getDescriptor(em, "Employee");
- ClassDescriptor addrDescriptor = getDescriptor(em, "Address");
- ClassDescriptor phoneDescriptor = getDescriptor(em, "PhoneNumber");
-
- DynamicEntity emp = (DynamicEntity) empDescriptor.getInstantiationPolicy().buildNewInstance();
- emp.set("firstName", "Sample");
- emp.set("lastName", "Employee");
- emp.set("gender", "Male");
- emp.set("salary", 123456);
-
- DynamicEntity address = (DynamicEntity) addrDescriptor.getInstantiationPolicy().buildNewInstance();
- emp.set("address", address);
-
- DynamicEntity phone = (DynamicEntity) phoneDescriptor.getInstantiationPolicy().buildNewInstance();
- phone.set("type", "Mobile");
- phone.set("areaCode", "613");
- phone.set("number", "555-1212");
- phone.set("owner", emp);
- emp.<Collection<DynamicEntity>> get("phoneNumbers").add(phone);
-
- em.getTransaction().begin();
- // When merging the managed instance is returned from the call.
- // Further usage within the transaction must be done with this managed
- // entity.
- emp = (DynamicEntity) em.merge(emp);
- em.getTransaction().commit();
-
- return emp;
- }
-
- /**
- *
- * @param em
- * @return
- */
- public DynamicEntity createWithRelationshipsToExistingEntities(EntityManager em) {
- return null;
- }
-
- /**
- *
- * @param em
- */
- public DynamicEntity deleteEntity(EntityManager em) {
- return null;
- }
-
- /**
- *
- * @param em
- */
- public void queriesOnTransactionalState(EntityManager em) {
- em.setFlushMode(FlushModeType.COMMIT);
-
- }
-
- /**
- *
- * @param em
- * @throws Exception
- */
- public void pessimisticLocking(EntityManager em) throws Exception {
-
- // Find the Employee with the minimum ID
- int minId = Queries.minimumEmployeeId(em);
-
- em.getTransaction().begin();
-
- // Lock Employee using query with hint
- DynamicEntity emp = (DynamicEntity) em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID").setParameter("ID", minId).setHint(QueryHints.PESSIMISTIC_LOCK, PessimisticLock.Lock).getSingleResult();
-
- emp.set("salary", emp.<Integer> get("salary") - 1);
-
- em.flush();
- }
-
- /**
- * This example illustrates the use of a query returning an entity and data
- * from a related entity within a transaction. The returned entities are
- * managed and thus any changes are reflected in the database upon flush.
- *
- * @param em
- * @throws Exception
- */
- public void updateEmployeeWithCity(EntityManager em) throws Exception {
- em.getTransaction().begin();
-
- List<Object[]> emps = em.createQuery("SELECT e, e.address.city FROM Employee e").getResultList();
- DynamicEntity emp = (DynamicEntity) emps.get(0)[0];
- emp.set("salary", emp.<Integer> get("salary") + 1);
-
- em.flush();
-
- em.getTransaction().rollback();
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/AllTests.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/AllTests.java
deleted file mode 100644
index 9cec4a6..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/AllTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { testing.simple.AllTests.class , testing.employee.AllTests.class})
-public class AllTests {
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/employee/AllTests.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/employee/AllTests.java
deleted file mode 100644
index 02292dd..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/employee/AllTests.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package testing.employee;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { MappingConfigTests.class, QueryTests.class, TransactionTests.class })
-public class AllTests {
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/employee/MappingConfigTests.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/employee/MappingConfigTests.java
deleted file mode 100644
index 3e12232..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/employee/MappingConfigTests.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package testing.employee;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Map;
-
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceContext;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.ManyToManyMapping;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-import org.eclipse.persistence.mappings.OneToOneMapping;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.Test;
-
-import testing.util.EclipseLinkJPATest;
-import example.employee.EmployeeDynamicMappings;
-
-/**
- * Set of tests to ensure the mappings are properly populated from the provided
- * annotations/xml.
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-@PersistenceContext(unitName = "empty")
-public class MappingConfigTests extends EclipseLinkJPATest {
-
- @Test
- public void verifyServerSession() throws Exception {
- Server session = JpaHelper.getServerSession(getEMF());
-
- assertNotNull(session);
- assertTrue(session.isConnected());
- assertTrue(session.isServerSession());
- assertEquals(1, session.getReadConnectionPool().getMinNumberOfConnections());
- assertEquals(1, session.getDefaultConnectionPool().getMinNumberOfConnections());
-
- assertTrue(session.getName().startsWith("file"));
- assertTrue(session.getName().endsWith("empty"));
- }
-
- @Test
- public void verifyEmployeeDescriptor() throws Exception {
- Server session = JpaHelper.getServerSession(getEMF());
- ClassDescriptor descriptor = session.getDescriptorForAlias("Employee");
-
- assertNotNull(descriptor);
- assertEquals("Employee", descriptor.getAlias());
- assertNull(descriptor.getInheritancePolicyOrNull());
-
- // Address Mapping
- OneToOneMapping addrMapping = (OneToOneMapping) descriptor.getMappingForAttributeName("address");
- assertNotNull(addrMapping);
- assertTrue(addrMapping.isPrivateOwned());
- assertSame(session.getDescriptorForAlias("Address"), addrMapping.getReferenceDescriptor());
-
- // PhoenNumber Mapping
- OneToManyMapping phoneMapping = (OneToManyMapping) descriptor.getMappingForAttributeName("phoneNumbers");
- assertNotNull(phoneMapping);
- assertTrue(phoneMapping.isPrivateOwned());
- assertSame(session.getDescriptorForAlias("PhoneNumber"), phoneMapping.getReferenceDescriptor());
-
- // Manager Mapping
- OneToOneMapping managerMapping = (OneToOneMapping) descriptor.getMappingForAttributeName("manager");
- assertNotNull(managerMapping);
- assertFalse(managerMapping.isPrivateOwned());
- assertSame(descriptor, managerMapping.getReferenceDescriptor());
-
- // Managed Employees Mapping
- OneToManyMapping managedEmployeesMapping = (OneToManyMapping) descriptor.getMappingForAttributeName("managedEmployees");
- assertNotNull(managedEmployeesMapping);
- assertFalse(managedEmployeesMapping.isPrivateOwned());
- assertSame(descriptor, managedEmployeesMapping.getReferenceDescriptor());
-
- // Projects Mapping
- ManyToManyMapping projectsMapping = (ManyToManyMapping) descriptor.getMappingForAttributeName("projects");
- assertNotNull(projectsMapping);
- assertFalse(projectsMapping.isPrivateOwned());
- assertSame(session.getDescriptorForAlias("Project"), projectsMapping.getReferenceDescriptor());
-}
-
- @Test
- public void verifyAddressDescriptor() throws Exception {
- Server session = JpaHelper.getServerSession(getEMF());
- ClassDescriptor descriptor = session.getDescriptorForAlias("Address");
-
- assertNotNull(descriptor);
- assertEquals("Address", descriptor.getAlias());
- assertNull(descriptor.getInheritancePolicyOrNull());
- }
-
- @Test
- public void verifyPhoneNumberDescriptor() {
- Server session = JpaHelper.getServerSession(getEMF());
- ClassDescriptor descriptor = session.getDescriptorForAlias("PhoneNumber");
-
- assertNotNull(descriptor);
- assertEquals("PhoneNumber", descriptor.getAlias());
- assertNull(descriptor.getInheritancePolicyOrNull());
- }
-
- @Test
- public void verifyProjectDescriptor() {
- Server session = JpaHelper.getServerSession(getEMF());
- ClassDescriptor descriptor = session.getDescriptorForAlias("Project");
-
- assertNotNull(descriptor);
- assertEquals("Project", descriptor.getAlias());
- assertNotNull(descriptor.getInheritancePolicyOrNull());
- }
-
- @Test
- public void verifySmallProjectDescriptor() {
- Server session = JpaHelper.getServerSession(getEMF());
- ClassDescriptor descriptor = session.getDescriptorForAlias("SmallProject");
-
- assertNotNull(descriptor);
- assertEquals("SmallProject", descriptor.getAlias());
- assertNotNull(descriptor.getInheritancePolicyOrNull());
- }
-
- @Test
- public void verifyLargeProjectDescriptor() {
- Server session = JpaHelper.getServerSession(getEMF());
- ClassDescriptor descriptor = session.getDescriptorForAlias("LargeProject");
-
- assertNotNull(descriptor);
- assertEquals("LargeProject", descriptor.getAlias());
- assertNotNull(descriptor.getInheritancePolicyOrNull());
- }
-
- @Override
- protected EntityManagerFactory createEMF(String unitName, Map properties) {
- EntityManagerFactory newEMF = super.createEMF(unitName, properties);
-
- Server session = JpaHelper.getServerSession(newEMF);
- if (session.getDescriptors().isEmpty()) {
- EmployeeDynamicMappings.createTypes(newEMF, "model.dynamic.employee", false);
- }
-
- return newEMF;
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/employee/QueryTests.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/employee/QueryTests.java
deleted file mode 100644
index 51f493a..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/employee/QueryTests.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package testing.employee;
-
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceContext;
-
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.sessions.server.Server;
-import org.eclipse.persistence.tools.schemaframework.DynamicSchemaManager;
-import org.junit.Test;
-
-import testing.util.EclipseLinkJPATest;
-import example.employee.EmployeeDynamicMappings;
-import example.employee.Queries;
-import example.employee.Sample;
-
-/**
- * Simple query examples for the XML mapped Employee domain model.
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-@PersistenceContext(unitName = "empty")
-public class QueryTests extends EclipseLinkJPATest {
-
- private Queries examples = new Queries();
-
- private Sample samples;
-
- public Queries getExamples() {
- return this.examples;
- }
-
- public Sample getSamples() {
- if (this.samples == null) {
- this.samples = new Sample(getEMF());
- }
- return this.samples;
- }
-
- /**
- * Simple example using dynamic JP QL to retrieve all Employee instances
- * sorted by lastName and firstName.
- */
- @Test
- public void readAllEmployees_JPQL() {
- EntityManager em = getEntityManager();
-
- List<DynamicEntity> emps = getExamples().readAllEmployeesUsingJPQL(em);
-
- getSamples().assertSame(emps);
- }
-
- @Test
- public void joinFetchJPQL() {
- List<DynamicEntity> emps = getExamples().joinFetchJPQL(getEntityManager());
- assertNotNull(emps);
- }
-
- @Test
- public void joinFetchHint() {
- List<DynamicEntity> emps = getExamples().joinFetchHint(getEntityManager());
- assertNotNull(emps);
- }
-
- @Test
- public void minEmployeeId() {
- getExamples();
- int minId = Queries.minimumEmployeeId(getEntityManager());
-
- assertTrue(minId > 0);
- }
-
- @Test
- public void testGenderIn() throws Exception {
- List<DynamicEntity> emps = getExamples().findEmployeesUsingGenderIn(getEntityManager());
-
- assertNotNull(emps);
- }
-
- @Test
- public void testReadAllExressions() throws Exception {
- List<DynamicEntity> emps = getExamples().findUsingNativeReadAllQuery(getEntityManager());
-
- assertNotNull(emps);
- }
-
- @Override
- protected EntityManagerFactory createEMF(String unitName, Map properties) {
- EntityManagerFactory emf = super.createEMF(unitName, properties);
-
- EmployeeDynamicMappings.createTypes(emf, "example.model.employee", true);
-
- Server session = JpaHelper.getServerSession(emf);
-
- DynamicSchemaManager dsm = new DynamicSchemaManager(session);
- dsm.replaceDefaultTables(false, true);
-
- this.samples = new Sample(emf);
-
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
- getSamples().persistAll(em);
- em.getTransaction().commit();
- em.close();
-
- return emf;
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/employee/TransactionTests.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/employee/TransactionTests.java
deleted file mode 100644
index 35b02f3..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/employee/TransactionTests.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package testing.employee;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceContext;
-
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.sessions.server.Server;
-import org.eclipse.persistence.tools.schemaframework.DynamicSchemaManager;
-import org.junit.Test;
-
-import testing.util.EclipseLinkJPATest;
-import example.employee.EmployeeDynamicMappings;
-import example.employee.Queries;
-import example.employee.Sample;
-import example.employee.Transactions;
-
-@PersistenceContext(unitName = "empty")
-public class TransactionTests extends EclipseLinkJPATest {
-
- Transactions transactions = new Transactions();
- private static Sample samplePopulation;
-
- @Test
- public void pessimisticLocking() throws Exception {
- transactions.pessimisticLocking(getEntityManager());
- }
-
- @Test
- public void createUsingPersist() throws Exception {
- EntityManager em = getEntityManager();
-
- DynamicEntity emp = transactions.createUsingPersist(em);
-
- assertNotNull(emp);
- assertTrue(emp.<Integer>get("id") > 0);
-
- em.getTransaction().begin();
- em.createQuery("DELETE from PhoneNumber p WHERE p.owner.id = " + emp.get("id")).executeUpdate();
- em.createQuery("DELETE from Employee e WHERE e.id = " + emp.get("id")).executeUpdate();
- em.createQuery("DELETE from Address a WHERE a.id = " + emp.<DynamicEntity>get("address").<Integer>get("id")).executeUpdate();
- em.getTransaction().commit();
-
- getSample().verifyCounts(em);
- }
-
- @Test
- public void createUsingMerge() throws Exception {
- EntityManager em = getEntityManager();
-
- DynamicEntity emp = transactions.createUsingMerge(em);
-
- assertNotNull(emp);
- assertTrue(emp.<Integer>get("id") > 0);
-
- em.getTransaction().begin();
- em.createQuery("DELETE from PhoneNumber p WHERE p.owner.id = " + emp.get("id")).executeUpdate();
- em.createQuery("DELETE from Employee e WHERE e.id = " + emp.get("id")).executeUpdate();
- em.createQuery("DELETE from Address a WHERE a.id = " + emp.<DynamicEntity>get("address").<Integer>get("id")).executeUpdate();
- em.getTransaction().commit();
-
- getSample().verifyCounts(em);
- }
-
- @Test
- public void mergeDetached() throws Exception {
- EntityManager em = getEntityManager();
- DynamicHelper helper = new JPADynamicHelper(em);
-
- DynamicType empType = helper.getType("Employee");
-
- int minId = Queries.minimumEmployeeId(em);
- DynamicEntity emp = (DynamicEntity) em.find(empType.getJavaClass(), minId);
- assertNotNull(emp);
-
- em.clear();
-
- emp.set("salary", emp.<Integer>get("salary") + 1);
-
- em.getTransaction().begin();
-
- getQuerySQLTracker(em).reset();
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
-
- em.merge(emp);
-
- em.flush();
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
-
- }
-
- public Sample getSample() {
- if (samplePopulation == null) {
- samplePopulation = new Sample(getEMF());
- }
- return samplePopulation;
- }
-
- @Override
- protected EntityManagerFactory createEMF(String unitName, Map properties) {
- EntityManagerFactory emf = super.createEMF(unitName, properties);
-
- EmployeeDynamicMappings.createTypes(emf, "example.model.employee", true);
-
- Server session = JpaHelper.getServerSession(emf);
-
- DynamicSchemaManager dsm = new DynamicSchemaManager(session);
- dsm.replaceDefaultTables(true, true);
-
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
- new Sample(emf).persistAll(em);
- em.getTransaction().commit();
- em.close();
-
- return emf;
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/AllTests.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/AllTests.java
deleted file mode 100644
index 875f7a8..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/AllTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.simple;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { SimpleType.class, SimpleTypeCompositeKey.class, testing.simple.mappings.AllTests.class, testing.simple.sequencing.AllTests.class })
-public class AllTests {
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/SimpleType.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/SimpleType.java
deleted file mode 100644
index 6cb684a..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/SimpleType.java
+++ /dev/null
@@ -1,222 +0,0 @@
-package testing.simple;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.Calendar;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.internal.dynamic.DynamicTypeImpl;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-import org.eclipse.persistence.sessions.IdentityMapAccessor;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class SimpleType {
-
- protected static EntityManagerFactory emf;
-
- protected DynamicType simpleType;
-
- protected DynamicType getSimpleType() {
- if (simpleType == null) {
- DynamicHelper helper = new JPADynamicHelper(emf);
- this.simpleType = helper.getType("Simple");
-
- if (this.simpleType == null) {
- this.simpleType = createSimpleType();
- }
- }
- return this.simpleType;
- }
-
- protected DynamicType createSimpleType() {
- DynamicHelper helper = new JPADynamicHelper(emf);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
- Class<?> javaType = dcl.createDynamicClass("model.Simple");
-
- DynamicTypeBuilder typeBuilder = new JPADynamicTypeBuilder(javaType, null, "SIMPLE_TYPE");
- typeBuilder.setPrimaryKeyFields("SID");
- typeBuilder.addDirectMapping("id", int.class, "SID");
- typeBuilder.addDirectMapping("value1", String.class, "VAL_1");
- typeBuilder.addDirectMapping("value2", boolean.class, "VAL_2");
- typeBuilder.addDirectMapping("value3", Calendar.class, "VAL_3");
- typeBuilder.addDirectMapping("value4", Character.class, "VAL_4");
-
- helper.addTypes(true, true, typeBuilder.getType());
-
- return typeBuilder.getType();
- }
-
- @Test
- public void verifyConfig() throws Exception {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- ClassDescriptor descriptor = helper.getSession().getClassDescriptorForAlias("Simple");
- assertNotNull("No descriptor found for alias='Simple'", descriptor);
-
- DynamicTypeImpl simpleType = (DynamicTypeImpl) helper.getType("Simple");
- assertNotNull("'Simple' EntityType not found", simpleType);
-
- assertEquals(1 + descriptor.getPrimaryKeyFields().size(), simpleType.getMappingsRequiringInitialization().size());
-
- assertEquals(descriptor, simpleType.getDescriptor());
- }
-
- @Test
- public void find() {
- createSimpleInstance(emf, 1);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance = find(em, 1);
- assertNotNull("Could not find simple instance with id = 1", simpleInstance);
-
- simpleInstance = find(em, new Integer(1));
- assertNotNull("Could not find simple instance with id = Integer(1)", simpleInstance);
-
- }
-
- @Test
- public void simpleInstance_CRUD() {
- Server session = JpaHelper.getServerSession(emf);
- IdentityMapAccessor cache = session.getIdentityMapAccessor();
-
- DynamicEntity simpleInstance = createSimpleInstance(emf, 1);
- assertNotNull(simpleInstance);
-
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance));
- cache.initializeAllIdentityMaps();
- assertFalse(cache.containsObjectInIdentityMap(simpleInstance));
-
- EntityManager em = emf.createEntityManager();
-
- assertFalse(em.contains(simpleInstance));
- simpleInstance = (DynamicEntity) em.merge(simpleInstance);
- assertTrue(em.contains(simpleInstance));
-
- em.close();
- }
-
- @Test
- public void verifyDefaultValuesFromEntityType() throws Exception {
- DynamicHelper helper = new JPADynamicHelper(emf);
- DynamicType simpleType = helper.getType("Simple");
-
- assertNotNull(simpleType);
-
- DynamicEntity simpleInstance = simpleType.newDynamicEntity();
- assertDefaultValues(simpleInstance);
- }
-
- @Test
- public void verifyDefaultValuesFromDescriptor() throws Exception {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicTypeImpl simpleType = (DynamicTypeImpl) helper.getType("Simple");
- assertNotNull(simpleType);
-
- DynamicEntity simpleInstance = (DynamicEntity) simpleType.getDescriptor().getObjectBuilder().buildNewInstance();
- assertDefaultValues(simpleInstance);
- }
-
- protected void assertDefaultValues(DynamicEntity simpleInstance) {
- assertNotNull(simpleInstance);
-
- assertTrue("id not set on new instance", simpleInstance.isSet("id"));
- assertEquals("id not default value", 0, simpleInstance.get("id"));
- assertFalse("value1 set on new instance", simpleInstance.isSet("value1"));
- assertTrue("value2 not set on new instance", simpleInstance.isSet("value2"));
- assertEquals("value2 not default value", false, simpleInstance.get("value2"));
- assertFalse("value3 set on new instance", simpleInstance.isSet("value3"));
- assertFalse("value4 set on new instance", simpleInstance.isSet("value4"));
- }
-
- public DynamicEntity createSimpleInstance(EntityManagerFactory emf, int id) {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- EntityManager em = emf.createEntityManager();
- DynamicType simpleEntityType = helper.getType("Simple");
- Assert.assertNotNull(simpleEntityType);
-
- DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity();
- simpleInstance.set("id", id);
- simpleInstance.set("value2", true);
-
- assertEquals(0, ((Number) em.createQuery("SELECT COUNT(s) FROM Simple s").getSingleResult()).intValue());
-
- em.getTransaction().begin();
- em.persist(simpleInstance);
- em.getTransaction().commit();
-
- assertEquals(1, ((Number) em.createQuery("SELECT COUNT(s) FROM Simple s").getSingleResult()).intValue());
-
- DynamicEntity foundEntity = find(em, 1);
-
- assertNotNull(foundEntity);
- assertEquals(simpleInstance.get("id"), foundEntity.get("id"));
- assertEquals(simpleInstance.get("value1"), foundEntity.get("value1"));
- assertEquals(simpleInstance.get("value2"), foundEntity.get("value2"));
-
- em.close();
-
- return simpleInstance;
- }
-
- protected DynamicEntity find(EntityManager em, Object id) {
- return (DynamicEntity) em.find(getSimpleType().getJavaClass(), id);
- }
-
- @BeforeClass
- public static void setUp() {
- emf = Persistence.createEntityManagerFactory("empty");
- }
-
- @Before
- @After
- public void clearSimpleTypeInstances() {
- getSimpleType();
-
- if (emf != null && emf.isOpen()) {
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
- em.createQuery("DELETE FROM Simple").executeUpdate();
- em.getTransaction().commit();
- em.close();
- }
-
- JpaHelper.getServerSession(emf).getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- @AfterClass
- public static void shutdown() {
- if (emf != null && emf.isOpen()) {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.createNativeQuery("DROP TABLE SIMPLE_TYPE CASCADE CONSTRAINTS").executeUpdate();
- em.getTransaction().commit();
-
- em.close();
- emf.close();
- }
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/SimpleTypeCompositeKey.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/SimpleTypeCompositeKey.java
deleted file mode 100644
index ccc2ed6..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/SimpleTypeCompositeKey.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package testing.simple;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.Calendar;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.jpa.dynamic.DynamicIdentityPolicy;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-import org.junit.Assert;
-
-public class SimpleTypeCompositeKey extends SimpleType {
- @Override
- public void verifyConfig() throws Exception {
- super.verifyConfig();
-
- DynamicType type = getSimpleType();
- assertNotNull(type.getDescriptor().getCMPPolicy());
- assertEquals(Object[].class, ((DynamicIdentityPolicy) type.getDescriptor().getCMPPolicy()).getPKClass());
- }
-
- @Override
- protected DynamicType createSimpleType() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
- Class<?> javaType = dcl.createDynamicClass("model.Simple");
-
- DynamicTypeBuilder typeBuilder = new JPADynamicTypeBuilder(javaType, null, "SIMPLE_TYPE");
- typeBuilder.setPrimaryKeyFields("SID1", "SID2");
- typeBuilder.addDirectMapping("id1", int.class, "SID1");
- typeBuilder.addDirectMapping("id2", int.class, "SID2");
- typeBuilder.addDirectMapping("value1", String.class, "VAL_1");
- typeBuilder.addDirectMapping("value2", boolean.class, "VAL_2");
- typeBuilder.addDirectMapping("value3", Calendar.class, "VAL_3");
- typeBuilder.addDirectMapping("value4", Character.class, "VAL_4");
-
- helper.addTypes(true, false, typeBuilder.getType());
-
- return typeBuilder.getType();
- }
-
- @Override
- protected void assertDefaultValues(DynamicEntity simpleInstance) {
- assertNotNull(simpleInstance);
-
- assertTrue("id1 not set on new instance", simpleInstance.isSet("id1"));
- assertEquals("id1 not default value", 0, simpleInstance.get("id1"));
- assertTrue("id2 not set on new instance", simpleInstance.isSet("id2"));
- assertEquals("id2 not default value", 0, simpleInstance.get("id2"));
- assertFalse("value1 set on new instance", simpleInstance.isSet("value1"));
- assertTrue("value2 not set on new instance", simpleInstance.isSet("value2"));
- assertEquals("value2 not default value", false, simpleInstance.get("value2"));
- assertFalse("value3 set on new instance", simpleInstance.isSet("value3"));
- assertFalse("value4 set on new instance", simpleInstance.isSet("value4"));
- }
-
- public DynamicEntity createSimpleInstance(EntityManagerFactory emf, int id) {
- EntityManager em = emf.createEntityManager();
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleEntityType = helper.getType("Simple");
- Assert.assertNotNull(simpleEntityType);
-
- DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity();
- simpleInstance.set("id1", id);
- simpleInstance.set("id2", id);
- simpleInstance.set("value2", true);
-
- assertEquals(0, ((Number) em.createQuery("SELECT COUNT(s) FROM Simple s").getSingleResult()).intValue());
-
- em.getTransaction().begin();
- em.persist(simpleInstance);
- em.getTransaction().commit();
-
- assertEquals(1, ((Number) em.createQuery("SELECT COUNT(s) FROM Simple s").getSingleResult()).intValue());
-
- DynamicEntity foundEntity = find(em, 1);
-
- assertNotNull(foundEntity);
- assertEquals(simpleInstance.get("id1"), foundEntity.get("id1"));
- assertEquals(simpleInstance.get("id2"), foundEntity.get("id2"));
- assertEquals(simpleInstance.get("value1"), foundEntity.get("value1"));
- assertEquals(simpleInstance.get("value2"), foundEntity.get("value2"));
-
- em.close();
-
- return simpleInstance;
- }
-
- @Override
- protected DynamicEntity find(EntityManager em, Object id) {
- return (DynamicEntity) em.find(getSimpleType().getJavaClass(), new Object[] { id, id });
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/AllTests.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/AllTests.java
deleted file mode 100644
index 4ff207c..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/AllTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.simple.mappings;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { SimpleTypes_OneToOne.class, SimpleTypes_AggregateObject.class, SimpleTypes_MultiTable.class, SimpleTypes_OneToMany.class, SimpleTypes_ManyToMany.class })
-public class AllTests {
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_AggregateObject.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_AggregateObject.java
deleted file mode 100644
index 9113b0a..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_AggregateObject.java
+++ /dev/null
@@ -1,250 +0,0 @@
-package testing.simple.mappings;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.internal.descriptors.changetracking.AggregateAttributeChangeListener;
-import org.eclipse.persistence.internal.dynamic.*;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-import org.eclipse.persistence.mappings.AggregateObjectMapping;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class SimpleTypes_AggregateObject {
-
- private static EntityManagerFactory emf;
-
- @Test
- public void verifyConfig() throws Exception {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- ClassDescriptor descriptorA = helper.getSession().getClassDescriptorForAlias("SimpleA");
- assertNotNull("No descriptor found for alias='SimpleA'", descriptorA);
-
- DynamicTypeImpl simpleTypeA = (DynamicTypeImpl) helper.getType("SimpleA");
- assertNotNull("'SimpleA' EntityType not found", simpleTypeA);
- assertEquals(descriptorA, simpleTypeA.getDescriptor());
- DirectToFieldMapping a_id = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("id");
- assertEquals(int.class, a_id.getAttributeClassification());
- DirectToFieldMapping a_value1 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value1");
- assertEquals(String.class, a_value1.getAttributeClassification());
-
- ClassDescriptor descriptorB = helper.getSession().getClassDescriptorForAlias("SimpleB");
- assertNotNull("No descriptor found for alias='SimpleB'", descriptorB);
-
- DynamicTypeImpl simpleTypeB = (DynamicTypeImpl) helper.getType("SimpleB");
- assertNotNull("'SimpleB' EntityType not found", simpleTypeB);
- assertEquals(descriptorB, simpleTypeB.getDescriptor());
- DirectToFieldMapping b_value2 = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("value2");
- assertEquals(boolean.class, b_value2.getAttributeClassification());
- DirectToFieldMapping b_value3 = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("value3");
- assertEquals(String.class, b_value3.getAttributeClassification());
- assertTrue(descriptorB.isAggregateDescriptor());
-
- AggregateObjectMapping a_b = (AggregateObjectMapping) descriptorA.getMappingForAttributeName("b");
- assertSame(descriptorB.getJavaClass(), a_b.getReferenceDescriptor().getJavaClass());
- assertTrue(a_b.isNullAllowed());
-
- ClassDescriptor descriptorC = helper.getSession().getClassDescriptorForAlias("SimpleC");
- assertNotNull("No descriptor found for alias='SimpleB'", descriptorB);
-
- DynamicTypeImpl simpleTypeC = (DynamicTypeImpl) helper.getType("SimpleC");
- assertNotNull("'SimpleC' EntityType not found", simpleTypeC);
- assertEquals(descriptorB, simpleTypeB.getDescriptor());
- DirectToFieldMapping c_value4 = (DirectToFieldMapping) descriptorC.getMappingForAttributeName("value4");
- assertEquals(double.class, c_value4.getAttributeClassification());
- DirectToFieldMapping c_value5 = (DirectToFieldMapping) descriptorC.getMappingForAttributeName("value5");
- assertEquals(String.class, c_value5.getAttributeClassification());
- assertTrue(descriptorB.isAggregateDescriptor());
-
- AggregateObjectMapping a_c = (AggregateObjectMapping) descriptorA.getMappingForAttributeName("c");
- assertSame(descriptorC.getJavaClass(), a_c.getReferenceDescriptor().getJavaClass());
- assertFalse(a_c.isNullAllowed());
- }
-
- @Test
- public void verifyProperties() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicTypeImpl simpleTypeA = (DynamicTypeImpl) helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- assertEquals(4, simpleTypeA.getNumberOfProperties());
- assertEquals("id", simpleTypeA.getPropertiesNames().get(0));
- assertEquals("value1", simpleTypeA.getPropertiesNames().get(1));
- assertEquals("b", simpleTypeA.getPropertiesNames().get(2));
- assertEquals("c", simpleTypeA.getPropertiesNames().get(3));
- }
-
- @Test
- public void createSimpleA() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicTypeImpl simpleTypeA = (DynamicTypeImpl) helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- DynamicEntity a = simpleTypeA.newDynamicEntity();
-
- assertNotNull(a);
- assertTrue(a.isSet("id"));
- assertFalse(a.isSet("value1"));
- assertFalse(a.isSet("b"));
- assertTrue(a.isSet("c"));
-
- DynamicEntity c = a.<DynamicEntity>get("c");
- assertNotNull(c);
- assertTrue(c.isSet("value4"));
- assertFalse(c.isSet("value5"));
- }
-
- @Test
- public void persistSimpleA() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicTypeImpl simpleTypeA = (DynamicTypeImpl) helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "A1");
-
- em.getTransaction().begin();
- em.persist(simpleInstance);
- em.getTransaction().commit();
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleA s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCount);
-
- em.close();
- }
-
- @Test
- public void verifyChangTracking() {
- persistSimpleA();
-
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicTypeImpl simpleTypeA = (DynamicTypeImpl) helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
-
- DynamicEntityImpl a = (DynamicEntityImpl) em.find(simpleTypeA.getJavaClass(), 1);
- assertNotNull(a);
- assertNotNull(a._persistence_getPropertyChangeListener());
-
- DynamicEntityImpl c = a.<DynamicEntityImpl>get("c");
- assertNotNull(c);
- assertNotNull(c._persistence_getPropertyChangeListener());
- assertTrue(c._persistence_getPropertyChangeListener() instanceof AggregateAttributeChangeListener);
-
- em.getTransaction().rollback();
- em.close();
- }
-
- @Test
- public void createSimpleAwithSimpleB() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- EntityManager em = emf.createEntityManager();
-
- Assert.assertNotNull(helper.getSession().getDescriptorForAlias("SimpleB"));
-
- DynamicEntity simpleInstanceB = simpleTypeB.newDynamicEntity();
- simpleInstanceB.set("value2", true);
- simpleInstanceB.set("value3", "B2");
-
- DynamicEntity simpleInstanceA = simpleTypeA.newDynamicEntity();
- simpleInstanceA.set("id", 2);
- simpleInstanceA.set("value1", "A2");
- simpleInstanceA.set("b", simpleInstanceB);
-
- em.getTransaction().begin();
- em.persist(simpleInstanceA);
- em.getTransaction().commit();
-
- int simpleCountA = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleA s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCountA);
-
- em.close();
- }
-
- @BeforeClass
- public static void setUp() {
- emf = Persistence.createEntityManagerFactory("empty");
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> simpleTypeB = dcl.createDynamicClass("model.SimpleB");
- DynamicTypeBuilder bFactory = new JPADynamicTypeBuilder(simpleTypeB, null);
- bFactory.addDirectMapping("value2", boolean.class, "VAL_2");
- bFactory.addDirectMapping("value3", String.class, "VAL_3");
-
- Class<?> simpleTypeC = dcl.createDynamicClass("model.SimpleC");
- DynamicTypeBuilder cFactory = new JPADynamicTypeBuilder(simpleTypeC, null);
- cFactory.addDirectMapping("value4", double.class, "VAL_4");
- cFactory.addDirectMapping("value5", String.class, "VAL_5");
-
- Class<?> simpleTypeA = dcl.createDynamicClass("model.SimpleA");
- DynamicTypeBuilder aFactory = new JPADynamicTypeBuilder(simpleTypeA, null, "SIMPLE_TYPE_A");
- aFactory.setPrimaryKeyFields("SID");
- aFactory.addDirectMapping("id", int.class, "SID");
- aFactory.addDirectMapping("value1", String.class, "VAL_1");
- aFactory.addAggregateObjectMapping("b", bFactory.getType(), true);
- aFactory.addAggregateObjectMapping("c", cFactory.getType(), false);
-
- helper.addTypes(true, true, aFactory.getType(), bFactory.getType(), cFactory.getType());
-
- }
-
- @After
- public void clearDynamicTables() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.createQuery("DELETE FROM SimpleA").executeUpdate();
- em.getTransaction().commit();
- em.close();
- }
-
- @AfterClass
- public static void shutdown() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.createNativeQuery("DROP TABLE SIMPLE_TYPE_A CASCADE CONSTRAINTS").executeUpdate();
- em.getTransaction().commit();
-
- em.close();
- emf.close();
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_ManyToMany.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_ManyToMany.java
deleted file mode 100644
index f498d95..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_ManyToMany.java
+++ /dev/null
@@ -1,236 +0,0 @@
-package testing.simple.mappings;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-
-import java.util.Collection;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.exceptions.DatabaseException;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.mappings.ManyToManyMapping;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class SimpleTypes_ManyToMany {
-
- private static EntityManagerFactory emf;
-
- @Test
- public void verifyConfig() throws Exception {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- ClassDescriptor descriptorA = helper.getSession().getClassDescriptorForAlias("SimpleA");
- assertNotNull("No descriptor found for alias='SimpleA'", descriptorA);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- assertNotNull("'SimpleA' EntityType not found", simpleTypeA);
- assertEquals(descriptorA, simpleTypeA.getDescriptor());
- DirectToFieldMapping a_id = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("id");
- assertEquals(int.class, a_id.getAttributeClassification());
- DirectToFieldMapping a_value1 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value1");
- assertEquals(String.class, a_value1.getAttributeClassification());
-
- ClassDescriptor descriptorB = helper.getSession().getClassDescriptorForAlias("SimpleB");
- assertNotNull("No descriptor found for alias='SimpleB'", descriptorB);
-
- DynamicType simpleTypeB = helper.getType("SimpleB");
- assertNotNull("'SimpleB' EntityType not found", simpleTypeB);
- assertEquals(descriptorB, simpleTypeB.getDescriptor());
- DirectToFieldMapping b_id = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("id");
- assertEquals(int.class, b_id.getAttributeClassification());
- DirectToFieldMapping b_value1 = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("value1");
- assertEquals(String.class, b_value1.getAttributeClassification());
-
- ManyToManyMapping a_b = (ManyToManyMapping) descriptorA.getMappingForAttributeName("b");
- assertEquals(descriptorB, a_b.getReferenceDescriptor());
- }
-
- @Test
- public void createSimpleA() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "A1");
-
- em.getTransaction().begin();
- em.persist(simpleInstance);
- em.getTransaction().commit();
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleA s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCount);
-
- em.close();
- }
-
- @Test
- public void createSimpleB() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance = simpleTypeB.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "B1");
-
- em.getTransaction().begin();
- em.persist(simpleInstance);
- em.getTransaction().commit();
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleB s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCount);
-
- em.close();
- }
-
- @Test
- public void createAwithB() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- EntityManager em = emf.createEntityManager();
-
- Assert.assertNotNull(JpaHelper.getServerSession(emf).getDescriptorForAlias("SimpleB"));
-
- DynamicEntity simpleInstanceB = simpleTypeB.newDynamicEntity();
- simpleInstanceB.set("id", 1);
- simpleInstanceB.set("value1", "B2");
-
- DynamicEntity simpleInstanceA = simpleTypeA.newDynamicEntity();
- simpleInstanceA.set("id", 1);
- simpleInstanceA.set("value1", "A2");
- simpleInstanceA.<Collection<DynamicEntity>> get("b").add(simpleInstanceB);
-
- simpleInstanceB.set("a", simpleInstanceA);
-
- em.getTransaction().begin();
- em.persist(simpleInstanceB);
- em.persist(simpleInstanceA);
- em.getTransaction().commit();
-
- int simpleCountB = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleB s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCountB);
- int simpleCountA = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleA s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCountA);
-
- em.close();
- }
-
- @Test
- public void createAwithExistingB() {
- // TODO Assert.fail("Not Yet Implemented");
- }
-
- @Test
- public void removeRelationshop() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- createAwithB();
-
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
-
- DynamicEntity a = (DynamicEntity) em.find(simpleTypeA.getJavaClass(), 1);
- assertNotNull(a);
- List<DynamicEntity> bs = a.<List<DynamicEntity>> get("b");
- assertNotNull(bs);
- assertEquals(1, bs.size());
- bs.remove(0);
-
- em.getTransaction().commit();
- }
-
- @Test
- public void addAtoB() {
- // TODO Assert.fail("Not Yet Implemented");
- }
-
- @BeforeClass
- public static void setUp() {
- emf = Persistence.createEntityManagerFactory("empty");
- DynamicHelper helper = new JPADynamicHelper(emf);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> simpleTypeA = dcl.createDynamicClass("model.SimpleA");
- DynamicTypeBuilder aFactory = new JPADynamicTypeBuilder(simpleTypeA, null, "SIMPLE_TYPE_A");
- aFactory.setPrimaryKeyFields("SID");
-
- Class<?> simpleTypeB = dcl.createDynamicClass("model.SimpleB");
- DynamicTypeBuilder bFactory = new JPADynamicTypeBuilder(simpleTypeB, null, "SIMPLE_TYPE_B");
- bFactory.setPrimaryKeyFields("SID");
-
- bFactory.addDirectMapping("id", int.class, "SID");
- bFactory.addDirectMapping("value1", String.class, "VAL_1");
- bFactory.addOneToOneMapping("a", aFactory.getType(), "A_FK");
-
- aFactory.addDirectMapping("id", int.class, "SID");
- aFactory.addDirectMapping("value1", String.class, "VAL_1");
- aFactory.addManyToManyMapping("b", bFactory.getType(), "SIMPLE_A_B");
-
- helper.addTypes(true, true, aFactory.getType(), bFactory.getType());
- }
-
- @After
- public void clearDynamicTables() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.createNativeQuery("DELETE FROM SIMPLE_A_B").executeUpdate();
- em.createQuery("DELETE FROM SimpleB").executeUpdate();
- em.createQuery("DELETE FROM SimpleA").executeUpdate();
- em.getTransaction().commit();
- em.close();
- }
-
- @AfterClass
- public static void shutdown() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- try {
- em.createNativeQuery("DROP TABLE SIMPLE_A_B CASCADE CONSTRAINTS").executeUpdate();
- em.createNativeQuery("DROP TABLE SIMPLE_TYPE_A CASCADE CONSTRAINTS").executeUpdate();
- em.createNativeQuery("DROP TABLE SIMPLE_TYPE_B CASCADE CONSTRAINTS").executeUpdate();
- } catch (DatabaseException dbe) {
- em.getTransaction().rollback();
- }
- if (em.getTransaction().isActive()) {
- em.getTransaction().commit();
- }
-
- em.close();
- emf.close();
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_MultiTable.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_MultiTable.java
deleted file mode 100644
index 024e800..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_MultiTable.java
+++ /dev/null
@@ -1,193 +0,0 @@
-package testing.simple.mappings;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.internal.dynamic.DynamicEntityImpl;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class SimpleTypes_MultiTable {
-
- private static EntityManagerFactory emf;
-
- @Test
- public void verifyConfig() throws Exception {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- ClassDescriptor descriptorA = helper.getSession().getClassDescriptorForAlias("SimpleA");
- assertNotNull("No descriptor found for alias='SimpleA'", descriptorA);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- assertNotNull("'SimpleA' EntityType not found", simpleTypeA);
- assertEquals(descriptorA, simpleTypeA.getDescriptor());
-
- assertTrue(descriptorA.hasMultipleTables());
- assertEquals(3, descriptorA.getTables().size());
-
- DirectToFieldMapping a_id = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("id");
- assertEquals(int.class, a_id.getAttributeClassification());
- DirectToFieldMapping a_value1 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value1");
- assertEquals(String.class, a_value1.getAttributeClassification());
-
- DirectToFieldMapping a_value2 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value2");
- assertEquals(boolean.class, a_value2.getAttributeClassification());
-
- DirectToFieldMapping a_value3 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value3");
- assertEquals(String.class, a_value3.getAttributeClassification());
-
- DirectToFieldMapping a_value4 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value4");
- assertEquals(double.class, a_value4.getAttributeClassification());
-
- DirectToFieldMapping a_value5 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value5");
- assertEquals(String.class, a_value5.getAttributeClassification());
- }
-
- @Test
- public void verifyProperties() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- assertEquals(6, simpleTypeA.getNumberOfProperties());
- assertEquals("id", simpleTypeA.getPropertiesNames().get(0));
- assertEquals(int.class, simpleTypeA.getPropertyType(0));
- assertEquals("value1", simpleTypeA.getPropertiesNames().get(1));
- assertEquals(String.class, simpleTypeA.getPropertyType(1));
- assertEquals("value2", simpleTypeA.getPropertiesNames().get(2));
- assertEquals(boolean.class, simpleTypeA.getPropertyType(2));
- assertEquals("value3", simpleTypeA.getPropertiesNames().get(3));
- assertEquals(String.class, simpleTypeA.getPropertyType(3));
- assertEquals("value4", simpleTypeA.getPropertiesNames().get(4));
- assertEquals(double.class, simpleTypeA.getPropertyType(4));
- assertEquals("value5", simpleTypeA.getPropertiesNames().get(5));
- assertEquals(String.class, simpleTypeA.getPropertyType(5));
-
- }
-
- @Test
- public void createSimpleA() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- DynamicEntity a = simpleTypeA.newDynamicEntity();
-
- assertNotNull(a);
- assertTrue(a.isSet("id"));
- assertFalse(a.isSet("value1"));
- assertTrue(a.isSet("value2"));
- assertFalse(a.isSet("value3"));
- assertTrue(a.isSet("value4"));
- assertFalse(a.isSet("value5"));
- }
-
- @Test
- public void persistSimpleA() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "A1");
-
- em.getTransaction().begin();
- em.persist(simpleInstance);
- em.getTransaction().commit();
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleA s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCount);
-
- em.close();
- }
-
- @Test
- public void verifyChangeTracking() {
- persistSimpleA();
-
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
-
- DynamicEntityImpl a = (DynamicEntityImpl) em.find(simpleTypeA.getJavaClass(), 1);
- assertNotNull(a);
- assertNotNull(a._persistence_getPropertyChangeListener());
-
- em.getTransaction().rollback();
- em.close();
- }
-
- @BeforeClass
- public static void setUp() {
- emf = Persistence.createEntityManagerFactory("empty");
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
- Class<?> simpleTypeA = dcl.createDynamicClass("model.SimpleA");
-
- DynamicTypeBuilder typeBuilder = new JPADynamicTypeBuilder(simpleTypeA, null, "SIMPLE_TYPE_A", "SIMPLE_TYPE_B", "SIMPLE_TYPE_C");
- typeBuilder.setPrimaryKeyFields("SIMPLE_TYPE_A.SID");
- typeBuilder.addDirectMapping("id", int.class, "SIMPLE_TYPE_A.SID");
- typeBuilder.addDirectMapping("value1", String.class, "SIMPLE_TYPE_A.VAL_1");
- typeBuilder.addDirectMapping("value2", boolean.class, "SIMPLE_TYPE_B.VAL_2");
- typeBuilder.addDirectMapping("value3", String.class, "SIMPLE_TYPE_B.VAL_3");
- typeBuilder.addDirectMapping("value4", double.class, "SIMPLE_TYPE_C.VAL_4");
- typeBuilder.addDirectMapping("value5", String.class, "SIMPLE_TYPE_C.VAL_5");
-
- helper.addTypes(true, true, typeBuilder.getType());
- }
-
- @After
- public void clearDynamicTables() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.createQuery("DELETE FROM SimpleA").executeUpdate();
- em.getTransaction().commit();
- em.close();
- }
-
- @AfterClass
- public static void shutdown() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.createNativeQuery("DROP TABLE SIMPLE_TYPE_A CASCADE CONSTRAINTS").executeUpdate();
- em.createNativeQuery("DROP TABLE SIMPLE_TYPE_B CASCADE CONSTRAINTS").executeUpdate();
- em.createNativeQuery("DROP TABLE SIMPLE_TYPE_C CASCADE CONSTRAINTS").executeUpdate();
- em.getTransaction().commit();
-
- em.close();
- emf.close();
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_OneToMany.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_OneToMany.java
deleted file mode 100644
index 48c7ef6..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_OneToMany.java
+++ /dev/null
@@ -1,239 +0,0 @@
-package testing.simple.mappings;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-
-import java.util.Collection;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.exceptions.DatabaseException;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class SimpleTypes_OneToMany {
-
- private static EntityManagerFactory emf;
-
- @Test
- public void verifyConfig() throws Exception {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- ClassDescriptor descriptorA = helper.getSession().getClassDescriptorForAlias("SimpleA");
- assertNotNull("No descriptor found for alias='SimpleA'", descriptorA);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- assertNotNull("'SimpleA' EntityType not found", simpleTypeA);
- assertEquals(descriptorA, simpleTypeA.getDescriptor());
- DirectToFieldMapping a_id = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("id");
- assertEquals(int.class, a_id.getAttributeClassification());
- DirectToFieldMapping a_value1 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value1");
- assertEquals(String.class, a_value1.getAttributeClassification());
-
- ClassDescriptor descriptorB = helper.getSession().getClassDescriptorForAlias("SimpleB");
- assertNotNull("No descriptor found for alias='SimpleB'", descriptorB);
-
- DynamicType simpleTypeB = helper.getType("SimpleB");
- assertNotNull("'SimpleB' EntityType not found", simpleTypeB);
- assertEquals(descriptorB, simpleTypeB.getDescriptor());
- DirectToFieldMapping b_id = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("id");
- assertEquals(int.class, b_id.getAttributeClassification());
- DirectToFieldMapping b_value1 = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("value1");
- assertEquals(String.class, b_value1.getAttributeClassification());
-
- OneToManyMapping a_b = (OneToManyMapping) descriptorA.getMappingForAttributeName("b");
- assertEquals(descriptorB, a_b.getReferenceDescriptor());
- }
-
- @Test
- public void createSimpleA() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "A1");
-
- em.getTransaction().begin();
- em.persist(simpleInstance);
- em.getTransaction().commit();
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleA s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCount);
-
- em.close();
- }
-
- @Test
- public void createSimpleB() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance = simpleTypeB.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "B1");
-
- em.getTransaction().begin();
- em.persist(simpleInstance);
- em.getTransaction().commit();
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleB s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCount);
-
- em.close();
- }
-
- @Test
- public void createAwithB() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- EntityManager em = emf.createEntityManager();
-
- Assert.assertNotNull(JpaHelper.getServerSession(emf).getDescriptorForAlias("SimpleB"));
-
- DynamicEntity simpleInstanceB = simpleTypeB.newDynamicEntity();
- simpleInstanceB.set("id", 1);
- simpleInstanceB.set("value1", "B2");
-
- DynamicEntity simpleInstanceA = simpleTypeA.newDynamicEntity();
- simpleInstanceA.set("id", 1);
- simpleInstanceA.set("value1", "A2");
- simpleInstanceA.<Collection<DynamicEntity>> get("b").add(simpleInstanceB);
-
- simpleInstanceB.set("a", simpleInstanceA);
-
- em.getTransaction().begin();
- em.persist(simpleInstanceB);
- em.persist(simpleInstanceA);
- em.getTransaction().commit();
-
- int simpleCountB = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleB s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCountB);
- int simpleCountA = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleA s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCountA);
-
- em.close();
- }
-
- @Test
- public void removeAwithB_PrivateOwned() {
- createAwithB();
-
- DynamicHelper helper = new JPADynamicHelper(emf);
- DynamicType simpleAType = helper.getType("SimpleA");
-
- ((OneToManyMapping) simpleAType.getDescriptor().getMappingForAttributeName("b")).setIsPrivateOwned(true);
-
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
-
- DynamicEntity a = (DynamicEntity) em.find(simpleAType.getJavaClass(), 1);
- assertNotNull(a);
- assertEquals(1, a.<Collection> get("b").size());
-
- em.remove(a);
- // em.remove(a.get("b", List.class).get(0));
-
- em.getTransaction().commit();
- }
-
- @Test
- public void createAwithExistingB() {
- // TODO Assert.fail("Not Yet Implemented");
- }
-
- @Test
- public void removeBfromA() {
- // TODO Assert.fail("Not Yet Implemented");
- }
-
- @Test
- public void addAtoB() {
- // TODO Assert.fail("Not Yet Implemented");
- }
-
- @BeforeClass
- public static void setUp() {
- emf = Persistence.createEntityManagerFactory("empty");
- DynamicHelper helper = new JPADynamicHelper(emf);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> simpleTypeA = dcl.createDynamicClass("model.SimpleA");
- DynamicTypeBuilder aTypeBuilder = new JPADynamicTypeBuilder(simpleTypeA, null, "SIMPLE_TYPE_A");
- aTypeBuilder.setPrimaryKeyFields("SID");
-
- Class<?> simpleTypeB = dcl.createDynamicClass("model.SimpleB");
- DynamicTypeBuilder bTypeBuilder = new JPADynamicTypeBuilder(simpleTypeB, null, "SIMPLE_TYPE_B");
- bTypeBuilder.setPrimaryKeyFields("SID");
-
- bTypeBuilder.addDirectMapping("id", int.class, "SID");
- bTypeBuilder.addDirectMapping("value1", String.class, "VAL_1");
- bTypeBuilder.addOneToOneMapping("a", aTypeBuilder.getType(), "A_FK");
-
- aTypeBuilder.addDirectMapping("id", int.class, "SID");
- aTypeBuilder.addDirectMapping("value1", String.class, "VAL_1");
- aTypeBuilder.addOneToManyMapping("b", bTypeBuilder.getType(), "A_FK");
-
- helper.addTypes(true, true, aTypeBuilder.getType(), bTypeBuilder.getType());
- }
-
- @After
- public void clearDynamicTables() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.createQuery("DELETE FROM SimpleB").executeUpdate();
- em.createQuery("DELETE FROM SimpleA").executeUpdate();
- em.getTransaction().commit();
- em.close();
- }
-
- @AfterClass
- public static void shutdown() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- try {
- em.createNativeQuery("DROP TABLE SIMPLE_TYPE_A CASCADE CONSTRAINTS").executeUpdate();
- em.createNativeQuery("DROP TABLE SIMPLE_TYPE_B CASCADE CONSTRAINTS").executeUpdate();
- } catch (DatabaseException dbe) {
- // ignore
- }
- em.getTransaction().commit();
-
- em.close();
- emf.close();
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_OneToOne.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_OneToOne.java
deleted file mode 100644
index f9ef7b3..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/mappings/SimpleTypes_OneToOne.java
+++ /dev/null
@@ -1,218 +0,0 @@
-package testing.simple.mappings;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.fail;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.exceptions.DynamicException;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.mappings.OneToOneMapping;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class SimpleTypes_OneToOne {
-
- private static EntityManagerFactory emf;
-
- @Test
- public void verifyConfig() throws Exception {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- ClassDescriptor descriptorA = helper.getSession().getClassDescriptorForAlias("SimpleA");
- assertNotNull("No descriptor found for alias='SimpleA'", descriptorA);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- assertNotNull("'SimpleA' EntityType not found", simpleTypeA);
- assertEquals(descriptorA, simpleTypeA.getDescriptor());
- DirectToFieldMapping a_id = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("id");
- assertEquals(int.class, a_id.getAttributeClassification());
- DirectToFieldMapping a_value1 = (DirectToFieldMapping) descriptorA.getMappingForAttributeName("value1");
- assertEquals(String.class, a_value1.getAttributeClassification());
-
- ClassDescriptor descriptorB = helper.getSession().getClassDescriptorForAlias("SimpleB");
- assertNotNull("No descriptor found for alias='SimpleB'", descriptorB);
-
- DynamicType simpleTypeB = helper.getType("SimpleB");
- assertNotNull("'SimpleB' EntityType not found", simpleTypeB);
- assertEquals(descriptorB, simpleTypeB.getDescriptor());
- DirectToFieldMapping b_id = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("id");
- assertEquals(int.class, b_id.getAttributeClassification());
- DirectToFieldMapping b_value1 = (DirectToFieldMapping) descriptorB.getMappingForAttributeName("value1");
- assertEquals(String.class, b_value1.getAttributeClassification());
-
- OneToOneMapping a_b = (OneToOneMapping) descriptorA.getMappingForAttributeName("b");
- assertEquals(descriptorB, a_b.getReferenceDescriptor());
- }
-
- @Test
- public void createSimpleA() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "A1");
-
- em.getTransaction().begin();
- em.persist(simpleInstance);
- em.getTransaction().commit();
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleA s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCount);
-
- em.close();
- }
-
- @Test
- public void createSimpleB() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance = simpleTypeB.newDynamicEntity();
- simpleInstance.set("id", 1);
- simpleInstance.set("value1", "B1");
-
- em.getTransaction().begin();
- em.persist(simpleInstance);
- em.getTransaction().commit();
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleB s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCount);
-
- em.close();
- }
-
- @Test
- public void createSimpleAwithSimpleB() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- EntityManager em = emf.createEntityManager();
-
- Assert.assertNotNull(JpaHelper.getServerSession(emf).getDescriptorForAlias("SimpleB"));
-
- DynamicEntity simpleInstanceB = simpleTypeB.newDynamicEntity();
- simpleInstanceB.set("id", 2);
- simpleInstanceB.set("value1", "B2");
-
- DynamicEntity simpleInstanceA = simpleTypeA.newDynamicEntity();
- simpleInstanceA.set("id", 2);
- simpleInstanceA.set("value1", "A2");
- simpleInstanceA.set("b", simpleInstanceB);
-
- em.getTransaction().begin();
- em.persist(simpleInstanceB);
- em.persist(simpleInstanceA);
- em.getTransaction().commit();
-
- int simpleCountB = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleB s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCountB);
- int simpleCountA = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleA s").getSingleResult()).intValue();
- Assert.assertEquals(1, simpleCountA);
-
- em.close();
- }
-
- @Test
- public void invalidTypeSet() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleTypeA = helper.getType("SimpleA");
- Assert.assertNotNull(simpleTypeA);
- DynamicType simpleTypeB = helper.getType("SimpleB");
- Assert.assertNotNull(simpleTypeB);
-
- Assert.assertNotNull(JpaHelper.getServerSession(emf).getDescriptorForAlias("SimpleB"));
-
- DynamicEntity simpleInstanceB = simpleTypeB.newDynamicEntity();
- simpleInstanceB.set("id", 2);
- simpleInstanceB.set("value1", "B2");
-
- DynamicEntity simpleInstanceA = simpleTypeA.newDynamicEntity();
- simpleInstanceA.set("id", 2);
- simpleInstanceA.set("value1", "A2");
-
- try {
- simpleInstanceA.set("b", simpleInstanceA);
- } catch (DynamicException de) {
- return;
- }
- fail("Should have caught DynamicException for invalid set type");
- }
-
- @BeforeClass
- public static void setUp() {
- emf = Persistence.createEntityManagerFactory("empty");
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> simpleTypeB = dcl.createDynamicClass("model.SimpleB");
- DynamicTypeBuilder bFactory = new JPADynamicTypeBuilder(simpleTypeB, null, "SIMPLE_TYPE_B");
- bFactory.setPrimaryKeyFields("SID");
- bFactory.addDirectMapping("id", int.class, "SID");
- bFactory.addDirectMapping("value1", String.class, "VAL_1");
-
- Class<?> simpleTypeA = dcl.createDynamicClass("model.SimpleA");
- DynamicTypeBuilder aFactory = new JPADynamicTypeBuilder(simpleTypeA, null, "SIMPLE_TYPE_A");
- aFactory.setPrimaryKeyFields("SID");
- aFactory.addDirectMapping("id", int.class, "SID");
- aFactory.addDirectMapping("value1", String.class, "VAL_1");
- aFactory.addOneToOneMapping("b", bFactory.getType(), "B_FK").setCascadePersist(true);
-
- helper.addTypes(true, true, aFactory.getType(), bFactory.getType());
- }
-
- @After
- public void clearDynamicTables() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.createQuery("DELETE FROM SimpleA").executeUpdate();
- em.createQuery("DELETE FROM SimpleB").executeUpdate();
- em.getTransaction().commit();
- em.close();
- }
-
- @AfterClass
- public static void shutdown() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.createNativeQuery("DROP TABLE SIMPLE_TYPE_A CASCADE CONSTRAINTS").executeUpdate();
- em.createNativeQuery("DROP TABLE SIMPLE_TYPE_B CASCADE CONSTRAINTS").executeUpdate();
- em.getTransaction().commit();
-
- em.close();
- emf.close();
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/AllTests.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/AllTests.java
deleted file mode 100644
index ed8eefa..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/AllTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing.simple.sequencing;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { DefaultSequencing.class, TableSequencing.class, UnaryTableSequencing.class, NativeSequencing.class })
-public class AllTests {
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/DefaultSequencing.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/DefaultSequencing.java
deleted file mode 100644
index ab8f248..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/DefaultSequencing.java
+++ /dev/null
@@ -1,174 +0,0 @@
-package testing.simple.sequencing;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.internal.dynamic.DynamicTypeImpl;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-import org.eclipse.persistence.sequencing.TableSequence;
-import org.eclipse.persistence.sessions.IdentityMapAccessor;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class DefaultSequencing {
-
- private static EntityManagerFactory emf;
-
- public static final String TABLE_NAME = "SIMPLE_TABLE_SEQ";
-
- public static final String ENTITY_TYPE = "Simple";
-
- @Test
- public void verifyConfig() throws Exception {
- Server session = JpaHelper.getServerSession(emf);
-
- ClassDescriptor descriptor = session.getClassDescriptorForAlias(ENTITY_TYPE);
- assertNotNull("No descriptor found for alias: " + ENTITY_TYPE, descriptor);
-
- DynamicHelper helper = new DynamicHelper(session);
- DynamicTypeImpl simpleType = (DynamicTypeImpl) helper.getType(ENTITY_TYPE);
- assertNotNull("EntityType not found for alias: " + ENTITY_TYPE, simpleType);
-
- assertEquals(descriptor, simpleType.getDescriptor());
- }
-
- @Test
- public void createSingleInstances() {
- Server session = JpaHelper.getServerSession(emf);
- DynamicHelper helper = new DynamicHelper(session);
- DynamicTypeImpl simpleType = (DynamicTypeImpl) helper.getType(ENTITY_TYPE);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance = createSimpleInstance(emf, 1);
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(o) FROM " + ENTITY_TYPE + " o").getSingleResult()).intValue();
- assertEquals(1, simpleCount);
-
- IdentityMapAccessor cache = session.getIdentityMapAccessor();
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance));
-
- em.clear();
- cache.initializeAllIdentityMaps();
-
- DynamicEntity findResult = (DynamicEntity) em.find(simpleType.getJavaClass(), 1);
-
- assertNotNull(findResult);
- assertEquals(simpleInstance.get("id"), findResult.get("id"));
- assertEquals(simpleInstance.get("value1"), findResult.get("value1"));
-
- em.close();
- }
-
- @Test
- public void createTwoInstances() {
- EntityManager em = emf.createEntityManager();
- DynamicHelper helper = new JPADynamicHelper(em);
- DynamicTypeImpl simpleType = (DynamicTypeImpl) helper.getType(ENTITY_TYPE);
-
- DynamicEntity simpleInstance1 = createSimpleInstance(emf, 1);
- DynamicEntity simpleInstance2 = createSimpleInstance(emf, 2);
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(o) FROM " + ENTITY_TYPE + " o").getSingleResult()).intValue();
- assertEquals(2, simpleCount);
-
- IdentityMapAccessor cache = helper.getSession().getIdentityMapAccessor();
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance1));
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance2));
-
- em.clear();
- cache.initializeAllIdentityMaps();
-
- DynamicEntity findResult1 = (DynamicEntity) em.find(simpleType.getJavaClass(), 1);
- DynamicEntity findResult2 = (DynamicEntity) em.find(simpleType.getJavaClass(), 2);
-
- assertNotNull(findResult1);
- assertNotNull(findResult2);
- assertEquals(simpleInstance1.get("id"), findResult1.get("id"));
- assertEquals(simpleInstance2.get("value1"), findResult2.get("value1"));
-
- em.close();
- }
-
- public DynamicEntity createSimpleInstance(EntityManagerFactory emf, int expectedId) {
- EntityManager em = emf.createEntityManager();
- DynamicHelper helper = new JPADynamicHelper(em);
-
- DynamicType simpleEntityType = helper.getType(ENTITY_TYPE);
- Assert.assertNotNull(simpleEntityType);
-
- DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity();
- simpleInstance.set("value1", TABLE_NAME);
-
- em.getTransaction().begin();
- assertEquals(0, simpleInstance.get("id"));
- em.persist(simpleInstance);
- assertEquals(expectedId, simpleInstance.get("id"));
- em.getTransaction().commit();
-
- em.close();
- return simpleInstance;
- }
-
- @BeforeClass
- public static void setUp() {
- emf = Persistence.createEntityManagerFactory("empty");
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
- Class<?> javaType = dcl.createDynamicClass("model.sequencing." + ENTITY_TYPE);
-
- DynamicTypeBuilder typeBuilder = new JPADynamicTypeBuilder(javaType, null, TABLE_NAME);
- typeBuilder.setPrimaryKeyFields("SID");
- typeBuilder.addDirectMapping("id", int.class, "SID");
- typeBuilder.addDirectMapping("value1", String.class, "VAL_1");
-
- TableSequence defaultSequence = (TableSequence) helper.getSession().getLogin().getDefaultSequence();
- defaultSequence.setTableName("TEST_SEQ");
- typeBuilder.configureSequencing(ENTITY_TYPE + "_SEQ", "SID");
-
- helper.addTypes(true, true, typeBuilder.getType());
- }
-
- @Before
- public void clearSimpleTypeInstances() {
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
- em.createQuery("DELETE FROM " + ENTITY_TYPE).executeUpdate();
- em.createNativeQuery("UPDATE TEST_SEQ SET SEQ_COUNT = 0").executeUpdate();
- em.getTransaction().commit();
- em.close();
-
- JpaHelper.getServerSession(emf).getSequencingControl().initializePreallocated();
- }
-
- @AfterClass
- public static void shutdown() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.createNativeQuery("DROP TABLE " + TABLE_NAME + " CASCADE CONSTRAINTS").executeUpdate();
- em.createNativeQuery("DROP TABLE TEST_SEQ CASCADE CONSTRAINTS").executeUpdate();
- em.getTransaction().commit();
-
- em.close();
- emf.close();
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/NativeSequencing.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/NativeSequencing.java
deleted file mode 100644
index 508e5d4..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/NativeSequencing.java
+++ /dev/null
@@ -1,177 +0,0 @@
-package testing.simple.sequencing;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.internal.dynamic.DynamicTypeImpl;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-import org.eclipse.persistence.sequencing.NativeSequence;
-import org.eclipse.persistence.sessions.IdentityMapAccessor;
-import org.eclipse.persistence.sessions.server.Server;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class NativeSequencing {
-
- private static EntityManagerFactory emf;
-
- public static final String TABLE_NAME = "SIMPLE_TABLE_SEQ";
-
- public static final String ENTITY_TYPE = "Simple";
-
- @Test
- public void verifyConfig() throws Exception {
- Server session = JpaHelper.getServerSession(emf);
-
- ClassDescriptor descriptor = session.getClassDescriptorForAlias(ENTITY_TYPE);
- assertNotNull("No descriptor found for alias: " + ENTITY_TYPE, descriptor);
-
- DynamicTypeImpl simpleType = (DynamicTypeImpl) new JPADynamicHelper(emf).getType(ENTITY_TYPE);
- assertNotNull("EntityType not found for alias: " + ENTITY_TYPE, simpleType);
-
- assertEquals(descriptor, simpleType.getDescriptor());
- }
-
- @Test
- public void createSingleInstances() {
- DynamicHelper helper = new JPADynamicHelper(emf);
- DynamicTypeImpl simpleType = (DynamicTypeImpl) helper.getType(ENTITY_TYPE);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance = createSimpleInstance(emf, 1);
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(o) FROM " + ENTITY_TYPE + " o").getSingleResult()).intValue();
- assertEquals(1, simpleCount);
-
- IdentityMapAccessor cache = helper.getSession().getIdentityMapAccessor();
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance));
-
- em.clear();
- cache.initializeAllIdentityMaps();
-
- DynamicEntity findResult = (DynamicEntity) em.find(simpleType.getJavaClass(), 1);
-
- assertNotNull(findResult);
- assertEquals(simpleInstance.get("id"), findResult.get("id"));
- assertEquals(simpleInstance.get("value1"), findResult.get("value1"));
-
- em.close();
- }
-
- @Test
- public void createTwoInstances() {
- DynamicHelper helper = new JPADynamicHelper(emf);
- DynamicTypeImpl simpleType = (DynamicTypeImpl) helper.getType(ENTITY_TYPE);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance1 = createSimpleInstance(emf, 1);
- DynamicEntity simpleInstance2 = createSimpleInstance(emf, 2);
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(o) FROM " + ENTITY_TYPE + " o").getSingleResult()).intValue();
- assertEquals(2, simpleCount);
-
- IdentityMapAccessor cache = helper.getSession().getIdentityMapAccessor();
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance1));
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance2));
-
- em.clear();
- cache.initializeAllIdentityMaps();
-
- DynamicEntity findResult1 = (DynamicEntity) em.find(simpleType.getJavaClass(), 1);
- DynamicEntity findResult2 = (DynamicEntity) em.find(simpleType.getJavaClass(), 2);
-
- assertNotNull(findResult1);
- assertNotNull(findResult2);
- assertEquals(simpleInstance1.get("id"), findResult1.get("id"));
- assertEquals(simpleInstance2.get("value1"), findResult2.get("value1"));
-
- em.close();
- }
-
- public DynamicEntity createSimpleInstance(EntityManagerFactory emf, int expectedId) {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- EntityManager em = emf.createEntityManager();
- DynamicType simpleEntityType = helper.getType(ENTITY_TYPE);
- Assert.assertNotNull(simpleEntityType);
-
- DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity();
- simpleInstance.set("value1", TABLE_NAME);
-
- em.getTransaction().begin();
- assertEquals(0, simpleInstance.get("id"));
- em.persist(simpleInstance);
- assertEquals(expectedId, simpleInstance.get("id"));
- em.getTransaction().commit();
-
- em.close();
- return simpleInstance;
- }
-
- @BeforeClass
- public static void setUp() {
- emf = Persistence.createEntityManagerFactory("empty");
- DynamicHelper helper = new JPADynamicHelper(emf);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> javaType = dcl.createDynamicClass("model.sequencing." + ENTITY_TYPE);
-
- DynamicTypeBuilder typeBuilder = new JPADynamicTypeBuilder(javaType, null, TABLE_NAME);
- typeBuilder.setPrimaryKeyFields("SID");
- typeBuilder.addDirectMapping("id", int.class, "SID");
- typeBuilder.addDirectMapping("value1", String.class, "VAL_1");
-
- NativeSequence sequence = new NativeSequence();
- sequence.setPreallocationSize(5);
- helper.getSession().getProject().getLogin().setDefaultSequence(sequence);
- sequence.onConnect(helper.getSession().getPlatform());
- typeBuilder.configureSequencing(sequence, ENTITY_TYPE + "_SEQ", "SID");
-
- helper.addTypes(true, true, typeBuilder.getType());
- }
-
- @Before
- public void clearSimpleTypeInstances() {
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
- em.createQuery("DELETE FROM " + ENTITY_TYPE).executeUpdate();
- em.getTransaction().commit();
- em.close();
-
- Server session = JpaHelper.getServerSession(emf);
- new SchemaManager(session).replaceSequences();
- session.getSequencingControl().initializePreallocated();
- }
-
- @AfterClass
- public static void shutdown() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.createNativeQuery("DROP TABLE " + TABLE_NAME + " CASCADE CONSTRAINTS").executeUpdate();
- em.createNativeQuery("DROP SEQUENCE Simple_SEQ").executeUpdate();
- em.getTransaction().commit();
-
- em.close();
- emf.close();
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/TableSequencing.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/TableSequencing.java
deleted file mode 100644
index 5a93f9f..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/TableSequencing.java
+++ /dev/null
@@ -1,178 +0,0 @@
-package testing.simple.sequencing;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-import org.eclipse.persistence.sequencing.TableSequence;
-import org.eclipse.persistence.sessions.IdentityMapAccessor;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class TableSequencing {
-
- private static EntityManagerFactory emf;
-
- public static final String TABLE_NAME = "SIMPLE_TABLE_SEQ";
-
- public static final String ENTITY_TYPE = "Simple";
-
- @Test
- public void verifyConfig() throws Exception {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- ClassDescriptor descriptor = helper.getSession().getClassDescriptorForAlias(ENTITY_TYPE);
- assertNotNull("No descriptor found for alias: " + ENTITY_TYPE, descriptor);
-
- DynamicType simpleType = helper.getType(ENTITY_TYPE);
- assertNotNull("EntityType not found for alias: " + ENTITY_TYPE, simpleType);
-
- assertEquals(descriptor, simpleType.getDescriptor());
- }
-
- @Test
- public void createSingleInstances() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleType = helper.getType(ENTITY_TYPE);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance = createSimpleInstance(emf, 1);
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(o) FROM " + ENTITY_TYPE + " o").getSingleResult()).intValue();
- assertEquals(1, simpleCount);
-
- IdentityMapAccessor cache = helper.getSession().getIdentityMapAccessor();
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance));
-
- em.clear();
- cache.initializeAllIdentityMaps();
-
- DynamicEntity findResult = (DynamicEntity) em.find(simpleType.getJavaClass(), 1);
-
- assertNotNull(findResult);
- assertEquals(simpleInstance.get("id"), findResult.get("id"));
- assertEquals(simpleInstance.get("value1"), findResult.get("value1"));
-
- em.close();
- }
-
- @Test
- public void createTwoInstances() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleType = helper.getType(ENTITY_TYPE);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance1 = createSimpleInstance(emf, 1);
- DynamicEntity simpleInstance2 = createSimpleInstance(emf, 2);
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(o) FROM " + ENTITY_TYPE + " o").getSingleResult()).intValue();
- assertEquals(2, simpleCount);
-
- IdentityMapAccessor cache = helper.getSession().getIdentityMapAccessor();
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance1));
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance2));
-
- em.clear();
- cache.initializeAllIdentityMaps();
-
- DynamicEntity findResult1 = (DynamicEntity) em.find(simpleType.getJavaClass(), 1);
- DynamicEntity findResult2 = (DynamicEntity) em.find(simpleType.getJavaClass(), 2);
-
- assertNotNull(findResult1);
- assertNotNull(findResult2);
- assertEquals(simpleInstance1.get("id"), findResult1.get("id"));
- assertEquals(simpleInstance2.get("value1"), findResult2.get("value1"));
-
- em.close();
- }
-
- public DynamicEntity createSimpleInstance(EntityManagerFactory emf, int expectedId) {
- EntityManager em = emf.createEntityManager();
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleEntityType = helper.getType(ENTITY_TYPE);
- Assert.assertNotNull(simpleEntityType);
-
- DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity();
- simpleInstance.set("value1", TABLE_NAME);
-
- em.getTransaction().begin();
- assertEquals(0, simpleInstance.get("id"));
- em.persist(simpleInstance);
- assertEquals(expectedId, simpleInstance.get("id"));
- em.getTransaction().commit();
-
- em.close();
- return simpleInstance;
- }
-
- @BeforeClass
- public static void setUp() {
- emf = Persistence.createEntityManagerFactory("empty");
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- TableSequence sequence = new TableSequence();
- sequence.setTableName("TEST_SEQ");
- sequence.setCounterFieldName("SEQ_VALUE");
- sequence.setNameFieldName("SEQ_NAME");
- sequence.setPreallocationSize(5);
- helper.getSession().getProject().getLogin().setDefaultSequence(sequence);
- sequence.onConnect(helper.getSession().getPlatform());
-
- Class<?> dynamicType = dcl.createDynamicClass("model.sequencing." + ENTITY_TYPE);
- DynamicTypeBuilder typeBuilder = new JPADynamicTypeBuilder(dynamicType, null, TABLE_NAME);
- typeBuilder.setPrimaryKeyFields("SID");
- typeBuilder.addDirectMapping("id", int.class, "SID");
- typeBuilder.addDirectMapping("value1", String.class, "VAL_1");
- typeBuilder.configureSequencing(sequence, ENTITY_TYPE + "_SEQ", "SID");
-
- helper.addTypes(true, true, typeBuilder.getType());
- }
-
- @Before
- public void clearSimpleTypeInstances() {
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
- em.createQuery("DELETE FROM " + ENTITY_TYPE).executeUpdate();
- em.createNativeQuery("UPDATE TEST_SEQ SET SEQ_VALUE = 0").executeUpdate();
- em.getTransaction().commit();
- em.close();
-
- JpaHelper.getServerSession(emf).getSequencingControl().initializePreallocated();
- }
-
- @AfterClass
- public static void shutdown() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.createNativeQuery("DROP TABLE " + TABLE_NAME + " CASCADE CONSTRAINTS").executeUpdate();
- em.createNativeQuery("DROP TABLE TEST_SEQ CASCADE CONSTRAINTS").executeUpdate();
- em.getTransaction().commit();
-
- em.close();
- emf.close();
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/UnaryTableSequencing.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/UnaryTableSequencing.java
deleted file mode 100644
index 014214b..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/simple/sequencing/UnaryTableSequencing.java
+++ /dev/null
@@ -1,175 +0,0 @@
-package testing.simple.sequencing;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.dynamic.DynamicTypeBuilder;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-import org.eclipse.persistence.sequencing.UnaryTableSequence;
-import org.eclipse.persistence.sessions.IdentityMapAccessor;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class UnaryTableSequencing {
-
- private static EntityManagerFactory emf;
-
- public static final String TABLE_NAME = "SIMPLE_TABLE_SEQ";
-
- public static final String ENTITY_TYPE = "Simple";
-
- @Test
- public void verifyConfig() throws Exception {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- ClassDescriptor descriptor = helper.getSession().getClassDescriptorForAlias(ENTITY_TYPE);
- assertNotNull("No descriptor found for alias: " + ENTITY_TYPE, descriptor);
-
- DynamicType simpleType = helper.getType(ENTITY_TYPE);
- assertNotNull("EntityType not found for alias: " + ENTITY_TYPE, simpleType);
-
- assertEquals(descriptor, simpleType.getDescriptor());
- }
-
- @Test
- public void createSingleInstances() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleType = helper.getType(ENTITY_TYPE);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance = createSimpleInstance(emf, 1);
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(o) FROM " + ENTITY_TYPE + " o").getSingleResult()).intValue();
- assertEquals(1, simpleCount);
-
- IdentityMapAccessor cache = helper.getSession().getIdentityMapAccessor();
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance));
-
- em.clear();
- cache.initializeAllIdentityMaps();
-
- DynamicEntity findResult = (DynamicEntity) em.find(simpleType.getJavaClass(), 1);
-
- assertNotNull(findResult);
- assertEquals(simpleInstance.get("id"), findResult.get("id"));
- assertEquals(simpleInstance.get("value1"), findResult.get("value1"));
-
- em.close();
- }
-
- @Test
- public void createTwoInstances() {
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleType = helper.getType(ENTITY_TYPE);
-
- EntityManager em = emf.createEntityManager();
-
- DynamicEntity simpleInstance1 = createSimpleInstance(emf, 1);
- DynamicEntity simpleInstance2 = createSimpleInstance(emf, 2);
-
- int simpleCount = ((Number) em.createQuery("SELECT COUNT(o) FROM " + ENTITY_TYPE + " o").getSingleResult()).intValue();
- assertEquals(2, simpleCount);
-
- IdentityMapAccessor cache = helper.getSession().getIdentityMapAccessor();
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance1));
- assertTrue(cache.containsObjectInIdentityMap(simpleInstance2));
-
- em.clear();
- cache.initializeAllIdentityMaps();
-
- DynamicEntity findResult1 = (DynamicEntity) em.find(simpleType.getJavaClass(), 1);
- DynamicEntity findResult2 = (DynamicEntity) em.find(simpleType.getJavaClass(), 2);
-
- assertNotNull(findResult1);
- assertNotNull(findResult2);
- assertEquals(simpleInstance1.get("id"), findResult1.get("id"));
- assertEquals(simpleInstance2.get("value1"), findResult2.get("value1"));
-
- em.close();
- }
-
- public DynamicEntity createSimpleInstance(EntityManagerFactory emf, int expectedId) {
- EntityManager em = emf.createEntityManager();
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- DynamicType simpleEntityType = helper.getType(ENTITY_TYPE);
- Assert.assertNotNull(simpleEntityType);
-
- DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity();
- simpleInstance.set("value1", TABLE_NAME);
-
- em.getTransaction().begin();
- assertEquals(0, simpleInstance.get("id"));
- em.persist(simpleInstance);
- assertEquals(expectedId, simpleInstance.get("id"));
- em.getTransaction().commit();
-
- em.close();
- return simpleInstance;
- }
-
- @BeforeClass
- public static void setUp() {
- emf = Persistence.createEntityManagerFactory("empty");
- DynamicHelper helper = new JPADynamicHelper(emf);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- UnaryTableSequence sequence = new UnaryTableSequence("TEST_SEQ");
- sequence.setCounterFieldName("SEQ_VALUE");
- sequence.setPreallocationSize(5);
- helper.getSession().getProject().getLogin().setDefaultSequence(sequence);
- sequence.onConnect(helper.getSession().getPlatform());
-
- Class<?> dynamicType = dcl.createDynamicClass("model.sequencing." + ENTITY_TYPE);
- DynamicTypeBuilder typeBuilder = new JPADynamicTypeBuilder(dynamicType, null, TABLE_NAME);
- typeBuilder.setPrimaryKeyFields("SID");
- typeBuilder.addDirectMapping("id", int.class, "SID");
- typeBuilder.addDirectMapping("value1", String.class, "VAL_1");
- typeBuilder.configureSequencing(sequence, "TEST_SEQ", "SID");
-
- helper.addTypes(true, true, typeBuilder.getType());
- }
-
- @Before
- public void clearSimpleTypeInstances() {
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
- em.createQuery("DELETE FROM " + ENTITY_TYPE).executeUpdate();
- em.createNativeQuery("UPDATE TEST_SEQ SET SEQ_VALUE = 0").executeUpdate();
- em.getTransaction().commit();
- em.close();
-
- JpaHelper.getServerSession(emf).getSequencingControl().initializePreallocated();
- }
-
- @AfterClass
- public static void shutdown() {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
- em.createNativeQuery("DROP TABLE " + TABLE_NAME + " CASCADE CONSTRAINTS").executeUpdate();
- em.createNativeQuery("DROP TABLE TEST_SEQ CASCADE CONSTRAINTS").executeUpdate();
- em.getTransaction().commit();
-
- em.close();
- emf.close();
- }
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/util/EclipseLinkJPATest.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/util/EclipseLinkJPATest.java
deleted file mode 100644
index 8cf2ae2..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/util/EclipseLinkJPATest.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- * - ported from earlier Oracle Toplink examples
- ******************************************************************************/
-package testing.util;
-
-import java.io.*;
-import java.util.*;
-
-import javax.persistence.*;
-
-import junit.framework.Assert;
-
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.testing.util.QuerySQLTracker;
-import org.junit.After;
-import org.junit.AfterClass;
-
-/**
- * Base test case for testing a JPA persistence unit in JavaSE using JUnit4.
- *
- * Through the usage
- *
- * @PersistenceContext on subclasses a developer can indicate the persistence
- * unit name that the
- * @BeforeClass method should use to access the entityManager.
- *
- * @author dclarke
- * @since EclipseLink 1.1.2
- */
-public abstract class EclipseLinkJPATest {
-
- /**
- * This is he current EMF in use
- */
- private static EntityManagerFactory emf;
-
- private EntityManager entityManager;
-
- protected EntityManagerFactory getEMF() {
- if (emf == null) {
- emf = createEMF(getUnitName());
- }
-
- return emf;
- }
-
- protected EntityManager getEntityManager() {
- if (this.entityManager == null) {
- this.entityManager = getEMF().createEntityManager();
- }
-
- return this.entityManager;
- }
-
- protected EntityManagerFactory createEMF(String unitName) {
- if (emf != null) {
- if (emf.isOpen()) {
- emf.close();
- }
- }
-
- Assert.assertNotNull("EclipseLinkJPATest.createEMF:: Null unit name", unitName);
-
- try {
- return createEMF(unitName, null);
- } catch (RuntimeException e) {
- System.out.println("Persistence.createEMF FAILED: " + e.getMessage());
- e.printStackTrace();
- throw e;
- }
- }
-
- protected String getUnitName() {
- PersistenceContext context = null;
- Class javaClass = getClass();
-
- while (context == null && javaClass != Object.class) {
- context = (PersistenceContext) javaClass.getAnnotation(PersistenceContext.class);
- javaClass = javaClass.getSuperclass();
- }
- Assert.assertNotNull("No @PersistenceContext found", context);
-
- return context.unitName();
- }
-
- /**
- *
- * @param properties
- * @return
- * @throws Exception
- */
- protected EntityManagerFactory createEMF(String unitName, Map properties) {
- try {
- Map emfProps = getEMFProperties();
-
- if (properties != null) {
- emfProps.putAll(properties);
- }
-
- EntityManagerFactory emf = Persistence.createEntityManagerFactory(unitName, emfProps);
- QuerySQLTracker.install(JpaHelper.getServerSession(emf));
- return emf;
- } catch (Exception e) {
- System.out.println("Persistence.createEMF FAILED: " + e.getMessage());
- e.printStackTrace();
- throw new RuntimeException("EclipseLinkJPATest.createEMF(" + unitName + ", properties) - failed", e);
- }
- }
-
- /**
- *
- * @return
- */
- protected Map getEMFProperties() {
- Map properties = new HashMap();
-
- try {
- File examplePropertiesFile = new File("eclipselink-examples.properties");
- if (examplePropertiesFile.exists()) {
- Properties exampleProps = new Properties();
- InputStream in = new FileInputStream(examplePropertiesFile);
- exampleProps.load(in);
- in.close();
- properties.putAll(exampleProps);
- }
- } catch (Exception e) {
- // TODO
- }
-
- properties.putAll(System.getProperties());
-
- return properties;
- }
-
- protected QuerySQLTracker getQuerySQLTracker(EntityManager em) {
- return QuerySQLTracker.getTracker(JpaHelper.getEntityManager(em).getActiveSession());
- }
-
- @After
- public void cleanupClosedEMF() {
- if (this.entityManager != null) {
-
- if (this.entityManager.getTransaction().isActive()) {
- this.entityManager.getTransaction().rollback();
- }
- if (this.entityManager.isOpen()) {
- this.entityManager.close();
- }
- }
- this.entityManager = null;
-
- if (emf != null) {
- if (!emf.isOpen()) {
- emf = null;
- } else {
- QuerySQLTracker.getTracker(JpaHelper.getServerSession(emf)).reset();
- }
- }
- }
-
- @AfterClass
- public static void closeEMF() throws Exception {
- if (emf != null && emf.isOpen()) {
- emf.close();
- emf = null;
- }
- }
-
-}
diff --git a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/util/ExamplePropertiesLoader.java b/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/util/ExamplePropertiesLoader.java
deleted file mode 100644
index 4048209..0000000
--- a/dynamic/branches/1.1.0/eclipselink.jpa.test.dynamic/src/testing/util/ExamplePropertiesLoader.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package testing.util;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.Map;
-import java.util.Properties;
-
-public class ExamplePropertiesLoader {
-
- public static void loadProperties(Map properties) {
- loadProperties(properties, "./eclipselink-example.proerties");
- System.getProperty("");
- loadProperties(properties, "$HOME/eclipselink-example.proerties");
- }
-
- public static void loadProperties(Map properties, String filePath) {
- try {
- File examplePropertiesFile = new File(filePath);
- if (examplePropertiesFile.exists()) {
- Properties exampleProps = new Properties();
- InputStream in = new FileInputStream(examplePropertiesFile);
- exampleProps.load(in);
- in.close();
- properties.putAll(exampleProps);
- }
- } catch (Exception e) {
- // TODO
- }
-
- properties.putAll(System.getProperties());
- }
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/.classpath b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/.classpath
deleted file mode 100644
index 0785c54..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
- <classpathentry kind="var" path="ORACLE_JDBC_LIB"/>
- <classpathentry combineaccessrules="false" kind="src" path="/javax.persistence 1.99"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.asm"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.core"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.oracle"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.jpa"/>
- <classpathentry excluding="**/.svn/**" kind="src" path="src"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/.project b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/.project
deleted file mode 100644
index 6288382..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.persistence.example.dynamic.employee</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/.settings/org.eclipse.jdt.core.prefs b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 7b23759..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Aug 11 13:22:39 EDT 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/META-INF/persistence.xml b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/META-INF/persistence.xml
deleted file mode 100644
index 7b550e3..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/META-INF/persistence.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence version="1.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_1_0.xsd">
- <persistence-unit name="empty" transaction-type="RESOURCE_LOCAL">
- <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
- <exclude-unlisted-classes>true</exclude-unlisted-classes>
- <properties>
- <property name="eclipselink.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:orcl"/>
- <property name="eclipselink.jdbc.user" value="scott"/>
- <property name="eclipselink.jdbc.password" value="tiger"/>
- <property name="eclipselink.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
- <property name="eclipselink.jdbc.read-connections.min" value="1"/>
- <property name="eclipselink.jdbc.write-connections.min" value="1"/>
- <property name="eclipselink.logging.timestamp" value="false"/>
- <property name="eclipselink.logging.thread" value="false"/>
- <property name="eclipselink.logging.session" value="false"/>
- <property name="eclipselink.logging.exceptions" value="false"/>
- <property name="eclipselink.logging.level.sql" value="FINE"/>
- </properties>
- </persistence-unit>
-</persistence>
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/EmployeeDynamicMappings.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/EmployeeDynamicMappings.java
deleted file mode 100644
index 05b17c6..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/EmployeeDynamicMappings.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example;
-
-import java.util.Calendar;
-
-import javax.persistence.EntityManagerFactory;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-import org.eclipse.persistence.mappings.OneToOneMapping;
-
-/**
- * Factory for the creation of the dynamic mappings for the Employee demo.
- *
- * @author dclarke
- * @since EclipseLink - Dynamic Incubator (1.1.0-branch)
- */
-public class EmployeeDynamicMappings {
-
- public static void createTypes(EntityManagerFactory emf, String packageName, boolean createMissingTables) {
- String packagePrefix = packageName.endsWith(".") ? packageName : packageName + ".";
-
- DynamicHelper helper = new JPADynamicHelper(emf);
- DynamicClassLoader dcl = helper.getDynamicClassLoader();
-
- Class<?> employeeClass = dcl.createDynamicClass(packagePrefix + "Employee");
- Class<?> addressClass = dcl.createDynamicClass(packagePrefix + "Address");
- Class<?> phoneClass = dcl.createDynamicClass(packagePrefix + "PhoneNumber");
- Class<?> periodClass = dcl.createDynamicClass(packagePrefix + "EmploymentPeriod");
- Class<?> projectClass = dcl.createDynamicClass(packagePrefix + "Project");
- Class<?> smallProjectClass = dcl.createDynamicClass(packagePrefix + "SmallProject", projectClass);
- Class<?> largeProjectClass = dcl.createDynamicClass(packagePrefix + "LargeProject", projectClass);
-
- JPADynamicTypeBuilder employee = new JPADynamicTypeBuilder(employeeClass, null, "D_EMPLOYEE", "D_SALARY");
- JPADynamicTypeBuilder address = new JPADynamicTypeBuilder(addressClass, null, "D_ADDRESS");
- JPADynamicTypeBuilder phone = new JPADynamicTypeBuilder(phoneClass, null, "D_PHONE");
- JPADynamicTypeBuilder period = new JPADynamicTypeBuilder(periodClass, null);
- JPADynamicTypeBuilder project = new JPADynamicTypeBuilder(projectClass, null, "D_PROJECT");
- JPADynamicTypeBuilder smallProject = new JPADynamicTypeBuilder(smallProjectClass, project.getType(), "D_PROJECT");
- JPADynamicTypeBuilder largeProject = new JPADynamicTypeBuilder(largeProjectClass, project.getType(), "D_LPROJECT");
-
- configureAddress(address);
- configureEmployee(employee, address, phone, period, project);
- configurePhone(phone, employee);
- configurePeriod(period);
- configureProject(project, smallProject, largeProject, employee);
- configureSmallProject(smallProject, project);
- configureLargeProject(largeProject, project);
-
- // Must be done here since it requires the PK configurations on Employee
- // and Project
- employee.addManyToManyMapping("projects", project.getType(), "D_PROJ_EMP");
-
- helper.addTypes(true, true, employee.getType(), address.getType(), phone.getType(), period.getType(), project.getType(), smallProject.getType(), largeProject.getType());
- }
-
- private static void configurePhone(JPADynamicTypeBuilder phone, JPADynamicTypeBuilder employee) {
- phone.setPrimaryKeyFields("PHONE_TYPE", "EMP_ID");
-
- phone.addDirectMapping("type", String.class, "PHONE_TYPE");
- phone.addDirectMapping("ownerId", int.class, "EMP_ID").readOnly();
- phone.addDirectMapping("areaCode", String.class, "AREA_CODE");
- phone.addDirectMapping("number", String.class, "PNUMBER");
-
- phone.addOneToOneMapping("owner", employee.getType(), "EMP_ID");
- }
-
- private static void configureAddress(JPADynamicTypeBuilder address) {
- address.setPrimaryKeyFields("ADDR_ID");
-
- address.addDirectMapping("id", int.class, "ADDR_ID");
- address.addDirectMapping("street", String.class, "STREET");
- address.addDirectMapping("city", String.class, "CITY");
- address.addDirectMapping("province", String.class, "PROV");
- address.addDirectMapping("postalCode", String.class, "P_CODE");
- address.addDirectMapping("country", String.class, "COUNTRY");
-
- address.configureSequencing("ADDR_SEQ", "ADDR_ID");
- }
-
- private static void configureEmployee(JPADynamicTypeBuilder employee, JPADynamicTypeBuilder address, JPADynamicTypeBuilder phone, JPADynamicTypeBuilder period, JPADynamicTypeBuilder project) {
- employee.setPrimaryKeyFields("EMP_ID");
-
- employee.addDirectMapping("id", int.class, "D_EMPLOYEE.EMP_ID");
- employee.addDirectMapping("firstName", String.class, "D_EMPLOYEE.F_NAME");
- employee.addDirectMapping("lastName", String.class, "D_EMPLOYEE.L_NAME");
- employee.addDirectMapping("gender", String.class, "D_EMPLOYEE.GENDER");
- employee.addDirectMapping("salary", int.class, "D_SALARY.SALARY");
-
- OneToOneMapping addressMapping = employee.addOneToOneMapping("address", address.getType(), "ADDR_ID");
- addressMapping.setCascadeAll(true);
- addressMapping.setIsPrivateOwned(true);
-
- employee.addOneToOneMapping("manager", employee.getType(), "MANAGER_ID");
-
- OneToManyMapping phoneMapping = employee.addOneToManyMapping("phoneNumbers", phone.getType(), "OWNER_ID");
- phoneMapping.setCascadeAll(true);
- phoneMapping.setIsPrivateOwned(true);
-
- employee.addAggregateObjectMapping("period", period.getType(), true);
- employee.addOneToManyMapping("managedEmployees", employee.getType(), "MANAGER_ID");
-
- employee.addDirectCollectionMapping("responsibilities", "D_RESPONS", "RESPON_DESC", String.class, "EMP_ID");
-
- employee.configureSequencing("EMP_SEQ", "EMP_ID");
- }
-
- private static void configurePeriod(JPADynamicTypeBuilder period) {
- period.addDirectMapping("startDate", Calendar.class, "START_DATE");
- period.addDirectMapping("endDate", Calendar.class, "END_DATE");
- }
-
- private static void configureProject(JPADynamicTypeBuilder project, JPADynamicTypeBuilder smallProject, JPADynamicTypeBuilder largeProject, JPADynamicTypeBuilder employee) {
- project.setPrimaryKeyFields("PROJ_ID");
-
- project.addDirectMapping("id", int.class, "PROJ_ID");
- project.addDirectMapping("name", String.class, "NAME");
- project.addDirectMapping("description", String.class, "DESCRIP");
-
- project.addOneToOneMapping("teamLeader", employee.getType(), "EMP_ID");
-
- ClassDescriptor descriptor = project.getType().getDescriptor();
-
- descriptor.getInheritancePolicy().setClassIndicatorFieldName("PROJ_TYPE");
- descriptor.getInheritancePolicy().addClassIndicator(smallProject.getType().getJavaClass(), "S");
- descriptor.getInheritancePolicy().addClassIndicator(largeProject.getType().getJavaClass(), "L");
- descriptor.getInheritancePolicy().addClassIndicator(project.getType().getJavaClass(), "P");
-
- project.configureSequencing("PROJ_SEQ", "PROJ_ID");
- }
-
- private static void configureLargeProject(JPADynamicTypeBuilder largeProject, JPADynamicTypeBuilder project) {
- largeProject.setPrimaryKeyFields("PROJ_ID");
-
- ClassDescriptor descriptor = largeProject.getType().getDescriptor();
- descriptor.getInheritancePolicy().setClassIndicatorFieldName("PROJ_TYPE");
- descriptor.getInheritancePolicy().setParentClass(project.getType().getJavaClass());
-
- largeProject.addDirectMapping("budget", double.class, "BUDGET");
- largeProject.addDirectMapping("milestone", Calendar.class, "MILESTONE");
- }
-
- private static void configureSmallProject(JPADynamicTypeBuilder smallProject, JPADynamicTypeBuilder project) {
- smallProject.setPrimaryKeyFields("PROJ_ID");
-
- ClassDescriptor descriptor = smallProject.getType().getDescriptor();
- descriptor.getInheritancePolicy().setParentClass(project.getType().getJavaClass());
- }
-
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/Main.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/Main.java
deleted file mode 100644
index 380f8ad..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/Main.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-
-public class Main {
-
- /**
- * @param args
- */
- public static void main(String[] args) throws Exception {
- EntityManagerFactory emf = Persistence.createEntityManagerFactory("empty");
- DynamicHelper helper = new JPADynamicHelper(emf);
-
- // Add dynamic types
- EmployeeDynamicMappings.createTypes(emf, "example.jpa.dynamic.model.employee", false);
-
- // Create database and populate
- new SchemaManager(helper.getSession()).replaceDefaultTables();
-
- EntityManager em = emf.createEntityManager();
- em.getTransaction().begin();
- new Samples(emf).persistAll(em);
- em.getTransaction().commit();
- em.clear();
-
- // Lookup types
- DynamicType empType = helper.getType("Employee");
-
- // Run Queries
- Queries queries = new Queries();
-
- int minEmpId = queries.minimumEmployeeId(em);
- queries.findEmployee(em, empType, minEmpId);
- queries.findEmployeesUsingGenderIn(em);
-
- // Example transactions
- Transactions txn = new Transactions();
-
- txn.createUsingPersist(em);
-
- em.close();
- emf.close();
- }
-
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/Queries.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/Queries.java
deleted file mode 100644
index b5fc534..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/Queries.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example;
-
-import java.util.Collection;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.ReadAllQuery;
-
-/**
- * Simple query examples for the XML mapped Employee domain model.
- *
- * @author dclarke
- * @since EclipseLink - Dynamic Incubator (1.1.0-branch)
- */
-public class Queries {
-
- public DynamicEntity findEmployee(EntityManager em, DynamicType type, Object id) {
- return (DynamicEntity) em.find(type.getJavaClass(), id);
- }
-
- /**
- * Simple example using dynamic JP QL to retrieve all Employee instances
- * sorted by lastName and firstName.
- */
- @SuppressWarnings("unchecked")
- public List<DynamicEntity> readAllEmployeesUsing(EntityManager em) {
- return em.createQuery("SELECT e FROM Employee e ORDER BY e.id ASC").getResultList();
- }
-
- @SuppressWarnings("unchecked")
- public List<DynamicEntity> joinFetchEmployeeWithAddress(EntityManager em) {
- return em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address ORDER BY e.lastName ASC, e.firstName ASC").getResultList();
- }
-
- @SuppressWarnings("unchecked")
- public List<DynamicEntity> joinFetchHint(EntityManager em) {
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.manager.address.city = 'Ottawa' ORDER BY e.lastName ASC, e.firstName ASC");
- query.setHint(QueryHints.FETCH, "e.address");
- query.setHint(QueryHints.FETCH, "e.manager");
- query.setHint(QueryHints.FETCH, "e.manager.address");
- query.setHint(QueryHints.BATCH, "e.manager.phoneNumbers");
- List<DynamicEntity> emps = query.getResultList();
-
- for (DynamicEntity emp : emps) {
- emp.<DynamicEntity>get("manager").<Collection>get("phoneNumbers").size();
- }
-
- return emps;
- }
-
- public int minimumEmployeeId(EntityManager em) {
- return ((Number) em.createQuery("SELECT MIN(e.id) FROM Employee e").getSingleResult()).intValue();
- }
-
- public DynamicEntity minimumEmployee(EntityManager em) {
- Query q = em.createQuery("SELECT e FROM Employee e WHERE e.id in (SELECT MIN(ee.id) FROM Employee ee)");
-
- return (DynamicEntity) q.getSingleResult();
- }
-
- @SuppressWarnings("unchecked")
- public List<DynamicEntity> findEmployeesUsingGenderIn(EntityManager em) {
- return em.createQuery("SELECT e FROM Employee e WHERE e.gender IN (:GENDER1, :GENDER2)").setParameter("GENDER1", "Male").setParameter("GENDER2", "Female").getResultList();
- }
-
- @SuppressWarnings("unchecked")
- public List<DynamicEntity> findUsingNativeReadAllQuery(EntityManager em) {
- ClassDescriptor descriptor = JpaHelper.getEntityManager(em).getServerSession().getDescriptorForAlias("Employee");
- ReadAllQuery raq = new ReadAllQuery(descriptor.getJavaClass());
- ExpressionBuilder eb = raq.getExpressionBuilder();
- raq.setSelectionCriteria(eb.get("gender").equal("Male"));
-
- Query query = JpaHelper.createQuery(raq, em);
-
- return query.getResultList();
- }
-
- public DynamicEntity minEmployeeWithAddressAndPhones(EntityManager em) {
- return (DynamicEntity) em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT MIN(p.id) FROM PhoneNumber p)").getSingleResult();
- }
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/Samples.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/Samples.java
deleted file mode 100644
index e47c5e8..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/Samples.java
+++ /dev/null
@@ -1,732 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example;
-
-/*******************************************************************************
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-import java.util.*;
-
-import javax.persistence.*;
-
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.DeleteAllQuery;
-import org.eclipse.persistence.queries.ReportQuery;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink - Dynamic Incubator (1.1.0-branch)
- */
-@SuppressWarnings("deprecation")
-public class Samples {
- private EntityManagerFactory emf;
- public DynamicEntity[] employees;
- public DynamicEntity[] smallProjects;
- public DynamicEntity[] largeProjects;
-
- public Samples(EntityManagerFactory emf) {
- this.emf = emf;
-
- this.employees = new DynamicEntity[] { basicEmployeeExample1(), basicEmployeeExample2(), basicEmployeeExample3(), basicEmployeeExample4(), basicEmployeeExample5(), basicEmployeeExample6(), basicEmployeeExample7(), basicEmployeeExample8(), basicEmployeeExample9(), basicEmployeeExample10(), basicEmployeeExample11(), basicEmployeeExample12() };
-
- this.smallProjects = new DynamicEntity[] { basicSmallProjectExample1(), basicSmallProjectExample2(), basicSmallProjectExample3(), basicSmallProjectExample4(), basicSmallProjectExample5(), basicSmallProjectExample7(), basicSmallProjectExample8(), basicSmallProjectExample9(), basicSmallProjectExample10() };
-
- this.largeProjects = new DynamicEntity[] { basicLargeProjectExample1(), basicLargeProjectExample2(), basicLargeProjectExample3(), basicLargeProjectExample4(), basicLargeProjectExample5() };
-
- // Setup management hierarchy
- addManagedEmployees(0, new int[] { 2, 3, 4 });
- addManagedEmployees(1, new int[] { 5, 0 });
- addManagedEmployees(2, new int[] {});
- addManagedEmployees(3, new int[] {});
- addManagedEmployees(4, new int[] {});
- addManagedEmployees(5, new int[] {});
- addManagedEmployees(6, new int[] {});
- addManagedEmployees(7, new int[] {});
- addManagedEmployees(8, new int[] {});
- addManagedEmployees(9, new int[] { 7, 8, 10, 11 });
- addManagedEmployees(10, new int[] { 6 });
- addManagedEmployees(11, new int[] { 1 });
-
- // Setup Employee-Project associations
- addProjects(0, new int[] { 0, 1, 2 }, new int[] {});
- addProjects(1, new int[] { 3, 4, 0 }, new int[] {});
- addProjects(2, new int[] { 3 }, new int[] { 3, 4 });
- addProjects(4, new int[] { 3, 1 }, new int[] { 2, 4 });
- addProjects(5, new int[] {}, new int[] { 1 });
- addProjects(6, new int[] {}, new int[] { 1 });
-
- // Setup LargeProject leads
- this.largeProjects[0].set("teamLeader", this.employees[1]);
- this.largeProjects[3].set("teamLeader", this.employees[2]);
- this.largeProjects[4].set("teamLeader", this.employees[2]);
-
- }
-
- private DynamicEntity newInstance(String entityAlias) {
- ClassDescriptor descriptor = JpaHelper.getServerSession(this.emf).getDescriptorForAlias(entityAlias);
- return (DynamicEntity) descriptor.getInstantiationPolicy().buildNewInstance();
- }
-
- private Class<?> getDynamicClass(String entityAlias) {
- ClassDescriptor descriptor = JpaHelper.getServerSession(this.emf).getDescriptorForAlias(entityAlias);
- return descriptor.getJavaClass();
- }
-
- @SuppressWarnings("unchecked")
- private DynamicEntity addPhoneNumber(DynamicEntity employee, String type, String areaCode, String number) {
- DynamicEntity phone = newInstance("PhoneNumber");
- phone.set("type", type);
- phone.set("areaCode", areaCode);
- phone.set("number", number);
- phone.set("owner", employee);
- employee.<Collection> get("phoneNumbers").add(phone);
- return phone;
- }
-
- private void setPeriod(DynamicEntity employee, Date startDate, Date endDate) {
- DynamicEntity period = newInstance("EmploymentPeriod");
- period.set("startDate", startDate);
- period.set("endDate", endDate);
- employee.set("period", period);
- }
-
- public DynamicEntity basicEmployeeExample1() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Bob");
- employee.set("lastName", "Smith");
- employee.set("gender", "Male");
- employee.set("salary", 35000);
-
- setPeriod(employee, new Date(1993, 0, 1), new Date(1996, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Toronto");
- address.set("postalCode", "L5J2B5");
- address.set("province", "ONT");
- address.set("street", "1450 Acme Cr., Suite 4");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.<Collection<String>> get("responsibilities").add("Water the office plants.");
- employee.<Collection<String>> get("responsibilities").add("Maintain the kitchen facilities.");
- addPhoneNumber(employee, "Work", "613", "5558812");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample10() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Jill");
- employee.set("lastName", "May");
- employee.set("gender", "Female");
-
- setPeriod(employee, new Date(1991, 10, 111), null);
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Calgary");
- address.set("postalCode", "J5J2B5");
- address.set("province", "AB");
- address.set("street", "1111 Mooseland Rd.");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.set("salary", 56232);
- addPhoneNumber(employee, "Work", "613", "5558812");
- addPhoneNumber(employee, "Work Fax", "613", "5555943");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample11() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Sarah-Lou");
- employee.set("lastName", "Smitty");
- employee.set("gender", "Female");
-
- setPeriod(employee, new Date(1993, 0, 1), new Date(1996, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Arnprior");
- address.set("postalCode", "W1A2B5");
- address.set("province", "ONT");
- address.set("street", "1 Hawthorne Drive");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.set("salary", 75000);
- addPhoneNumber(employee, "Work Fax", "613", "5555943");
- addPhoneNumber(employee, "Home", "613", "5551234");
- addPhoneNumber(employee, "Cellular", "416", "5551111");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample12() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Jim-Bob");
- employee.set("lastName", "Jefferson");
- employee.set("gender", "Male");
-
- setPeriod(employee, new Date(1995, 0, 12), new Date(2001, 11, 31));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Yellowknife");
- address.set("postalCode", "Y5J2N5");
- address.set("province", "YK");
- address.set("street", "1112 Gold Rush Rd.");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.set("salary", 50000);
- addPhoneNumber(employee, "Home", "613", "5551234");
- addPhoneNumber(employee, "Cellular", "416", "5551111");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample2() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "John");
- employee.set("lastName", "Way");
- employee.set("gender", "Male");
- employee.set("salary", 53000);
-
- setPeriod(employee, new Date(1991, 10, 11), null);
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Ottawa");
- address.set("postalCode", "K5J2B5");
- address.set("province", "ONT");
- address.set("street", "12 Merivale Rd., Suite 5");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.<Collection<String>> get("responsibilities").add("Hire people when more people are required.");
- employee.<Collection<String>> get("responsibilities").add("Lay off employees when less people are required.");
- addPhoneNumber(employee, "Work", "613", "5558812");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample3() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Charles");
- employee.set("lastName", "Chanley");
- employee.set("gender", "Male");
- employee.set("salary", 43000);
-
- setPeriod(employee, new Date(1995, 0, 1), new Date(2001, 11, 31));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Montreal");
- address.set("postalCode", "Q2S5Z5");
- address.set("province", "QUE");
- address.set("street", "1 Canadien Place");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.<Collection<String>> get("responsibilities").add("Perform code reviews as required.");
-
- addPhoneNumber(employee, "Pager", "976", "5556666");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample4() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Emanual");
- employee.set("lastName", "Smith");
- employee.set("gender", "Male");
- employee.set("salary", 49631);
-
- setPeriod(employee, new Date(2001, 11, 31), new Date(1995, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Vancouver");
- address.set("postalCode", "N5J2N5");
- address.set("province", "BC");
- address.set("street", "20 Mountain Blvd., Floor 53, Suite 6");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.<Collection<String>> get("responsibilities").add("Have to fix the Database problem.");
- addPhoneNumber(employee, "Work Fax", "613", "5555943");
- addPhoneNumber(employee, "Cellular", "416", "5551111");
- addPhoneNumber(employee, "Pager", "976", "5556666");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample5() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Sarah");
- employee.set("lastName", "Way");
- employee.set("gender", "Female");
- employee.set("salary", 87000);
-
- setPeriod(employee, new Date(2001, 6, 31), new Date(1995, 4, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Prince Rupert");
- address.set("postalCode", "K3K5D5");
- address.set("province", "BC");
- address.set("street", "3254 Parkway Place");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.<Collection<String>> get("responsibilities").add("Write code documentation.");
- addPhoneNumber(employee, "Work", "613", "5558812");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
- addPhoneNumber(employee, "Home", "613", "5551234");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample6() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Marcus");
- employee.set("lastName", "Saunders");
- employee.set("gender", "Male");
- employee.set("salary", 54300);
-
- setPeriod(employee, new Date(2001, 11, 31), new Date(1995, 0, 12));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Perth");
- address.set("postalCode", "Y3Q2N9");
- address.set("province", "ONT");
- address.set("street", "234 Caledonia Lane");
- address.set("country", "Canada");
- employee.set("address", address);
-
- employee.<Collection<String>> get("responsibilities").add("Write user specifications.");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
- addPhoneNumber(employee, "Work", "613", "5558812");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample7() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Nancy");
- employee.set("lastName", "White");
- employee.set("gender", "Female");
- employee.set("salary", 31000);
-
- setPeriod(employee, new Date(1996, 0, 1), new Date(1993, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Metcalfe");
- address.set("postalCode", "Y4F7V6");
- address.set("province", "ONT");
- address.set("street", "2 Anderson Rd.");
- address.set("country", "Canada");
- employee.set("address", address);
-
- addPhoneNumber(employee, "Home", "613", "5551234");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample8() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Fred");
- employee.set("lastName", "Jones");
- employee.set("gender", "Male");
- employee.set("salary", 500000);
-
- setPeriod(employee, new Date(2001, 11, 31), new Date(1995, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Victoria");
- address.set("postalCode", "Z5J2N5");
- address.set("province", "BC");
- address.set("street", "382 Hyde Park Blvd.");
- address.set("country", "Canada");
- employee.set("address", address);
-
- addPhoneNumber(employee, "Cellular", "416", "5551111");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- public DynamicEntity basicEmployeeExample9() {
- DynamicEntity employee = newInstance("Employee");
-
- employee.set("firstName", "Betty");
- employee.set("lastName", "Jones");
- employee.set("gender", "Female");
- employee.set("salary", 500001);
-
- setPeriod(employee, new Date(2001, 11, 31), new Date(1995, 0, 1));
-
- DynamicEntity address = newInstance("Address");
- address.set("city", "Smith Falls");
- address.set("postalCode", "C6C6C6");
- address.set("province", "ONT");
- address.set("street", "89 Chocolate Drive");
- address.set("country", "Canada");
- employee.set("address", address);
-
- addPhoneNumber(employee, "Work", "613", "5558812");
- addPhoneNumber(employee, "ISDN", "905", "5553691");
-
- return employee;
- }
-
- private void setCalendar(DynamicEntity entity, String name, int year, int month, int day, int hour, int minute, int seconds) {
- Calendar cal = entity.<Calendar> get(name);
-
- if (cal == null) {
- cal = Calendar.getInstance();
- entity.set(name, cal);
- }
- cal.set(year, month, day, hour, minute, seconds);
- }
-
- public DynamicEntity basicLargeProjectExample1() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "Sales Reporting");
- largeProject.set("description", "A reporting application to report on the corporations database through TopLink.");
- largeProject.set("budget", (double) 5000);
- setCalendar(largeProject, "milestone", 1991, 10, 11, 12, 0, 0);
-
- return largeProject;
- }
-
- public DynamicEntity basicLargeProjectExample2() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "Light Reporter");
- largeProject.set("description", "A lightweight application to report on the corporations database through TopLink.");
- largeProject.set("budget", 100.98);
- setCalendar(largeProject, "milestone", 1999, 11, 25, 11, 40, 44);
-
- return largeProject;
- }
-
- public DynamicEntity basicLargeProjectExample3() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "TOPEmployee Management");
- largeProject.set("description", "A management application to report on the corporations database through TopLink.");
- largeProject.set("budget", 4000.98);
- setCalendar(largeProject, "milestone", 1997, 10, 12, 1, 0, 0);
-
- return largeProject;
- }
-
- public DynamicEntity basicLargeProjectExample4() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "Enterprise System");
- largeProject.set("description", "A enterprise wide application to report on the corporations database through TopLink.");
- largeProject.set("budget", 40.98);
- setCalendar(largeProject, "milestone", 1996, 8, 6, 6, 40, 44);
-
- return largeProject;
- }
-
- public DynamicEntity basicLargeProjectExample5() {
- DynamicEntity largeProject = newInstance("LargeProject");
-
- largeProject.set("name", "Problem Reporting System");
- largeProject.set("description", "A PRS application to report on the corporations database through TopLink.");
- largeProject.set("budget", 101.98);
- setCalendar(largeProject, "milestone", 1997, 9, 6, 1, 40, 44);
-
- return largeProject;
- }
-
- public DynamicEntity basicSmallProjectExample1() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Enterprise");
- smallProject.set("description", "A enterprise wide application to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample10() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Staff Query Tool");
- smallProject.set("description", "A tool to help staff query various things.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample2() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Sales Reporter");
- smallProject.set("description", "A reporting application using JDK to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample3() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "TOP-Employee Manager");
- smallProject.set("description", "A management application to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample4() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Problem Reporter");
- smallProject.set("description", "A PRS application to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample5() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Feather Reporter");
- smallProject.set("description", "An extremely lightweight application to report on the corporations database through TopLink.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample6() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Makework");
- smallProject.set("description", "A makework project.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample7() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Marketing Query Tool");
- smallProject.set("description", "A tool to help marketing query various things.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample8() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Shipping Query Tool");
- smallProject.set("description", "A tool to help shipping query various things.");
- return smallProject;
- }
-
- public DynamicEntity basicSmallProjectExample9() {
- DynamicEntity smallProject = newInstance("SmallProject");
- smallProject.set("name", "Accounting Query Tool");
- smallProject.set("description", "A tool to help accounting query various things.");
- return smallProject;
- }
-
- @SuppressWarnings("unchecked")
- private void addManagedEmployees(int managerIndex, int[] employeeIndeces) {
- DynamicEntity manager = this.employees[managerIndex];
-
- if (manager.<Collection> get("managedEmployees").isEmpty()) {
- for (int index = 0; index < employeeIndeces.length; index++) {
- manager.<Collection> get("managedEmployees").add(this.employees[employeeIndeces[index]]);
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private void addProjects(int empIndex, int[] smallProjIndeces, int[] largeProjIndeces) {
- DynamicEntity employee = this.employees[empIndex];
- Collection<DynamicEntity> projects = employee.<Collection> get("projects");
-
- for (int index = 0; index < smallProjIndeces.length; index++) {
- projects.add(this.smallProjects[smallProjIndeces[index]]);
- }
-
- for (int index = 0; index < largeProjIndeces.length; index++) {
- projects.add(this.largeProjects[largeProjIndeces[index]]);
- }
- }
-
- /**
- * Register all of the population in the provided EntityManager to be
- * persisted This method should only be called from within a test case. It
- * asserts that the provided EntityManager is in a transaction and that the
- * database tables are empty.
- */
- public void persistAll(EntityManager em) {
- Assert.assertTrue("EntityManager not in Transaction", em.getTransaction().isActive());
-
- // Verify that the database tables are empty
- assertCount(em, "Employee", 0);
- assertCount(em, "Address", 0);
- assertCount(em, "PhoneNumber", 0);
- assertCount(em, "Project", 0);
-
- for (int index = 0; index < this.employees.length; index++) {
- em.persist(this.employees[index]);
- }
- for (int index = 0; index < this.smallProjects.length; index++) {
- em.persist(this.smallProjects[index]);
- }
- for (int index = 0; index < this.largeProjects.length; index++) {
- em.persist(this.largeProjects[index]);
- }
-
- em.flush();
- verifyCounts(em);
- }
-
- public void verifyCounts(EntityManager em) {
- assertCount(em, "Employee", this.employees.length);
- assertCount(em, "Address", this.employees.length);
- assertCount(em, "Project", this.smallProjects.length + this.largeProjects.length);
- }
-
- /**
- * Verify that the provided entity type has no rows in the database using a
- * native ReportQuery.
- *
- * @param entityClass
- * @param count
- */
- public void assertCount(EntityManager em, String entityAlias, int count) {
- Class<?> entityClass = getDynamicClass(entityAlias);
- ReportQuery query = new ReportQuery(entityClass, new ExpressionBuilder());
- query.addCount();
- query.setShouldReturnSingleValue(true);
-
- int dbCount = ((Number) JpaHelper.getEntityManager(em).getUnitOfWork().executeQuery(query)).intValue();
- Assert.assertEquals("Incorrect quantity found of " + entityClass, count, dbCount);
- }
-
- /**
- * Verify that the provided list of Employee instances matches the sample
- * population.
- *
- * @param employees
- */
- public void assertSame(List<DynamicEntity> dbEmps) {
- Assert.assertEquals("Incorrect quantity of employees", this.employees.length, dbEmps.size());
- Collections.sort(dbEmps, new DynamicEntityComparator());
-
- List<DynamicEntity> sampleEmps = new ArrayList<DynamicEntity>();
- for (int index = 0; index < this.employees.length; index++) {
- sampleEmps.add(this.employees[index]);
- }
- Collections.sort(sampleEmps, new DynamicEntityComparator());
-
- for (int index = 0; index < this.employees.length; index++) {
- DynamicEntity emp = sampleEmps.get(index);
- DynamicEntity dbEmp = dbEmps.get(index);
-
- Assert.assertEquals("First name does not match on employees[" + index + "]", emp.<String> get("firstName"), dbEmp.<String> get("firstName"));
- Assert.assertEquals("Last name does not match on employees[" + index + "]", emp.<String> get("lastName"), dbEmp.<String> get("lastName"));
- Assert.assertEquals("Salary does not match on employees[" + index + "]", emp.<Integer> get("salary"), dbEmp.<Integer> get("salary"));
- }
- }
-
- /**
- * Simple comparator used to order the employees for use within assertSame
- */
- class DynamicEntityComparator implements Comparator<DynamicEntity> {
-
- public int compare(DynamicEntity emp1, DynamicEntity emp2) {
- return emp1.<Integer> get("id") - emp2.<Integer> get("id");
- }
-
- }
-
- /**
- * Extract the id's from the sample Employee instances.
- *
- * @param em
- * @return
- */
- public int[] getEmployeeIds(EntityManager em) {
- int[] ids = new int[this.employees.length];
-
- for (int index = 0; index < this.employees.length; index++) {
- ids[index] = this.employees[index].<Integer> get("id");
- }
-
- return ids;
- }
-
- /**
- * Reset the database so that only the sample population exists.
- *
- * @param em
- */
- public void resetDatabase(EntityManager em) {
- em.getTransaction().begin();
-
- DeleteAllQuery deleteEmpsQuery = new DeleteAllQuery(getDynamicClass("Employee"));
- ExpressionBuilder eb = deleteEmpsQuery.getExpressionBuilder();
- deleteEmpsQuery.setSelectionCriteria(eb.get("id").notIn(getEmployeeIds(em)));
- deleteEmpsQuery.setFlushOnExecute(true);
-
- JpaHelper.getEntityManager(em).getUnitOfWork().executeQuery(deleteEmpsQuery);
-
- em.getTransaction().commit();
- }
-
- public void resetSalary(EntityManager em) {
- boolean startedTX = !em.getTransaction().isActive();
-
- if (startedTX) {
- em.getTransaction().begin();
- }
-
- for (int index = 0; index < this.employees.length; index++) {
- DynamicEntity emp = this.employees[index];
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.firstName = :FNAME AND e.lastName = :LNAME");
- query.setParameter("FNAME", emp.<String> get("firstName"));
- query.setParameter("LNAME", emp.<String> get("lastName"));
-
- DynamicEntity dbEmp = (DynamicEntity) query.getSingleResult();
- dbEmp.set("salary", this.employees[index].<Integer> get("salary"));
- }
-
- if (startedTX) {
- em.getTransaction().commit();
- }
- }
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/Transactions.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/Transactions.java
deleted file mode 100644
index d023620..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.employee/src/example/Transactions.java
+++ /dev/null
@@ -1,186 +0,0 @@
-package example;
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Dynamic Persistence INCUBATION - Enhancement 200045
- * http://wiki.eclipse.org/EclipseLink/Development/JPA/Dynamic
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-
-
-import java.util.Collection;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.FlushModeType;
-
-import org.eclipse.persistence.config.PessimisticLock;
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.dynamic.DynamicEntity;
-import org.eclipse.persistence.dynamic.DynamicHelper;
-import org.eclipse.persistence.dynamic.DynamicType;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink - Dynamic Incubator (1.1.0-branch)
- */
-public class Transactions {
-
- private ClassDescriptor getDescriptor(EntityManager em, String entityAlias) {
- return JpaHelper.getEntityManager(em).getServerSession().getDescriptorForAlias(entityAlias);
- }
-
- /**
- * New entities with new related related entities can be persisted using
- * <code>EntityManager.persist(newEntity)</code>. The cascade setting on the
- * mappings determine how the related entities are handled. In this case
- * Employee has its relationship to Address and PhoneNumber configured with
- * cascade-all so the associated new entities will also be persisted.
- */
- public DynamicEntity createUsingPersist(EntityManager em) {
- DynamicHelper helper = new JPADynamicHelper(em);
-
- DynamicType empType = helper.getType("Employee");
- DynamicType addrType = helper.getType("Address");
- DynamicType phoneType = helper.getType("PhoneNumber");
-
- DynamicEntity emp = (DynamicEntity) empType.newDynamicEntity();
- emp.set("firstName", "Sample");
- emp.set("lastName", "Employee");
- emp.set("gender", "Male");
- emp.set("salary", 123456);
-
- DynamicEntity address = (DynamicEntity) addrType.newDynamicEntity();
- emp.set("address", address);
-
- DynamicEntity phone = (DynamicEntity) phoneType.newDynamicEntity();
- phone.set("type", "Mobile");
- phone.set("areaCode", "613");
- phone.set("number", "555-1212");
- phone.set("owner", emp);
- emp.<Collection<DynamicEntity>>get("phoneNumbers").add( phone);
-
- em.getTransaction().begin();
- em.persist(emp);
- em.getTransaction().commit();
-
- return emp;
- }
-
- /**
- *
- */
- public DynamicEntity createUsingMerge(EntityManager em) {
- ClassDescriptor empDescriptor = getDescriptor(em, "Employee");
- ClassDescriptor addrDescriptor = getDescriptor(em, "Address");
- ClassDescriptor phoneDescriptor = getDescriptor(em, "PhoneNumber");
-
- DynamicEntity emp = (DynamicEntity) empDescriptor.getInstantiationPolicy().buildNewInstance();
- emp.set("firstName", "Sample");
- emp.set("lastName", "Employee");
- emp.set("gender", "Male");
- emp.set("salary", 123456);
-
- DynamicEntity address = (DynamicEntity) addrDescriptor.getInstantiationPolicy().buildNewInstance();
- emp.set("address", address);
-
- DynamicEntity phone = (DynamicEntity) phoneDescriptor.getInstantiationPolicy().buildNewInstance();
- phone.set("type", "Mobile");
- phone.set("areaCode", "613");
- phone.set("number", "555-1212");
- phone.set("owner", emp);
- emp.<Collection<DynamicEntity>>get("phoneNumbers").add(phone);
-
- em.getTransaction().begin();
- // When merging the managed instance is returned from the call.
- // Further usage within the transaction must be done with this managed
- // entity.
- emp = (DynamicEntity) em.merge(emp);
- em.getTransaction().commit();
-
- return emp;
- }
-
- /**
- *
- * @param em
- * @return
- */
- public DynamicEntity createWithRelationshipsToExistingEntities(EntityManager em) {
- return null;
- }
-
- /**
- *
- * @param em
- */
- public DynamicEntity deleteEntity(EntityManager em) {
- return null;
- }
-
- /**
- *
- * @param em
- */
- public void queriesOnTransactionalState(EntityManager em) {
- em.setFlushMode(FlushModeType.COMMIT);
-
- }
-
- /**
- *
- * @param em
- * @throws Exception
- */
- public void pessimisticLocking(EntityManager em) throws Exception {
-
- // Find the Employee with the minimum ID
- int minId = new Queries().minimumEmployeeId(em);
-
- em.getTransaction().begin();
-
- // Lock Employee using query with hint
- DynamicEntity emp = (DynamicEntity) em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID").setParameter("ID", minId).setHint(QueryHints.PESSIMISTIC_LOCK, PessimisticLock.Lock).getSingleResult();
-
- emp.set("salary", emp.<Integer>get("salary") - 1);
-
- em.flush();
- }
-
- /**
- * This example illustrates the use of a query returning an entity and data
- * from a related entity within a transaction. The returned entities are
- * managed and thus any changes are reflected in the database upon flush.
- *
- * @param em
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- public void updateEmployeeWithCity(EntityManager em) throws Exception {
- em.getTransaction().begin();
-
- List<Object[]> emps = em.createQuery("SELECT e, e.address.city FROM Employee e").getResultList();
- DynamicEntity emp = (DynamicEntity) emps.get(0)[0];
- emp.set("salary", emp.<Integer>get("salary") + 1);
-
- em.flush();
-
- em.getTransaction().rollback();
- }
-
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/.classpath b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/.classpath
deleted file mode 100644
index ec08338..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/.classpath
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
- <classpathentry kind="var" path="ORACLE_JDBC_LIB"/>
- <classpathentry combineaccessrules="false" kind="src" path="/javax.persistence 1.99"/>
- <classpathentry combineaccessrules="false" kind="src" path="/javax.validation"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.asm"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.core"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.jpa"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.oracle"/>
- <classpathentry excluding="**/.svn/**" kind="src" path="src"/>
- <classpathentry excluding="**/.svn/**" kind="src" path="test.src"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/.project b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/.project
deleted file mode 100644
index 312ac53..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.persistence.example.dynamic.simplemap</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/.settings/org.eclipse.jdt.core.prefs b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 5fc19d2..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,316 +0,0 @@
-#Wed May 27 16:34:58 EDT 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=200
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=space
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/.settings/org.eclipse.jdt.ui.prefs b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ba556aa..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Wed May 27 16:34:58 EDT 2009
-eclipse.preferences.version=1
-formatter_profile=_EclipseLink
-formatter_settings_version=11
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/dist/eclipselink_example_simple-dynamic-map.jar b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/dist/eclipselink_example_simple-dynamic-map.jar
deleted file mode 100644
index ce03d8e..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/dist/eclipselink_example_simple-dynamic-map.jar
+++ /dev/null
Binary files differ
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/export-src-description.jardesc b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/export-src-description.jardesc
deleted file mode 100644
index a47eefa..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/export-src-description.jardesc
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?>
-<jardesc>
- <jar path="C:/Documents and Settings/djclarke.ST-MDC/Desktop/eclipselink_example_simple-dynamic-map.jar"/>
- <options buildIfNeeded="true" compress="true" descriptionLocation="/org.eclipse.persistence.example.dynamic.simplemap/export-src-description.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="true" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
- <storedRefactorings deprecationInfo="true" structuralOnly="false"/>
- <selectedProjects/>
- <selectedElements exportClassFiles="false" exportJavaFiles="true" exportOutputFolder="false">
- <javaElement handleIdentifier="=org.eclipse.persistence.core.dynamic/src<org.eclipse.persistence.internal.dynamic{DynamicClassLoader.java"/>
- <javaElement handleIdentifier="=org.eclipse.persistence.example.dynamic.simplemap/src"/>
- </selectedElements>
- <fatjar builder="org.eclipse.jdt.ui.plain_jar_builder" launchConfig=""/>
-</jardesc>
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/META-INF/persistence.xml b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/META-INF/persistence.xml
deleted file mode 100644
index 0c61462..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/META-INF/persistence.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence version="1.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_1_0.xsd">
- <persistence-unit name="dynamic-simple-map" transaction-type="RESOURCE_LOCAL">
- <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
- </persistence-unit>
-</persistence>
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/DynamicMapEntity.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/DynamicMapEntity.java
deleted file mode 100644
index 58f3b16..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/DynamicMapEntity.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - SimpleDynamicMap Example - Bug 277731
- * http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic/SimpleDynamicMap
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example;
-
-import java.util.HashMap;
-
-/**
- *
- *
- * This DynamicEntity class does not support:
- * <ul>
- * <li>Features typically introduced through weaving: Change Tracking, Fetch
- * Groups, PK caching, transparent 1:1/M:1 lazy loading
- * <li>Additional helper methods to simplify using indirect relationships and
- * collections. (including initialization)
- * <li>Metamodel/Mapping access
- * </ul>
- *
- * @author dclarke
- * @since EclipseLink 1.1.1
- */
-public abstract class DynamicMapEntity extends HashMap<String, Object> {
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/DynamicMapHelper.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/DynamicMapHelper.java
deleted file mode 100644
index b987c7f..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/DynamicMapHelper.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - SimpleDynamicMap Example - Bug 277731
- * http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic/SimpleDynamicMap
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example;
-
-import javax.persistence.EntityManagerFactory;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.sessions.Session;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.1.1
- */
-public class DynamicMapHelper {
-
- /**
- * Lookup descriptor for a dynamic type based on its name (descriptor alias)
- */
- public static ClassDescriptor getDescriptor(EntityManagerFactory emf, String typeName) {
- ClassDescriptor descriptor = JpaHelper.getServerSession(emf).getClassDescriptorForAlias(typeName);
-
- if (descriptor == null) {
- throw new IllegalArgumentException("No descriptor found for type: " + typeName);
- }
-
- return descriptor;
- }
-
- public static Class getClass(EntityManagerFactory emf, String typeName) {
- return getDescriptor(emf, typeName).getJavaClass();
- }
-
- /**
- * Factory for creating new dynamic instances
- */
- public static DynamicMapEntity newInstance(Session session, String typeName) {
- ClassDescriptor descriptor = session.getClassDescriptorForAlias(typeName);
- return (DynamicMapEntity) descriptor.getInstantiationPolicy().buildNewInstance();
- }
-
- /**
- * Factory for creating new dynamic JPA instances
- */
- public static DynamicMapEntity newInstance(EntityManagerFactory emf, String typeName) {
- return newInstance(JpaHelper.getServerSession(emf), typeName);
- }
-
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/SimpleDynamicMap_JPAExample.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/SimpleDynamicMap_JPAExample.java
deleted file mode 100644
index bca8cd2..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/SimpleDynamicMap_JPAExample.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - SimpleDynamicMap Example - Bug 277731
- * http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic/SimpleDynamicMap
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.descriptors.RelationalDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.sessions.server.Server;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-
-public class SimpleDynamicMap_JPAExample {
-
- /**
- *
- */
- public static void main(String[] args) throws Exception {
- SimpleDynamicMap_JPAExample example = new SimpleDynamicMap_JPAExample();
-
- EntityManagerFactory emf = example.createEMF();
-
- try {
-
- ClassDescriptor descriptor = example.createDynamicType(emf);
-
- example.persistDynamicInstances(emf, descriptor);
- example.queryDynamicInstances(emf, descriptor);
- example.updateDyanmicInstances(emf, descriptor);
- example.deleteDynamicInstances(emf, descriptor);
-
- example.removeDynamicType(emf, descriptor);
-
- } finally {
- emf.close();
- }
- }
-
- /**
- * Create a new dynamic type called 'SimpleType' with the class name of
- * 'model.SimpleType'. The generated class would look like: <code>
- * package model;
- * public class SimpleType extends example.dynamic.DynamicEntity {}
- * </code>
- *
- * The attributes defined in the mapping give the class the apparent
- * structure of: <code>
- * package model;
- * public class SimpleType extends example.dynamic.DynamicEntity {
- * Integer id;
- * String value;
- * }
- * </code>
- */
- public ClassDescriptor createDynamicType(EntityManagerFactory emf) throws ClassNotFoundException {
- Server session = JpaHelper.getServerSession(emf);
-
- DynamicClassLoader dcl = DynamicClassLoader.lookup(session);
- dcl.addClass("model.SimpleType", DynamicMapEntity.class);
-
- RelationalDescriptor descriptor = new RelationalDescriptor();
- descriptor.setJavaClass(dcl.loadClass("model.SimpleType"));
- descriptor.setTableName("DYNAMIC_SIMPLE");
- descriptor.setPrimaryKeyFieldName("ID");
-
- DirectToFieldMapping mapping = (DirectToFieldMapping) descriptor.addDirectMapping("id", "ID");
- mapping.setAttributeAccessor(new ValueAccessor(mapping, Integer.class));
- mapping = (DirectToFieldMapping) descriptor.addDirectMapping("value", "VALUE");
- mapping.setAttributeAccessor(new ValueAccessor(mapping, String.class));
-
- session.addDescriptor(descriptor);
-
- // Create the underlying table on the database. Drop it if it already
- // exists
- new SchemaManager(session).replaceDefaultTables();
-
- return descriptor;
- }
-
- public Map persistDynamicInstances(EntityManagerFactory emf, ClassDescriptor descriptor) {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
-
- Map entity = (Map) descriptor.getInstantiationPolicy().buildNewInstance();
- entity.put("id", 1);
- entity.put("value", "value-1");
-
- em.persist(entity);
-
- em.getTransaction().commit();
- em.close();
-
- return entity;
- }
-
- public List<Map> queryDynamicInstances(EntityManagerFactory emf, ClassDescriptor descriptor) {
- EntityManager em = emf.createEntityManager();
-
- try {
- return em.createQuery("SELECT s FROM SimpleType s WHERE s.value LIKE 'v%'").getResultList();
- } finally {
- em.close();
- }
- }
-
- public Map updateDyanmicInstances(EntityManagerFactory emf, ClassDescriptor descriptor) {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
-
- ReadObjectQuery query = new ReadObjectQuery(descriptor.getJavaClass());
- ExpressionBuilder eb = query.getExpressionBuilder();
- query.setSelectionCriteria(eb.get("id").equal(1));
- Map entity = (Map) JpaHelper.createQuery(query, em).getSingleResult();
-
- entity.put("value", "value-1+");
-
- em.getTransaction().commit();
- em.close();
-
- return entity;
- }
-
- public void deleteDynamicInstances(EntityManagerFactory emf, ClassDescriptor descriptor) {
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
-
- ReadObjectQuery query = new ReadObjectQuery(descriptor.getJavaClass());
- ExpressionBuilder eb = query.getExpressionBuilder();
- query.setSelectionCriteria(eb.get("id").equal(1));
- Map entity = (Map) JpaHelper.createQuery(query, em).getSingleResult();
-
- em.remove(entity);
-
- em.getTransaction().commit();
- em.close();
- }
-
- public void removeDynamicType(EntityManagerFactory emf, ClassDescriptor descriptor) {
- Server session = JpaHelper.getServerSession(emf);
-
- session.getIdentityMapAccessor().initializeIdentityMap(descriptor.getJavaClass());
-
- session.getDescriptors().remove(descriptor.getJavaClass());
- session.getProject().getAliasDescriptors().remove(descriptor.getAlias());
- session.getProject().getOrderedDescriptors().remove(descriptor);
-
- }
-
- /**
- * Create a database session with no descriptors. The property values used
- * to populate the DatabaseLogin object are loaded from a 'test.properties'
- * file stored in the user's home.
- *
- * The test.properties file could appear as:
- *
- * eclipselink.jdbc.driver=oracle.jdbc.OracleDriver
- * eclipselink.jdbc.url=jdbc:oracle:thin:@localhost:1521:ORCL
- * eclipselink.jdbc.user=scott eclipselink.jdbc.pwd=tiger
- * eclipselink.target-
- * database=org.eclipse.persistence.platform.database.OraclePlatform
- *
- *
- * @return newly created and logged in Session
- */
- public EntityManagerFactory createEMF() {
- Properties testProps = new Properties();
- FileInputStream in = null;
-
- try {
- in = new FileInputStream("test.properties");
- testProps.load(in);
- } catch (FileNotFoundException e) {
- } catch (IOException e) {
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException e) {
- }
- }
- }
-
- return Persistence.createEntityManagerFactory("dynamic-simple-map", testProps);
- }
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/SimpleDynamicMap_NativeExample.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/SimpleDynamicMap_NativeExample.java
deleted file mode 100644
index 5db0336..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/SimpleDynamicMap_NativeExample.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - SimpleDynamicMap Example - Bug 277731
- * http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic/SimpleDynamicMap
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.descriptors.RelationalDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.queries.ReadAllQuery;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.sessions.DatabaseLogin;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Project;
-import org.eclipse.persistence.sessions.UnitOfWork;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-
-public class SimpleDynamicMap_NativeExample {
-
- /**
- *
- */
- public static void main(String[] args) {
- SimpleDynamicMap_NativeExample example = new SimpleDynamicMap_NativeExample();
-
- DatabaseSession session = example.createSession();
-
- ClassDescriptor descriptor = example.createDynamicType(session);
-
- example.persistDynamicInstances(session, descriptor);
- example.queryDynamicInstances(session, descriptor);
- example.updateDyanmicInstances(session, descriptor);
- example.deleteDynamicInstances(session, descriptor);
-
- example.removeDynamicType(session, descriptor);
-
- try {
-
- } finally {
- session.logout();
- }
- }
-
- /**
- * Create a new dynamic type called 'SimpleType' with the class name of
- * 'model.SimpleType'. The generated class would look like: <code>
- * package model;
- * public class SimpleType extends example.dynamic.DynamicEntity {}
- * </code>
- *
- * The attributes defined in the mapping give the class the apparent
- * structure of: <code>
- * package model;
- * public class SimpleType extends example.dynamic.DynamicEntity {
- * Integer id;
- * String value;
- * }
- * </code>
- */
- public ClassDescriptor createDynamicType(DatabaseSession session) {
- RelationalDescriptor descriptor = new RelationalDescriptor();
- descriptor.setJavaClassName("model.SimpleType");
-
- DynamicClassLoader dcl = DynamicClassLoader.lookup(session);
- dcl.addClass("model.SimpleType", DynamicMapEntity.class);
- try {
- descriptor.setJavaClass(dcl.loadClass(descriptor.getJavaClassName()));
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- descriptor.setTableName("DYNAMIC_SIMPLE");
- descriptor.setPrimaryKeyFieldName("ID");
-
- DirectToFieldMapping mapping = (DirectToFieldMapping) descriptor.addDirectMapping("id", "ID");
- mapping.setAttributeAccessor(new ValueAccessor(mapping, Integer.class));
- mapping = (DirectToFieldMapping) descriptor.addDirectMapping("value", "VALUE");
- mapping.setAttributeAccessor(new ValueAccessor(mapping, String.class));
-
- session.addDescriptor(descriptor);
-
- // Create the underlying table on the database. Drop it if it already
- // exists
- new SchemaManager(session).replaceDefaultTables();
-
- return descriptor;
- }
-
- public Map persistDynamicInstances(DatabaseSession session, ClassDescriptor descriptor) {
- UnitOfWork uow = session.acquireUnitOfWork();
-
- Map entity = (Map) uow.newInstance(descriptor.getJavaClass());
- entity.put("id", 1);
- entity.put("value", "value-1");
-
- uow.commit();
-
- return entity;
- }
-
- public List<Map> queryDynamicInstances(DatabaseSession session, ClassDescriptor descriptor) {
- ReadAllQuery query = new ReadAllQuery(descriptor.getJavaClass());
- ExpressionBuilder eb = query.getExpressionBuilder();
- query.setSelectionCriteria(eb.get("value").like("v%"));
-
- return (List<Map>) session.executeQuery(query);
- }
-
- public Map updateDyanmicInstances(DatabaseSession session, ClassDescriptor descriptor) {
- UnitOfWork uow = session.acquireUnitOfWork();
-
- ReadObjectQuery query = new ReadObjectQuery(descriptor.getJavaClass());
- ExpressionBuilder eb = query.getExpressionBuilder();
- query.setSelectionCriteria(eb.get("id").equal(1));
-
- Map entity = (Map) uow.executeQuery(query);
-
- entity.put("value", "value-1+");
-
- uow.commit();
-
- return entity;
- }
-
- public void deleteDynamicInstances(DatabaseSession session, ClassDescriptor descriptor) {
- UnitOfWork uow = session.acquireUnitOfWork();
-
- ReadObjectQuery query = new ReadObjectQuery(descriptor.getJavaClass());
- ExpressionBuilder eb = query.getExpressionBuilder();
- query.setSelectionCriteria(eb.get("id").equal(1));
-
- Map entity = (Map) uow.executeQuery(query);
-
- uow.deleteObject(entity);
-
- uow.commit();
- }
-
- public void removeDynamicType(DatabaseSession session, ClassDescriptor descriptor) {
- session.getIdentityMapAccessor().initializeIdentityMap(descriptor.getJavaClass());
-
- session.getDescriptors().remove(descriptor.getJavaClass());
- session.getProject().getAliasDescriptors().remove(descriptor.getAlias());
- session.getProject().getOrderedDescriptors().remove(descriptor);
-
- }
-
- /**
- * Create a database session with no descriptors. The property values used
- * to populate the DatabaseLogin object are loaded from a 'test.properties'
- * file stored in the user's home.
- *
- * The test.properties file could appear as:
- *
- * eclipselink.jdbc.driver=oracle.jdbc.OracleDriver
- * eclipselink.jdbc.url=jdbc:oracle:thin:@localhost:1521:ORCL
- * eclipselink.jdbc.user=scott eclipselink.jdbc.pwd=tiger
- * eclipselink.target-
- * database=org.eclipse.persistence.platform.database.OraclePlatform
- *
- *
- * @return newly created and logged in Session
- */
- public DatabaseSession createSession() {
- Properties testProps = new Properties();
- FileInputStream in = null;
-
- try {
- in = new FileInputStream("test.properties");
- testProps.load(in);
- } catch (FileNotFoundException e) {
- } catch (IOException e) {
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException e) {
- }
- }
- }
-
- DatabaseLogin login = new DatabaseLogin();
- login.setDriverClassName((String) testProps.get(PersistenceUnitProperties.JDBC_DRIVER));
- login.setDatabaseURL((String) testProps.get(PersistenceUnitProperties.JDBC_URL));
- login.setUserName((String) testProps.get(PersistenceUnitProperties.JDBC_USER));
- login.setPassword((String) testProps.get(PersistenceUnitProperties.JDBC_PASSWORD));
- login.setPlatformClassName((String) testProps.get(PersistenceUnitProperties.TARGET_DATABASE));
-
- DatabaseSession session = new Project(login).createDatabaseSession();
- session.getSessionLog().setLevel(SessionLog.FINE);
- session.login();
-
- return session;
- }
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/SimpleDynamicMap_WithRelationships_JPAExample.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/SimpleDynamicMap_WithRelationships_JPAExample.java
deleted file mode 100644
index b51b8c2..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/SimpleDynamicMap_WithRelationships_JPAExample.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - SimpleDynamicMap Example - Bug 277731
- * http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic/SimpleDynamicMap
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.descriptors.RelationalDescriptor;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-import org.eclipse.persistence.exceptions.DatabaseException;
-import org.eclipse.persistence.indirection.IndirectList;
-import org.eclipse.persistence.internal.jpa.CMP3Policy;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.mappings.ManyToManyMapping;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-import org.eclipse.persistence.mappings.OneToOneMapping;
-import org.eclipse.persistence.sessions.server.Server;
-import org.eclipse.persistence.sessions.server.ServerSession;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-
-public class SimpleDynamicMap_WithRelationships_JPAExample {
-
- /**
- *
- */
- public static void main(String[] args) throws Exception {
- SimpleDynamicMap_WithRelationships_JPAExample example = new SimpleDynamicMap_WithRelationships_JPAExample();
-
- EntityManagerFactory emf = example.createEMF();
-
- try {
- example.createDynamicTypes(emf);
-
- example.persistDynamicInstances(emf);
- example.queryDynamicInstances(emf);
- example.updateDyanmicInstances(emf);
- example.deleteDynamicInstances(emf);
-
- example.removeDynamicTypes(emf);
-
- } finally {
- emf.close();
- }
- }
-
- public static final String TYPE_A = "SimpleTypeA";
- public static final String TYPE_B = "SimpleTypeB";
- public static final String TYPE_C = "SimpleTypeC";
-
- /**
- * Create the following dynamic types
- *
- * SimpleTypeA -> DYNAMIC_A int id -> A_ID (PK) String value -> VALUE B bs
- * (1:M)) mappedBy B.a List<C> cs (M:M)-> A_C_JOIN(A_ID, C_ID)
- *
- * SimpleTypeB -> DYNAMIC_B int id -> B_ID (PK) A a (M:1) -> A_FK (FK)
- * Calendar value -> VALUE
- *
- * SimpleTypeC -> DYNAMIC_C int id -> C_ID byte[] value -> LOB
- */
- public void createDynamicTypes(EntityManagerFactory emf) throws ClassNotFoundException {
- ServerSession session = (ServerSession) JpaHelper.getServerSession(emf);
- DynamicClassLoader dcl = DynamicClassLoader.lookup(session);
-
- Class aClass = dcl.createDynamicClass("model." + TYPE_A, DynamicMapEntity.class);
- Class bClass = dcl.createDynamicClass("model." + TYPE_B, DynamicMapEntity.class);
- Class cClass = dcl.createDynamicClass("model." + TYPE_C, DynamicMapEntity.class);
-
- // Create SimpleTypeA with direct mappings
- RelationalDescriptor descriptorA = new RelationalDescriptor();
- descriptorA.setJavaClass(aClass);
- descriptorA.setTableName("DYNAMIC_A");
- descriptorA.setPrimaryKeyFieldName("A_ID");
- descriptorA.setCMPPolicy(new CMP3Policy());
- DirectToFieldMapping mapping = (DirectToFieldMapping) descriptorA.addDirectMapping("id", "A_ID");
- mapping.setAttributeAccessor(new ValueAccessor(mapping, Integer.class));
- mapping = (DirectToFieldMapping) descriptorA.addDirectMapping("value", "VALUE");
- mapping.setAttributeAccessor(new ValueAccessor(mapping, String.class));
-
- // Create SimpleTypeB with direct mappings
- RelationalDescriptor descriptorB = new RelationalDescriptor();
- descriptorB.setJavaClass(bClass);
- descriptorB.setTableName("DYNAMIC_B");
- descriptorB.setPrimaryKeyFieldName("B_ID");
- descriptorB.setCMPPolicy(new CMP3Policy());
- mapping = (DirectToFieldMapping) descriptorB.addDirectMapping("id", "B_ID");
- mapping.setAttributeAccessor(new ValueAccessor(mapping, Integer.class));
- mapping = (DirectToFieldMapping) descriptorB.addDirectMapping("value", "VALUE");
- mapping.setAttributeAccessor(new ValueAccessor(mapping, Calendar.class));
-
- // Create SimpleTypeC with direct mappings
- RelationalDescriptor descriptorC = new RelationalDescriptor();
- descriptorC.setJavaClass(cClass);
- descriptorC.setTableName("DYNAMIC_C");
- descriptorC.setPrimaryKeyFieldName("C_ID");
- descriptorC.setCMPPolicy(new CMP3Policy());
- mapping = (DirectToFieldMapping) descriptorC.addDirectMapping("id", "C_ID");
- mapping.setAttributeAccessor(new ValueAccessor(mapping, Integer.class));
- mapping = (DirectToFieldMapping) descriptorC.addDirectMapping("value", "VALUE");
- mapping.setAttributeAccessor(new ValueAccessor(mapping, byte[].class));
-
- // Add 1:M: A.bs
- OneToManyMapping aToBMapping = new OneToManyMapping();
- aToBMapping.setAttributeName("bs");
- aToBMapping.setReferenceClass(bClass);
- aToBMapping.useTransparentList();
- aToBMapping.setCascadeAll(true);
- aToBMapping.setAttributeAccessor(new ValueAccessor(aToBMapping, IndirectList.class));
- aToBMapping.addTargetForeignKeyFieldName("A_FK", "A_ID");
- descriptorA.addMapping(aToBMapping);
-
- // Add M:M: A.cs
- ManyToManyMapping aToCMapping = new ManyToManyMapping();
- aToCMapping.setAttributeName("cs");
- aToCMapping.setReferenceClass(cClass);
- aToCMapping.useTransparentList();
- aToCMapping.setCascadeAll(true);
- aToCMapping.setAttributeAccessor(new ValueAccessor(aToCMapping, IndirectList.class));
- aToCMapping.setRelationTableName("DYNAMIC_JOIN_A_C");
- aToCMapping.addSourceRelationKeyFieldName("A_ID", "A_ID");
- aToCMapping.addTargetRelationKeyFieldName("C_ID", "C_ID");
- descriptorA.addMapping(aToCMapping);
-
- // Add 1:1: B.a (fetch=EAGER)
- OneToOneMapping bToAMapping = new OneToOneMapping();
- bToAMapping.setAttributeName("a");
- bToAMapping.setReferenceClass(aClass);
- bToAMapping.dontUseIndirection();
- bToAMapping.setAttributeAccessor(new ValueAccessor(bToAMapping, descriptorA.getJavaClass()));
- bToAMapping.addForeignKeyFieldName("A_FK", "A_ID");
- descriptorB.addMapping(bToAMapping);
-
- List<ClassDescriptor> descriptors = new ArrayList<ClassDescriptor>();
- descriptors.add(descriptorA);
- descriptors.add(descriptorB);
- descriptors.add(descriptorC);
- session.addDescriptors(descriptors);
-
- createTables(emf);
- }
-
- /**
- * Replace all of the tables.
- *
- * @param emf
- */
- private void createTables(EntityManagerFactory emf) {
- SchemaManager sm = new SchemaManager(JpaHelper.getServerSession(emf));
-
- try {
- sm.dropTable(DynamicMapHelper.getDescriptor(emf, TYPE_B).getTableName());
- sm.dropTable(((ManyToManyMapping) DynamicMapHelper.getDescriptor(emf, TYPE_A).getMappingForAttributeName("cs")).getRelationTableName());
- sm.dropTable(DynamicMapHelper.getDescriptor(emf, TYPE_A).getTableName());
- sm.dropTable(DynamicMapHelper.getDescriptor(emf, TYPE_C).getTableName());
- } catch (DatabaseException dbe) {
-
- }
-
- sm.createDefaultTables(false);
- }
-
- public void persistDynamicInstances(EntityManagerFactory emf) {
- System.out.println("*** START: SimpleDynamicMap_WithRelationships_JPAExample.persistDynamicInstances ***");
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
-
- Map entityA = DynamicMapHelper.newInstance(emf, TYPE_A);
- entityA.put("id", 1);
- entityA.put("value", "value-1");
-
- Map entityB = DynamicMapHelper.newInstance(emf, TYPE_B);
- entityB.put("id", 1);
- entityB.put("a", entityA);
- entityB.put("value", Calendar.getInstance());
-
- // Add entityB to A's 1:M
- List bs = new ArrayList();
- bs.add(entityB);
- entityA.put("bs", bs);
-
- Map entityC1 = DynamicMapHelper.newInstance(emf, TYPE_C);
- entityC1.put("id", 1);
- entityC1.put("value", "TEST DATA".getBytes());
- Map entityC2 = DynamicMapHelper.newInstance(emf, TYPE_C);
- entityC2.put("id", 2);
- entityC2.put("value", "TEST DATA FOR C2".getBytes());
-
- // Add entityB to A's 1:M
- List cs = new ArrayList();
- cs.add(entityC1);
- cs.add(entityC2);
- entityA.put("cs", cs);
-
- em.persist(entityC1);
- em.persist(entityC2);
- em.persist(entityB);
- em.persist(entityA);
-
- em.getTransaction().commit();
- em.close();
-
- JpaHelper.getServerSession(emf).getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- public List<Map> queryDynamicInstances(EntityManagerFactory emf) {
- System.out.println("*** START: SimpleDynamicMap_WithRelationships_JPAExample.queryDynamicInstances ***");
- EntityManager em = emf.createEntityManager();
-
- try {
- List<Map> as = em.createQuery("SELECT s FROM SimpleTypeA s WHERE s.value LIKE 'v%'").getResultList();
-
- return as;
- } finally {
- em.close();
- }
- }
-
- public void updateDyanmicInstances(EntityManagerFactory emf) {
- System.out.println("*** START: SimpleDynamicMap_WithRelationships_JPAExample.updateDyanmicInstances ***");
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
-
- Map entityA = (Map) em.find(DynamicMapHelper.getClass(emf, TYPE_A), 1);
- entityA.put("value", "value-1+");
-
- Map entityB = DynamicMapHelper.newInstance(emf, TYPE_B);
- entityB.put("id", 2);
- entityB.put("a", entityA);
- entityB.put("value", Calendar.getInstance());
-
- em.persist(entityB);
-
- List<Map<String, Object>> bs = (List<Map<String, Object>>) entityA.get("bs");
- bs.add(entityB);
- entityB.put("a", entityA);
-
- em.getTransaction().commit();
- em.close();
- }
-
- public void deleteDynamicInstances(EntityManagerFactory emf) {
- System.out.println("*** START: SimpleDynamicMap_WithRelationships_JPAExample.deleteDynamicInstances ***");
- EntityManager em = emf.createEntityManager();
-
- em.getTransaction().begin();
-
- Map entityA = (Map) em.find(DynamicMapHelper.getClass(emf, TYPE_A), 1);
- em.remove(entityA);
-
- em.getTransaction().commit();
- em.close();
- }
-
- /**
- * Remove the persistent type from the meta-model and clear the cache.
- *
- * Application should ensure there are no operations active against the
- * persistence context using this type when it is being removed.
- */
- public void removeDynamicTypes(EntityManagerFactory emf) {
- Server session = JpaHelper.getServerSession(emf);
-
- Class classA = DynamicMapHelper.getClass(emf, TYPE_A);
- Class classB = DynamicMapHelper.getClass(emf, TYPE_B);
- Class classC = DynamicMapHelper.getClass(emf, TYPE_C);
-
- // Must clear the cache first
- session.getIdentityMapAccessor().initializeIdentityMap(classA);
- session.getIdentityMapAccessor().initializeIdentityMap(classB);
- session.getIdentityMapAccessor().initializeIdentityMap(classC);
-
- session.getDescriptors().remove(classA);
- session.getProject().getOrderedDescriptors().remove(session.getProject().getAliasDescriptors().remove(TYPE_A));
-
- session.getDescriptors().remove(classB);
- session.getProject().getOrderedDescriptors().remove(session.getProject().getAliasDescriptors().remove(TYPE_B));
-
- session.getDescriptors().remove(classC);
- session.getProject().getOrderedDescriptors().remove(session.getProject().getAliasDescriptors().remove(TYPE_C));
- }
-
- /**
- * Create a database session with no descriptors. The property values used
- * to populate the DatabaseLogin object are loaded from a 'test.properties'
- * file stored in the user's home.
- *
- * The test.properties file could appear as:
- *
- * eclipselink.jdbc.driver=oracle.jdbc.OracleDriver
- * eclipselink.jdbc.url=jdbc:oracle:thin:@localhost:1521:ORCL
- * eclipselink.jdbc.user=scott eclipselink.jdbc.pwd=tiger
- * eclipselink.target-
- * database=org.eclipse.persistence.platform.database.OraclePlatform
- *
- *
- * @return newly created and logged in Session
- */
- public EntityManagerFactory createEMF() {
- Properties testProps = new Properties();
- FileInputStream in = null;
-
- try {
- in = new FileInputStream("test.properties");
- testProps.load(in);
- } catch (FileNotFoundException e) {
- } catch (IOException e) {
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException e) {
- }
- }
- }
-
- return Persistence.createEntityManagerFactory("dynamic-simple-map", testProps);
- }
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/ValueAccessor.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/ValueAccessor.java
deleted file mode 100644
index 8efdf0b..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/src/example/ValueAccessor.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - SimpleDynamicMap Example - Bug 277731
- * http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic/SimpleDynamicMap
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package example;
-
-import java.util.Map;
-
-import org.eclipse.persistence.exceptions.DescriptorException;
-import org.eclipse.persistence.mappings.AttributeAccessor;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-
-/**
- * Simple AttributeAccessor which retrieves a value from the DynamicEntity using
- * its Map interface. Since it is used in a dynamic case its attributeClass must
- * also be specified for schema generation to work.
- *
- * This accessor must be configured on all mappings which access values out of a
- * DynamicEntity. Without this accessor EclipseLink will attempt to look for a
- * field on the class causing a validation exception to be thrown.
- *
- * @author dclarke
- * @since EclipseLink 1.1.1
- */
-public class ValueAccessor extends AttributeAccessor {
-
- /** Owning mapping. Used to access attributeName */
- private DatabaseMapping mapping;
-
- /**
- * The attribute's type. Required for conversion out of result set and
- * schema generation
- */
- private Class attributeClass;
-
- public ValueAccessor(DatabaseMapping mapping, Class attributeClass) {
- super();
- this.mapping = mapping;
- this.attributeClass = attributeClass;
- }
-
- public DatabaseMapping getMapping() {
- return this.mapping;
- }
-
- public Object getAttributeValueFromObject(Object entity) throws DescriptorException {
- return ((Map<String, Object>) entity).get(getMapping().getAttributeName());
- }
-
- public void setAttributeValueInObject(Object entity, Object value) throws DescriptorException {
- ((Map<String, Object>) entity).put(getMapping().getAttributeName(), value);
- }
-
- @Override
- public Class getAttributeClass() {
- return this.attributeClass;
- }
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.properties b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.properties
deleted file mode 100644
index 1014eea..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-javax.persistence.jdbc.driver=oracle.jdbc.OracleDriver
-javax.persistence.jdbc.url=jdbc:oracle:thin:@localhost:1521:ORCL
-javax.persistence.jdbc.user=scott
-javax.persistence.jdbc.password=tiger
-eclipselink.target-database=org.eclipse.persistence.platform.database.OraclePlatform
-
-# eclipselink.jdbc.driver=org.apache.derby.jdbc.ClientDriver
-# eclipselink.jdbc.url=jdbc:derby://localhost:1527/where;create=true
-# eclipselink.jdbc.user=user
-# eclipselink.jdbc.password=password
-# eclipselink.target-database=org.eclipse.persistence.platform.database.DerbyPlatform
-
-eclipselink.jdbc.read-connections.min=1
-eclipselink.jdbc.write-connections.min=1
-
-eclipselink.logging.level=FINE
-eclipselink.logging.thread=false
-eclipselink.logging.session=false
-eclipselink.logging.timestamp=false
-eclipselink.logging.connection=false
\ No newline at end of file
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.src/testing/AllTests.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.src/testing/AllTests.java
deleted file mode 100644
index b9d4b72..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.src/testing/AllTests.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - SimpleDynamicMap Example - Bug 277731
- * http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic/SimpleDynamicMap
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { SimpleDynamicMap_NativeExample_Tests.class, SimpleDynamicMap_JPAExample_Tests.class, SimpleDynamicMap_WithRelationships_JPAExample_Tests.class })
-public class AllTests {
-
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.src/testing/SimpleDynamicMap_JPAExample_Tests.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.src/testing/SimpleDynamicMap_JPAExample_Tests.java
deleted file mode 100644
index f3111a0..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.src/testing/SimpleDynamicMap_JPAExample_Tests.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - SimpleDynamicMap Example - Bug 277731
- * http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic/SimpleDynamicMap
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import example.DynamicMapHelper;
-import example.SimpleDynamicMap_JPAExample;
-
-public class SimpleDynamicMap_JPAExample_Tests {
-
- private static SimpleDynamicMap_JPAExample example = new SimpleDynamicMap_JPAExample();
-
- private static EntityManagerFactory emf;
-
- private static EntityManagerFactory getEMF() throws Exception {
- if (emf == null) {
- emf = example.createEMF();
-
- assertNotNull(emf);
- assertTrue(emf.isOpen());
-
- Server session = JpaHelper.getServerSession(emf);
- assertNotNull(session);
- assertTrue(session.isConnected());
- assertEquals(0, session.getDescriptors().size());
-
- createSimpleType();
- }
- assertNotNull("No Entitymanagerfactory returned from createEMF", emf);
- return emf;
- }
-
- @AfterClass
- public static void closeEMF() {
- if (emf != null && emf.isOpen()) {
- emf.close();
- }
- }
-
- private static void createSimpleType() throws Exception {
- ClassDescriptor descriptor = example.createDynamicType(getEMF());
- Server session = JpaHelper.getServerSession(emf);
-
- assertNotNull(descriptor);
- assertEquals(1, session.getDescriptors().size());
- assertEquals("model.SimpleType", descriptor.getJavaClassName());
- assertEquals("SimpleType", descriptor.getAlias());
- assertEquals("DYNAMIC_SIMPLE", descriptor.getTableName());
- assertEquals(1, descriptor.getPrimaryKeyFieldNames().size());
- assertEquals("DYNAMIC_SIMPLE.ID", descriptor.getPrimaryKeyFieldNames().get(0));
- assertEquals(2, descriptor.getMappings().size());
-
- DirectToFieldMapping mapping = (DirectToFieldMapping) descriptor.getMappingForAttributeName("id");
- assertNotNull(mapping);
- assertEquals("DYNAMIC_SIMPLE.ID", mapping.getFieldName());
- assertEquals(Integer.class, mapping.getAttributeClassification());
-
- mapping = (DirectToFieldMapping) descriptor.getMappingForAttributeName("value");
- assertNotNull(mapping);
- assertEquals("DYNAMIC_SIMPLE.VALUE", mapping.getFieldName());
- assertEquals(String.class, mapping.getAttributeClassification());
- }
-
- @Test
- public void persistSimpleTypeInstances() throws Exception {
- ClassDescriptor descriptor = DynamicMapHelper.getDescriptor(getEMF(), "SimpleType");
-
- Map newEntity = example.persistDynamicInstances(getEMF(), descriptor);
-
- assertNotNull(newEntity);
-
- EntityManager em = getEMF().createEntityManager();
- int count = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleType s").getSingleResult()).intValue();
- em.close();
- assertEquals(1, count);
- }
-
- @Test
- public void querySimpleTypeInstances() throws Exception {
- ClassDescriptor descriptor = DynamicMapHelper.getDescriptor(getEMF(), "SimpleType");
-
- List<Map> entities = example.queryDynamicInstances(getEMF(), descriptor);
-
- assertNotNull(entities);
- assertEquals(1, entities.size());
- assertEquals(1, entities.get(0).get("id"));
- assertEquals("value-1", entities.get(0).get("value"));
- }
-
- @Test
- public void updateSimpleTypeInstances() throws Exception {
- ClassDescriptor descriptor = DynamicMapHelper.getDescriptor(getEMF(), "SimpleType");
-
- Map entity = example.updateDyanmicInstances(getEMF(), descriptor);
-
- assertNotNull(entity);
- assertEquals(1, entity.get("id"));
- assertEquals("value-1+", entity.get("value"));
- }
-
- @Test
- public void deleteSimpleTypeInstances() throws Exception {
- ClassDescriptor descriptor = DynamicMapHelper.getDescriptor(getEMF(), "SimpleType");
-
- example.deleteDynamicInstances(getEMF(), descriptor);
-
- EntityManager em = getEMF().createEntityManager();
- int count = ((Number) em.createQuery("SELECT COUNT(s) FROM SimpleType s").getSingleResult()).intValue();
- em.close();
- assertEquals(0, count);
- }
-
- @Test
- public void removeSimpleType() throws Exception {
- ClassDescriptor descriptor = DynamicMapHelper.getDescriptor(getEMF(), "SimpleType");
-
- example.removeDynamicType(getEMF(), descriptor);
-
- descriptor = JpaHelper.getServerSession(getEMF()).getClassDescriptorForAlias("SimpleType");
- assertNull(descriptor);
- assertEquals(0, JpaHelper.getServerSession(getEMF()).getDescriptors().size());
- }
-
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.src/testing/SimpleDynamicMap_NativeExample_Tests.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.src/testing/SimpleDynamicMap_NativeExample_Tests.java
deleted file mode 100644
index d4f56fa..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.src/testing/SimpleDynamicMap_NativeExample_Tests.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - SimpleDynamicMap Example - Bug 277731
- * http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic/SimpleDynamicMap
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.DatabaseSession;
-import org.eclipse.persistence.sessions.Session;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import example.SimpleDynamicMap_NativeExample;
-
-public class SimpleDynamicMap_NativeExample_Tests {
-
- private static SimpleDynamicMap_NativeExample example = new SimpleDynamicMap_NativeExample();
-
- private static DatabaseSession session;
-
- @AfterClass
- public static void logoutSession() {
- if (session != null && session.isConnected()) {
- session.logout();
- }
- }
-
- private static DatabaseSession getSession() {
- if (session == null) {
- session = example.createSession();
-
- assertNotNull(session);
- assertTrue(session.isConnected());
- assertEquals(0, session.getDescriptors().size());
-
- createSimpleType();
- }
- assertNotNull("No session returned from createSession", session);
- return session;
- }
-
- private static ClassDescriptor getDescriptor(String alias) {
- ClassDescriptor descriptor = getSession().getClassDescriptorForAlias(alias);
- assertNotNull("No descriptor found for alias: " + alias, descriptor);
- return descriptor;
- }
-
- private static void createSimpleType() {
- ClassDescriptor descriptor = example.createDynamicType(getSession());
-
- assertNotNull(descriptor);
- assertEquals(1, session.getDescriptors().size());
- assertEquals("model.SimpleType", descriptor.getJavaClassName());
- assertEquals("SimpleType", descriptor.getAlias());
- assertEquals("DYNAMIC_SIMPLE", descriptor.getTableName());
- assertEquals(1, descriptor.getPrimaryKeyFieldNames().size());
- assertEquals("DYNAMIC_SIMPLE.ID", descriptor.getPrimaryKeyFieldNames().get(0));
- assertEquals(2, descriptor.getMappings().size());
-
- DirectToFieldMapping mapping = (DirectToFieldMapping) descriptor.getMappingForAttributeName("id");
- assertNotNull(mapping);
- assertEquals("DYNAMIC_SIMPLE.ID", mapping.getFieldName());
- assertEquals(Integer.class, mapping.getAttributeClassification());
-
- mapping = (DirectToFieldMapping) descriptor.getMappingForAttributeName("value");
- assertNotNull(mapping);
- assertEquals("DYNAMIC_SIMPLE.VALUE", mapping.getFieldName());
- assertEquals(String.class, mapping.getAttributeClassification());
- }
-
- @Test
- public void persistSimpleTypeInstances() {
- ClassDescriptor descriptor = getDescriptor("SimpleType");
-
- Map newEntity = example.persistDynamicInstances(getSession(), descriptor);
-
- assertNotNull(newEntity);
-
- Session session = getSession();
-
- ReportQuery rq = new ReportQuery(descriptor.getJavaClass(), new ExpressionBuilder());
- rq.addCount();
- rq.setShouldReturnSingleValue(true);
- int count = ((Number) session.executeQuery(rq)).intValue();
- assertEquals(1, count);
- }
-
- @Test
- public void querySimpleTypeInstances() {
- ClassDescriptor descriptor = getDescriptor("SimpleType");
-
- List<Map> entities = example.queryDynamicInstances(getSession(), descriptor);
-
- assertNotNull(entities);
- assertEquals(1, entities.size());
- assertEquals(1, entities.get(0).get("id"));
- assertEquals("value-1", entities.get(0).get("value"));
- }
-
- @Test
- public void updateSimpleTypeInstances() {
- ClassDescriptor descriptor = getDescriptor("SimpleType");
-
- Map entity = example.updateDyanmicInstances(getSession(), descriptor);
-
- assertNotNull(entity);
- assertEquals(1, entity.get("id"));
- assertEquals("value-1+", entity.get("value"));
- }
-
- @Test
- public void deleteSimpleTypeInstances() {
- ClassDescriptor descriptor = getDescriptor("SimpleType");
-
- example.deleteDynamicInstances(getSession(), descriptor);
-
- Session session = getSession();
-
- ReportQuery rq = new ReportQuery(descriptor.getJavaClass(), new ExpressionBuilder());
- rq.addCount();
- rq.setShouldReturnSingleValue(true);
- int count = ((Number) session.executeQuery(rq)).intValue();
- assertEquals(0, count);
- }
-
- @Test
- public void removeSimpleType() {
- ClassDescriptor descriptor = getDescriptor("SimpleType");
-
- example.removeDynamicType(getSession(), descriptor);
-
- descriptor = getSession().getDescriptorForAlias("SimpleType");
- assertNull(descriptor);
- assertEquals(0, getSession().getDescriptors().size());
- }
-
-}
diff --git a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.src/testing/SimpleDynamicMap_WithRelationships_JPAExample_Tests.java b/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.src/testing/SimpleDynamicMap_WithRelationships_JPAExample_Tests.java
deleted file mode 100644
index a630489..0000000
--- a/dynamic/branches/1.1.0/org.eclipse.persistence.example.dynamic.simplemap/test.src/testing/SimpleDynamicMap_WithRelationships_JPAExample_Tests.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - SimpleDynamicMap Example - Bug 277731
- * http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic/SimpleDynamicMap
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package testing;
-
-import static example.SimpleDynamicMap_WithRelationships_JPAExample.TYPE_A;
-import static example.SimpleDynamicMap_WithRelationships_JPAExample.TYPE_B;
-import static example.SimpleDynamicMap_WithRelationships_JPAExample.TYPE_C;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
-
-import java.util.Calendar;
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.DirectToFieldMapping;
-import org.eclipse.persistence.sessions.factories.SessionManager;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import example.DynamicMapHelper;
-import example.SimpleDynamicMap_WithRelationships_JPAExample;
-
-public class SimpleDynamicMap_WithRelationships_JPAExample_Tests {
-
- private static SimpleDynamicMap_WithRelationships_JPAExample example = new SimpleDynamicMap_WithRelationships_JPAExample();
-
- private static EntityManagerFactory emf;
-
- private static EntityManagerFactory getEMF() throws Exception {
- if (emf == null) {
- emf = example.createEMF();
-
- assertNotNull(emf);
- assertTrue(emf.isOpen());
-
- Server session = JpaHelper.getServerSession(emf);
- assertNotNull(session);
- assertTrue(session.isConnected());
- assertEquals(0, session.getDescriptors().size());
-
- createDynamicTypes();
- }
- assertNotNull("No EntityManagerFactory returned from createEMF", emf);
- return emf;
- }
-
- private static void createDynamicTypes() throws Exception {
- example.createDynamicTypes(getEMF());
- Server session = JpaHelper.getServerSession(emf);
- assertEquals(3, session.getDescriptors().size());
-
- ClassDescriptor descriptor = DynamicMapHelper.getDescriptor(getEMF(), TYPE_A);
- assertNotNull(descriptor);
- assertEquals("model." + TYPE_A, descriptor.getJavaClassName());
- assertEquals(TYPE_A, descriptor.getAlias());
- assertEquals("DYNAMIC_A", descriptor.getTableName());
- assertEquals(1, descriptor.getPrimaryKeyFieldNames().size());
- assertEquals("DYNAMIC_A.A_ID", descriptor.getPrimaryKeyFieldNames().get(0));
- assertEquals(4, descriptor.getMappings().size());
- DirectToFieldMapping mapping = (DirectToFieldMapping) descriptor.getMappingForAttributeName("id");
- assertNotNull(mapping);
- assertEquals("DYNAMIC_A.A_ID", mapping.getFieldName());
- assertEquals(Integer.class, mapping.getAttributeClassification());
- mapping = (DirectToFieldMapping) descriptor.getMappingForAttributeName("value");
- assertNotNull(mapping);
- assertEquals("DYNAMIC_A.VALUE", mapping.getFieldName());
- assertEquals(String.class, mapping.getAttributeClassification());
-
- descriptor = DynamicMapHelper.getDescriptor(getEMF(), TYPE_B);
- assertNotNull(descriptor);
- assertEquals("model." + TYPE_B, descriptor.getJavaClassName());
- assertEquals(TYPE_B, descriptor.getAlias());
- assertEquals("DYNAMIC_B", descriptor.getTableName());
- assertEquals(1, descriptor.getPrimaryKeyFieldNames().size());
- assertEquals("DYNAMIC_B.B_ID", descriptor.getPrimaryKeyFieldNames().get(0));
- assertEquals(3, descriptor.getMappings().size());
- mapping = (DirectToFieldMapping) descriptor.getMappingForAttributeName("id");
- assertNotNull(mapping);
- assertEquals("DYNAMIC_B.B_ID", mapping.getFieldName());
- assertEquals(Integer.class, mapping.getAttributeClassification());
- mapping = (DirectToFieldMapping) descriptor.getMappingForAttributeName("value");
- assertNotNull(mapping);
- assertEquals("DYNAMIC_B.VALUE", mapping.getFieldName());
- assertEquals(Calendar.class, mapping.getAttributeClassification());
-
- descriptor = DynamicMapHelper.getDescriptor(getEMF(), TYPE_C);
- assertNotNull(descriptor);
- assertEquals("model." + TYPE_C, descriptor.getJavaClassName());
- assertEquals(TYPE_C, descriptor.getAlias());
- assertEquals("DYNAMIC_C", descriptor.getTableName());
- assertEquals(1, descriptor.getPrimaryKeyFieldNames().size());
- assertEquals("DYNAMIC_C.C_ID", descriptor.getPrimaryKeyFieldNames().get(0));
- assertEquals(2, descriptor.getMappings().size());
- mapping = (DirectToFieldMapping) descriptor.getMappingForAttributeName("id");
- assertNotNull(mapping);
- assertEquals("DYNAMIC_C.C_ID", mapping.getFieldName());
- assertEquals(Integer.class, mapping.getAttributeClassification());
- mapping = (DirectToFieldMapping) descriptor.getMappingForAttributeName("value");
- assertNotNull(mapping);
- assertEquals("DYNAMIC_C.VALUE", mapping.getFieldName());
- assertEquals(byte[].class, mapping.getAttributeClassification());
- }
-
- @Test
- public void persistSimpleTypeInstances() throws Exception {
- EntityManager em = getEMF().createEntityManager();
- assertEquals(0, ((Number) em.createQuery("SELECT COUNT(a) FROM SimpleTypeA a").getSingleResult()).intValue());
- assertEquals(0, ((Number) em.createQuery("SELECT COUNT(b) FROM SimpleTypeB b").getSingleResult()).intValue());
- assertEquals(0, ((Number) em.createQuery("SELECT COUNT(c) FROM SimpleTypeC c").getSingleResult()).intValue());
-
- example.persistDynamicInstances(getEMF());
-
- assertEquals(1, ((Number) em.createQuery("SELECT COUNT(a) FROM SimpleTypeA a").getSingleResult()).intValue());
- assertEquals(1, ((Number) em.createQuery("SELECT COUNT(b) FROM SimpleTypeB b").getSingleResult()).intValue());
- assertEquals(2, ((Number) em.createQuery("SELECT COUNT(c) FROM SimpleTypeC c").getSingleResult()).intValue());
-
- Map entityA = (Map) em.find(DynamicMapHelper.getClass(getEMF(), TYPE_A), 1);
-
- assertNotNull(entityA);
-
- List<Map<String, Object>> bs = (List<Map<String, Object>>) entityA.get("bs");
- assertNotNull(bs);
- assertEquals(1, bs.size());
-
- List<Map<String, Object>> cs = (List<Map<String, Object>>) entityA.get("cs");
- assertNotNull(cs);
- assertEquals(2, cs.size());
-
- em.close();
- }
-
- @Test
- public void querySimpleTypeInstances() throws Exception {
- List<Map> entities = example.queryDynamicInstances(getEMF());
-
- assertNotNull(entities);
- assertEquals(1, entities.size());
- assertEquals(1, entities.get(0).get("id"));
- assertEquals("value-1", entities.get(0).get("value"));
-
- EntityManager em = getEMF().createEntityManager();
-
- List<Map<String, Object>> allBs = em.createQuery("SELECT b FROM SimpleTypeB b").getResultList();
- assertNotNull(allBs);
- assertEquals(1, allBs.size());
-
- List<Map<String, Object>> allCs = em.createQuery("SELECT c FROM SimpleTypeC c").getResultList();
- assertNotNull(allCs);
- assertEquals(2, allCs.size());
-
- em.close();
- }
-
- @Test
- public void updateSimpleTypeInstances() throws Exception {
- example.updateDyanmicInstances(getEMF());
-
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- EntityManager em = getEMF().createEntityManager();
-
- Map entityA = (Map) em.find(DynamicMapHelper.getClass(getEMF(), TYPE_A), 1);
- assertNotNull(entityA);
- assertEquals(1, entityA.get("id"));
- assertEquals("value-1+", entityA.get("value"));
-
- em.close();
- }
-
- @Test
- public void deleteSimpleTypeInstances() throws Exception {
- example.deleteDynamicInstances(getEMF());
-
- EntityManager em = getEMF().createEntityManager();
-
- assertEquals(0, ((Number) em.createQuery("SELECT COUNT(a) FROM SimpleTypeA a").getSingleResult()).intValue());
- assertEquals(0, ((Number) em.createQuery("SELECT COUNT(b) FROM SimpleTypeB b").getSingleResult()).intValue());
- assertEquals(0, ((Number) em.createQuery("SELECT COUNT(c) FROM SimpleTypeC c").getSingleResult()).intValue());
-
- em.close();
- }
-
- @Test
- public void removeSimpleType() throws Exception {
- example.removeDynamicTypes(getEMF());
-
- assertEquals(0, JpaHelper.getServerSession(getEMF()).getDescriptors().size());
-
- try {
- DynamicMapHelper.getDescriptor(getEMF(), TYPE_A);
- } catch (IllegalArgumentException iae) {
- return;
- }
- fail("Expected IllegalArgumentException not thrown");
- }
-
- @AfterClass
- public static void closeEMF() {
- if (emf != null && emf.isOpen()) {
- emf.close();
- }
- SessionManager.getManager().destroyAllSessions();
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/.classpath b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/.classpath
deleted file mode 100644
index 78b0943..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry excluding="**/.svn/**" kind="src" path="src"/>
- <classpathentry excluding="**/.svn/**" kind="src" path="test-src"/>
- <classpathentry kind="src" path="example.jpa.employee.xml"/>
- <classpathentry kind="src" path="example.jpa.common"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_17 (eclipselink-agent 1.2.0)"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
- <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/EclipseLink 1.2.0"/>
- <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JPA 1.0"/>
- <classpathentry kind="var" path="JDBC_LIB"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/.project b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/.project
deleted file mode 100644
index 7b89c9f..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.persistence.extension.fetchplan</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/.settings/org.eclipse.jdt.core.prefs b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 6613fa2..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,74 +0,0 @@
-#Tue Mar 02 11:18:21 EST 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/build.xml b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/build.xml
deleted file mode 100644
index 21befd0..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/build.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- WARNING: Eclipse auto-generated file.
- Any modifications will be overwritten.
- To include a user specific buildfile here, simply create one in the same
- directory with the processing instruction <?eclipse.ant.import?>
- as the first entry and export the buildfile again. -->
-<project basedir="." default="package" name="org.eclipse.persistence.extension.fetchplan">
- <target name="package">
- <jar destfile="eclipselink-incubator-fetchplan.jar" basedir="classes" includes="org/**/*.class">
- </jar>
- </target>
-</project>
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/eclipselink-example.properties b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/eclipselink-example.properties
deleted file mode 100644
index 17eab1d..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/eclipselink-example.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Configurations that override what is in the persistence.xml.
-# The example.util.ExamplePropertiesLoader will load the
-#
-javax.persistence.jdbc.driver=oracle.jdbc.OracleDriver
-javax.persistence.jdbc.url=jdbc:oracle:thin:@localhost:1521:ORCL
-javax.persistence.jdbc.user=scott
-javax.persistence.jdbc.password=tiger
-
-eclipselink.jdbc.read-connections.min=1
-eclipselink.jdbc.write-connections.min=1
-
-eclipselink.logging.thread=false
-eclipselink.logging.session=false
-# eclipselink.logging.exceptions=false
-eclipselink.logging.timestamp=false
-eclipselink.logging.connection=false
-eclipselink.logging.level.ejb_or_metadata=WARNING
-eclipselink.logging.level=FINE
-eclipselink.logging.level.fetch_plan=ALL
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/eclipselink-incubator-fetchplan.jar b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/eclipselink-incubator-fetchplan.jar
deleted file mode 100644
index a9a45a9..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/eclipselink-incubator-fetchplan.jar
+++ /dev/null
Binary files differ
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.common/example/util/ExamplePropertiesLoader.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.common/example/util/ExamplePropertiesLoader.java
deleted file mode 100644
index 229c0c1..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.common/example/util/ExamplePropertiesLoader.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial version in EclipseLink 2.0.0 examples
- ******************************************************************************/
-package example.util;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Helper class that will load persistence unit overrides from a properties file
- * in both the current running folder and the current user's home folder. The
- * goal is to enable developers and users of the example to customize its
- * behavior without having to modify the source of the example.
- *
- * @author dclarke
- * @since EclipseLink 2.0.0
- */
-@SuppressWarnings("unchecked")
-public class ExamplePropertiesLoader {
-
- public static final String DEFAULT_FILENAME = "eclipselink-example.properties";
-
- /**
- *
- * @param properties
- */
- public static void loadProperties(Map properties) {
- loadProperties(properties, DEFAULT_FILENAME);
- }
-
- /**
- *
- * @param properties
- */
- public static void loadProperties(Map properties, String filename) {
- loadProperties(properties, new File(filename));
-
- String home = System.getProperty("user.home");
- loadProperties(properties, new File(home + System.getProperty("file.separator") + filename));
-
- properties.putAll(System.getProperties());
-
- for (Object key : System.getProperties().keySet()) {
- String keyName = (String) key;
-
- if (keyName.startsWith("javax.persistence") || keyName.startsWith("eclipselink")) {
- String value = System.getProperty(keyName);
- properties.put(keyName, value);
- }
- }
- }
-
- /**
- *
- * @param properties
- * @param filePath
- */
- public static void loadProperties(Map properties, File file) {
- try {
- if (file.exists()) {
- Properties exampleProps = new Properties();
- InputStream in = new FileInputStream(file);
- exampleProps.load(in);
- in.close();
- properties.putAll(exampleProps);
- }
- } catch (Exception e) {
- // ignore
- }
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.common/testing/EclipseLinkJPAAssert.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.common/testing/EclipseLinkJPAAssert.java
deleted file mode 100644
index 80490c6..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.common/testing/EclipseLinkJPAAssert.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package testing;
-
-import javax.persistence.EntityManagerFactory;
-
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.indirection.IndirectContainer;
-import org.eclipse.persistence.indirection.ValueHolderInterface;
-import org.eclipse.persistence.internal.descriptors.InstanceVariableAttributeAccessor;
-import org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor;
-import org.eclipse.persistence.internal.descriptors.PersistenceEntity;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.AttributeAccessor;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.mappings.ForeignReferenceMapping;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-
-/**
- * Testing utility to assert various EclipseLink configurations in the
- * descriptors and mappings.
- *
- * @author dclarke
- * @since EclipseLink 2.0
- */
-public abstract class EclipseLinkJPAAssert {
-
- public static ClassDescriptor assertEntity(EntityManagerFactory emf, String entityTypeName) {
- ClassDescriptor descriptor = JpaHelper.getServerSession(emf).getDescriptorForAlias(entityTypeName);
-
- Assert.assertNotNull("No ClassDescriptor found for: " + entityTypeName, descriptor);
- return descriptor;
- }
-
- public static ClassDescriptor assertEntity(EntityManagerFactory emf, Object entity) {
- ClassDescriptor descriptor = JpaHelper.getServerSession(emf).getDescriptor(entity);
-
- Assert.assertNotNull("No ClassDescriptor found for: " + entity, descriptor);
- return descriptor;
- }
-
- public static void assertWoven(ClassDescriptor descriptor) {
- Assert.assertNotNull("Null descriptor provided", descriptor);
- Assert.assertTrue("Entity type not woven: " + descriptor, PersistenceEntity.class.isAssignableFrom(descriptor.getJavaClass()));
- }
-
- public static void assertWoven(EntityManagerFactory emf, String entityTypeName) {
- assertWoven(assertEntity(emf, entityTypeName));
- }
-
- public static void assertNotWoven(ClassDescriptor descriptor) {
- Assert.assertFalse(PersistenceEntity.class.isAssignableFrom(descriptor.getJavaClass()));
- }
-
- public static void assertNotWoven(EntityManagerFactory emf, String entityTypeName) {
- assertNotWoven(assertEntity(emf, entityTypeName));
- }
-
- public static DatabaseMapping assertMapping(ClassDescriptor descriptor, String attributeName) {
- DatabaseMapping mapping = descriptor.getMappingForAttributeName(attributeName);
-
- Assert.assertNotNull("No mapping found on " + descriptor + " for attribute named: " + attributeName, mapping);
- return mapping;
- }
-
- public static DatabaseMapping assertMapping(EntityManagerFactory emf, String entityTypeName, String attributeName) {
- return assertMapping(assertEntity(emf, entityTypeName), attributeName);
- }
-
- public static void assertLazy(ClassDescriptor descriptor, String attributeName) {
- DatabaseMapping mapping = assertMapping(descriptor, attributeName);
-
- if (mapping.isForeignReferenceMapping()) {
- Assert.assertTrue("FRMapping not lazy: " + mapping, ((ForeignReferenceMapping) mapping).usesIndirection());
- } else if (descriptor.hasFetchGroupManager() && descriptor.getFetchGroupManager().getDefaultFetchGroup() != null){
- Assert.assertTrue("Basic Mapping not lazy: " + mapping, mapping.isLazy());
- } else {
- Assert.fail("Mapping is not lazy: " + mapping);
- }
- }
-
- public static void assertLazy(EntityManagerFactory emf, String entityTypeName, String attributeName) {
- assertLazy(assertEntity(emf, entityTypeName), attributeName);
- }
-
- public static void assertNotLazy(ClassDescriptor descriptor, String attributeName) {
- DatabaseMapping mapping = assertMapping(descriptor, attributeName);
-
- Assert.assertFalse(mapping.isLazy());
- }
-
- public static void assertNotLazy(EntityManagerFactory emf, String entityTypeName, String attributeName) {
- assertNotLazy(assertEntity(emf, entityTypeName), attributeName);
- }
-
- public static ForeignReferenceMapping assertRelationship(ClassDescriptor descriptor, String attributeName) {
- DatabaseMapping mapping = assertMapping(descriptor, attributeName);
-
- Assert.assertTrue(mapping.isForeignReferenceMapping());
-
- return (ForeignReferenceMapping) mapping;
- }
-
- public static ForeignReferenceMapping assertRelationship(EntityManagerFactory emf, String entityTypeName, String attributeName) {
- return assertRelationship(assertEntity(emf, entityTypeName), attributeName);
- }
-
- public static void assertPrivateOwned(ClassDescriptor descriptor, String attributeName) {
- ForeignReferenceMapping mapping = assertRelationship(descriptor, attributeName);
- Assert.assertTrue(mapping.isPrivateOwned());
- }
-
- public static void assertPrivateOwned(EntityManagerFactory emf, String entityTypeName, String attributeName) {
- assertPrivateOwned(assertEntity(emf, entityTypeName), attributeName);
- }
-
- /**
- * Verify that the named attribute is loaded. This will return false for
- * lazy mappings that are not loaded into the provided entity instance.
- */
- public static void assertLoaded(EntityManagerFactory emf, Object entity, String attribute) {
- ClassDescriptor descriptor = assertEntity(emf, entity);
- DatabaseMapping mapping = assertMapping(descriptor, attribute);
-
- if (mapping.isDirectToFieldMapping() && entity instanceof FetchGroupTracker) {
- Assert.assertTrue("DirectToFieldMapping for '" + attribute + "' is not loaded", ((FetchGroupTracker) entity)._persistence_isAttributeFetched(attribute));
- } else {
-
- Object value = mapping.getAttributeValueFromObject(entity);
- if (value instanceof IndirectContainer) {
- Assert.assertTrue("IndirectContainer for '" + attribute + "' is not loaded", ((IndirectContainer) value).isInstantiated());
- }
- if (value instanceof ValueHolderInterface) {
- Assert.assertTrue("ValueHolderInterface for '" + attribute + "' is not loaded", ((ValueHolderInterface) value).isInstantiated());
- }
- }
- }
-
- /**
- * Verify that the named attribute is loaded. This will return false for
- * lazy mappings that are not loaded into the provided entity instance.
- */
- public static void assertNotLoaded(EntityManagerFactory emf, Object entity, String attribute) {
- ClassDescriptor descriptor = assertEntity(emf, entity);
- DatabaseMapping mapping = assertMapping(descriptor, attribute);
-
- if (mapping.isDirectToFieldMapping() && entity instanceof FetchGroupTracker) {
- Assert.assertFalse("DirectToFieldMapping for '" + attribute + "' is loaded", ((FetchGroupTracker) entity)._persistence_isAttributeFetched(attribute));
- } else {
-
- AttributeAccessor accessor = mapping.getAttributeAccessor();
-
- // Avoid calling _persistence_get<attribute-name>_vh methods
- if (accessor.isMethodAttributeAccessor() && ((MethodAttributeAccessor) accessor).getGetMethodName().startsWith("_persistence_get")) {
- accessor = new InstanceVariableAttributeAccessor();
- accessor.setAttributeName("_persistence_" + mapping.getAttributeName() + "_vh");
- accessor.initializeAttributes(mapping.getDescriptor().getJavaClass());
- }
-
- Object value = accessor.getAttributeValueFromObject(entity);
- if (value instanceof IndirectContainer) {
- Assert.assertFalse("IndirectContainer for '" + attribute + "' is loaded", ((IndirectContainer) value).isInstantiated());
- }
- if (value instanceof ValueHolderInterface) {
- Assert.assertFalse("ValueHolderInterface for '" + attribute + "' is loaded", ((ValueHolderInterface) value).isInstantiated());
- }
- }
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.common/testing/EclipseLinkJPATest.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.common/testing/EclipseLinkJPATest.java
deleted file mode 100644
index 16ded90..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.common/testing/EclipseLinkJPATest.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- * - ported from earlier Oracle Toplink examples
- ******************************************************************************/
-package testing;
-
-import java.util.HashMap;
-import java.util.Map;
-import static org.junit.Assert.*;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import javax.persistence.PersistenceContext;
-
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.junit.After;
-import org.junit.AfterClass;
-
-import example.util.ExamplePropertiesLoader;
-
-/**
- * Base test case for testing a JPA persistence unit in JavaSE using JUnit4.
- *
- * Through the usage
- *
- * @PersistenceContext on subclasses a developer can indicate the persistence
- * unit name that the
- * @BeforeClass method should use to access the entityManager.
- *
- * @author dclarke
- * @since EclipseLink 1.1.2
- */
-public abstract class EclipseLinkJPATest {
-
- /**
- * This is he current EMF in use
- */
- private static EntityManagerFactory emf;
-
- private EntityManager entityManager;
-
- protected EntityManagerFactory getEMF() {
- if (emf == null) {
- emf = createEMF(getUnitName());
- }
-
- return emf;
- }
-
- protected EntityManager getEntityManager() {
- if (this.entityManager == null) {
- this.entityManager = getEMF().createEntityManager();
- }
-
- verifyConfig(this.entityManager);
-
- return this.entityManager;
- }
-
- protected EntityManagerFactory createEMF(String unitName) {
- if (emf != null) {
- if (emf.isOpen()) {
- emf.close();
- }
- }
-
- Assert.assertNotNull("EclipseLinkJPATest.createEMF:: Null unit name", unitName);
-
- try {
- return createEMF(unitName, null);
- } catch (RuntimeException e) {
- System.out.println("Persistence.createEMF FAILED: " + e.getMessage());
- e.printStackTrace();
- throw e;
- }
- }
-
- protected String getUnitName() {
- PersistenceContext context = null;
- Class<?> javaClass = getClass();
-
- while (context == null && javaClass != Object.class) {
- context = (PersistenceContext) javaClass.getAnnotation(PersistenceContext.class);
- javaClass = javaClass.getSuperclass();
- }
- Assert.assertNotNull("No @PersistenceContext found", context);
-
- return context.unitName();
- }
-
- /**
- *
- * @param properties
- * @return
- * @throws Exception
- */
- protected EntityManagerFactory createEMF(String unitName, Map<String, Object> properties) {
- try {
- Map<String, Object> emfProps = getEMFProperties();
-
- if (properties != null) {
- emfProps.putAll(properties);
- }
-
- EntityManagerFactory emf = Persistence.createEntityManagerFactory(unitName, emfProps);
- QuerySQLTracker.install(JpaHelper.getServerSession(emf));
- return emf;
- } catch (Exception e) {
- System.out.println("Persistence.createEMF FAILED: " + e.getMessage());
- e.printStackTrace();
- throw new RuntimeException("EclipseLinkJPATest.createEMF(" + unitName + ", properties) - failed", e);
- }
- }
-
- /**
- *
- * @return
- */
- protected Map<String, Object> getEMFProperties() {
- Map<String, Object> properties = new HashMap<String, Object>();
-
- ExamplePropertiesLoader.loadProperties(properties);
-
- return properties;
- }
-
- /**
- * This method is invoked prior to the return of an EntityManager from
- * {@link #getEntityManager()}. The intent is that subclasses of this test
- * class can override this method to verify configuration information that
- * must be true for all test cases. This of course assumes
- * {@link #getEntityManager()} is called in each test case.
- */
- protected void verifyConfig(EntityManager em) {
- assertNotNull("EntityManager is null", em);
- }
-
- protected QuerySQLTracker getQuerySQLTracker(EntityManager em) {
- return QuerySQLTracker.getTracker(JpaHelper.getEntityManager(em).getActiveSession());
- }
-
- protected QuerySQLTracker getQuerySQLTracker(EntityManagerFactory emf) {
- return QuerySQLTracker.getTracker(JpaHelper.getServerSession(emf));
- }
-
- @After
- public void cleanupClosedEMF() {
- if (this.entityManager != null) {
-
- if (this.entityManager.getTransaction().isActive()) {
- this.entityManager.getTransaction().rollback();
- }
- if (this.entityManager.isOpen()) {
- this.entityManager.close();
- }
- }
- this.entityManager = null;
-
- if (emf != null) {
- if (!emf.isOpen()) {
- emf = null;
- } else {
- QuerySQLTracker.getTracker(JpaHelper.getServerSession(emf)).reset();
- }
- }
- }
-
- @AfterClass
- public static void closeEMF() throws Exception {
- if (emf != null && emf.isOpen()) {
- emf.close();
- emf = null;
- }
- }
-
- protected ClassDescriptor getDescriptor(Object entity) {
- return JpaHelper.getServerSession(getEMF()).getClassDescriptor(entity);
- }
-
- protected ClassDescriptor getDescriptor(String alias) {
- return JpaHelper.getServerSession(getEMF()).getClassDescriptorForAlias(alias);
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.common/testing/QuerySQLTracker.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.common/testing/QuerySQLTracker.java
deleted file mode 100644
index 9ac9a8d..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.common/testing/QuerySQLTracker.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- * - ported from earlier Oracle TopLink examples
- ******************************************************************************/
-package testing;
-
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.persistence.internal.helper.Helper;
-import org.eclipse.persistence.logging.DefaultSessionLog;
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.logging.SessionLogEntry;
-import org.eclipse.persistence.queries.DatabaseQuery;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.SessionEvent;
-import org.eclipse.persistence.sessions.SessionEventAdapter;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.1.2
- */
-public class QuerySQLTracker extends SessionEventAdapter {
- private List<QueryResult> queries;
-
- /**
- * Constructs and installs the event listener and sql tracking session log
- *
- * @param session
- */
- private QuerySQLTracker(Session session) {
- session.getEventManager().addListener(this);
- session.setSessionLog(new SQLTrackingSessionLog(session, this));
- reset();
- }
-
- public static QuerySQLTracker install(Session session) {
- if (session.getSessionLog() instanceof SQLTrackingSessionLog) {
- return ((SQLTrackingSessionLog) session.getSessionLog())
- .getTracker();
- }
- return new QuerySQLTracker(session);
- }
-
- /**
- * Helper method to retrieve a tracker from a session where it was installed
- * If the session exists but does not have a tracler installed then an
- * exception is thrown.
- */
- public static QuerySQLTracker getTracker(Session session) {
- if (session == null) {
- return null;
- }
- SessionLog sessionLog = session.getSessionLog();
-
- if (sessionLog instanceof QuerySQLTracker.SQLTrackingSessionLog) {
- return ((QuerySQLTracker.SQLTrackingSessionLog) sessionLog)
- .getTracker();
- }
- throw new RuntimeException(
- "Could not retireve QuerySQLTracke from session: " + session);
- }
-
- /**
- * Reset the lists of SQL and queries being tracked
- */
- public void reset() {
- this.queries = new ArrayList<QueryResult>();
- }
-
- public List<QueryResult> getQueries() {
- return this.queries;
- }
-
- protected QuerySQLTracker.QueryResult getCurrentResult() {
- if (getQueries().size() == 0) {
- getQueries().add(new QueryResult(null));
- // throw new RuntimeException("Received SQL without a Query ???");
- }
- return getQueries().get(getQueries().size() - 1);
- }
-
- public int getTotalSQLCalls() {
- int totalSQLCalls = 0;
-
- for (QueryResult result : getQueries()) {
- totalSQLCalls += result.sqlStatements.size();
- }
-
- return totalSQLCalls;
- }
-
- public int getTotalSQLCalls(String startsWith) {
- int sqlCalls = 0;
-
- for (QueryResult result : getQueries()) {
- for (String sql : result.sqlStatements) {
- String sub = sql.substring(0, startsWith.length());
- if (sub.equalsIgnoreCase(startsWith)) {
- sqlCalls++;
- }
- }
- }
-
- return sqlCalls;
- }
-
- public int getTotalSQLSELECTCalls() {
- return getTotalSQLCalls("SELECT");
- }
-
- public int getTotalSQLINSERTCalls() {
- return getTotalSQLCalls("INSERT");
- }
-
- public int getTotalSQLUPDATECalls() {
- return getTotalSQLCalls("UPDATE");
- }
-
- public int getTotalSQLDELETECalls() {
- return getTotalSQLCalls("DELETE");
- }
-
- public void preExecuteQuery(SessionEvent event) {
- //System.err.println("*** QuerySQLTracker.preExecuteQuery(" + event.getQuery() + ")");
- //Thread.dumpStack();
- QueryResult result = new QueryResult(event.getQuery());
- getQueries().add(result);
- }
-
- public void postExecuteQuery(SessionEvent event) {
- if (getCurrentResult().query == null) {
- getCurrentResult().setQuery(event.getQuery());
- }
- getCurrentResult().setResult(event.getResult());
- }
-
- protected class QueryResult {
- private DatabaseQuery query;
- private String resultString = null;
- private List<String> sqlStatements = new ArrayList<String>();
-
- QueryResult(DatabaseQuery q) {
- query = q;
- }
-
- protected void setQuery(DatabaseQuery query) {
- this.query = query;
- }
-
- protected void setResult(Object queryResult) {
- StringWriter writer = new StringWriter();
- writer.write(Helper.getShortClassName(query));
- writer.write("[" + System.identityHashCode(query) + "]");
- writer.write(" result = ");
-
- Object result = queryResult;
- if (queryResult instanceof Collection<?>) {
- result = ((Collection<?>) queryResult).toArray();
- }
-
- if (result == null) {
- writer.write("NONE");
- } else {
- if (result instanceof Object[]) {
- Object[] results = (Object[]) result;
- writer.write("<" + results.length + "> [");
- for (int index = 0; index < results.length; index++) {
- if (index > 0) {
- writer.write(", ");
- }
- writer.write(results[index] + "");
- }
- writer.write("]");
- resultString = writer.toString();
- } else {
- writer.write(result.toString());
- }
- }
-
- this.resultString = writer.toString();
- }
-
- public void addSQL(String sql) {
- sqlStatements.add(sql);
- }
-
- public String toString() {
- if (this.resultString == null) {
- setResult(null);
- }
- return this.resultString;
- }
- }
-
- /**
- * This custom SessionLog implementation wraps the existng one and redirects
- * all SQL calls to the tracker. All messages are also passed to the orginal
- * tracker.
- */
- public class SQLTrackingSessionLog extends DefaultSessionLog {
- private QuerySQLTracker tracker;
-
- private SessionLog originalLog;
-
- protected SQLTrackingSessionLog(Session session,
- QuerySQLTracker aTracker) {
- this.tracker = aTracker;
- this.originalLog = session.getSessionLog();
- setSession(session);
- //setWriter(this.originalLog.getWriter());
- }
-
- public QuerySQLTracker getTracker() {
- return this.tracker;
- }
-
- public synchronized void log(SessionLogEntry entry) {
-
- if (entry.getNameSpace() != null
- && entry.getNameSpace().equalsIgnoreCase(SessionLog.SQL)) {
- getTracker().getCurrentResult().addSQL(entry.getMessage());
- }
- this.originalLog.log(entry);
- }
-
- @Override
- public int getLevel(String category) {
- return this.originalLog.getLevel(category);
- }
-
- @Override
- public void setLevel(int level, String category) {
- this.originalLog.setLevel(level, category);
- }
-
- @Override
- public int getLevel() {
- return this.originalLog.getLevel();
- }
-
- @Override
- public void setLevel(int level) {
- this.originalLog.setLevel(level);
- }
-
- @Override
- public boolean shouldPrintConnection() {
- return this.originalLog.shouldPrintConnection();
- }
-
- @Override
- public boolean shouldPrintDate() {
- return this.originalLog.shouldPrintDate();
- }
-
- @Override
- public boolean shouldPrintSession() {
- return this.originalLog.shouldPrintSession();
- }
-
- @Override
- public boolean shouldPrintThread() {
- return this.originalLog.shouldPrintThread();
- }
- }
-
- public void printResults(String prefix) {
- System.out.println(prefix + "-QuerySQLTracker-Queries:");
-
- int sql = 0;
- for (int index = 0; index < getQueries().size(); index++) {
- QueryResult result = getQueries().get(index);
-
- System.out.println("\t" + (index + 1) + "> " + result);
-
- for (int sqlNum = 0; sqlNum < result.sqlStatements.size(); sqlNum++) {
- sql++;
- System.out.println("\t\t" + (index + 1) + "." + (sqlNum + 1)
- + "-" + sql + "> " + result.sqlStatements.get(sqlNum));
- }
- }
-
- System.out.println(prefix + "-QuerySQLTracker-Queries: "
- + getQueries().size());
- System.out.println(prefix + "-QuerySQLTracker-INSERT: "
- + getTotalSQLINSERTCalls());
- System.out.println(prefix + "-QuerySQLTracker-SELECT: "
- + getTotalSQLSELECTCalls());
- System.out.println(prefix + "-QuerySQLTracker-UPDATE: "
- + getTotalSQLUPDATECalls());
- System.out.println(prefix + "-QuerySQLTracker-DELETE: "
- + getTotalSQLDELETECalls());
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/META-INF/eclipselink-orm.xml b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/META-INF/eclipselink-orm.xml
deleted file mode 100644
index 02ab67d..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/META-INF/eclipselink-orm.xml
+++ /dev/null
@@ -1,178 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<entity-mappings version="2.0"
- xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
- <persistence-unit-metadata>
- <persistence-unit-defaults>
- <access>FIELD</access>
- </persistence-unit-defaults>
- </persistence-unit-metadata>
-
- <object-type-converter name="gender-converter"
- object-type="model.Gender" data-type="java.lang.String">
- <conversion-value object-value="Male" data-value="M" />
- <conversion-value object-value="Female" data-value="F" />
- </object-type-converter>
-
- <named-query name="Employee.findAll">
- <query>SELECT e FROM Employee e ORDER BY e.lastName, e.firstName</query>
- <hint name="eclipselink.query-results-cache" value="True" />
- </named-query>
-
- <named-query name="Employee.findMin">
- <query>SELECT e FROM Employee e WHERE e.id IN (SELECT MIN(ee.id) FROM
- Employee ee)</query>
- </named-query>
-
- <entity class="model.LargeProject">
- <table name="FP_LPROJECT" />
- <discriminator-value>L</discriminator-value>
- <attributes>
- <basic name="budget" />
- <basic name="milestone">
- <temporal>TIMESTAMP</temporal>
- </basic>
- </attributes>
- </entity>
-
- <entity class="model.Address">
- <table name="FP_ADDRESS" />
- <attributes>
- <id name="id">
- <column name="ADDRESS_ID" />
- <generated-value strategy="SEQUENCE" />
- </id>
- <basic name="city" />
- <basic name="country" />
- <basic name="province" />
- <basic name="postalCode">
- <column name="P_CODE" />
- </basic>
- <basic name="street" />
- </attributes>
- </entity>
-
- <entity class="model.PhoneNumber">
- <table name="FP_PHONE" />
- <id-class class="model.PhoneNumber$ID" />
- <attributes>
- <id name="id">
- <column name="EMP_ID" updatable="false" insertable="false" />
- </id>
- <id name="type">
- <column updatable="false" />
- </id>
- <basic name="areaCode">
- <column name="AREA_CODE" />
- </basic>
- <basic name="number">
- <column name="P_NUMBER" />
- </basic>
- <many-to-one name="owner" fetch="EAGER">
- <join-column name="EMP_ID" />
- </many-to-one>
- </attributes>
- </entity>
-
- <entity class="model.Employee">
- <table name="FP_EMPLOYEE" />
- <secondary-table name="FP_SALARY" />
- <attributes>
- <id name="id">
- <column name="EMP_ID" />
- <generated-value strategy="SEQUENCE" />
- </id>
- <basic name="firstName">
- <column name="F_NAME" />
- </basic>
- <basic name="lastName">
- <column name="L_NAME" />
- </basic>
- <basic name="startTime">
- <column name="START_TIME" />
- </basic>
- <basic name="endTime">
- <column name="END_TIME" />
- </basic>
- <basic name="gender">
- <column name="GENDER" />
- <convert>gender-converter</convert>
- </basic>
- <basic name="salary">
- <column table="FP_SALARY" />
- </basic>
- <basic-collection name="responsibilities">
- <value-column name="RESPON_DESC" />
- <collection-table name="FP_RESPONS" />
- </basic-collection>
- <version name="version" />
- <many-to-one name="manager" fetch="LAZY" optional="true">
- <join-column name="MANAGER_ID" />
- </many-to-one>
- <one-to-many name="managedEmployees" mapped-by="manager" />
- <one-to-many name="phoneNumbers" mapped-by="owner">
- <cascade>
- <cascade-all />
- </cascade>
- <private-owned />
- </one-to-many>
- <one-to-one name="address" fetch="LAZY">
- <join-column name="ADDR_ID" />
- <cascade>
- <cascade-all />
- </cascade>
- <private-owned />
- </one-to-one>
- <many-to-many name="projects">
- <join-table name="FP_PROJ_EMP">
- <join-column name="EMP_ID" />
- <inverse-join-column name="PROJ_ID" />
- </join-table>
- </many-to-many>
- <embedded name="period" />
- </attributes>
- </entity>
-
- <entity class="model.SmallProject">
- <table name="FP_PROJECT" />
- <discriminator-value>S</discriminator-value>
- </entity>
-
- <entity class="model.Project">
- <table name="FP_PROJECT" />
- <inheritance strategy="JOINED" />
- <discriminator-column name="PROJ_TYPE"
- discriminator-type="CHAR" />
- <attributes>
- <id name="id">
- <column name="PROJ_ID" />
- <generated-value strategy="SEQUENCE" />
- </id>
- <basic name="description">
- <column name="DESCRIP" />
- </basic>
- <basic name="name">
- <column name="PROJ_NAME" />
- </basic>
- <version name="version" />
- <many-to-one name="teamLeader" fetch="LAZY">
- <join-column name="LEADER_ID" />
- </many-to-one>
- </attributes>
- </entity>
-
- <embeddable class="model.EmploymentPeriod">
- <attributes>
- <basic name="startDate">
- <column name="START_DATE" />
- <temporal>DATE</temporal>
- </basic>
- <basic name="endDate">
- <column name="END_DATE" />
- <temporal>DATE</temporal>
- </basic>
- </attributes>
- </embeddable>
-
-</entity-mappings>
\ No newline at end of file
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/META-INF/persistence.xml b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/META-INF/persistence.xml
deleted file mode 100644
index e09ed56..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/META-INF/persistence.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="windows-1252" ?>
-<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_1_0.xsd"
- version=" 1.0" xmlns="http://java.sun.com/xml/ns/persistence">
- <persistence-unit name="employee">
- <properties>
- <property name="eclipselink.descriptor.customizer.PhoneNumber" value="model.persistence.PhoneNumberCustomizer"/>
- </properties>
- </persistence-unit>
-</persistence>
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/example/JavaSEExample.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/example/JavaSEExample.java
deleted file mode 100644
index 2bb9cbc..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/example/JavaSEExample.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package example;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import example.util.ExamplePropertiesLoader;
-
-public class JavaSEExample {
-
- public static void main(String[] args) {
- Map<String, Object> properties = new HashMap<String, Object>();
- ExamplePropertiesLoader.loadProperties(properties);
- EntityManagerFactory emf = Persistence.createEntityManagerFactory("employee", properties);
-
- EntityManager em = emf.createEntityManager();
-
- em.createQuery("SELECT e FROM Employee e").getResultList();
-
- em.close();
- emf.close();
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/example/Queries.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/example/Queries.java
deleted file mode 100644
index a98386a..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/example/Queries.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package example;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import model.Employee;
-import model.Gender;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.internal.jpa.EJBQueryImpl;
-import org.eclipse.persistence.internal.jpa.EntityManagerImpl;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.QueryByExamplePolicy;
-import org.eclipse.persistence.queries.ReadAllQuery;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-
-/**
- * Simple query examples for the XML mapped Employee domain model.
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-@SuppressWarnings("unchecked")
-public class Queries {
-
- /**
- * Simple example using dynamic JP QL to retrieve all Employee instances
- * sorted by lastName and firstName.
- */
- public List<Employee> readAllEmployeesUsingJPQL(EntityManager em) {
- return em.createQuery("SELECT e FROM Employee e ORDER BY e.lastName ASC, e.firstName ASC").getResultList();
- }
-
- public List<Employee> joinFetchJPQL(EntityManager em) {
- return em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address ORDER BY e.lastName ASC, e.firstName ASC").getResultList();
- }
-
- public List<Employee> joinFetchHint(EntityManager em) {
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.manager.address.city = 'Ottawa' ORDER BY e.lastName ASC, e.firstName ASC");
- query.setHint(QueryHints.FETCH, "e.address");
- query.setHint(QueryHints.FETCH, "e.manager");
- query.setHint(QueryHints.FETCH, "e.manager.address");
- query.setHint(QueryHints.BATCH, "e.manager.phoneNumbers");
- List<Employee> emps = query.getResultList();
-
- for (Employee emp : emps) {
- emp.getManager().getPhoneNumbers().size();
- }
-
- return emps;
- }
-
- /**
- *
- * @param em
- * @return
- */
- public static int minimumEmployeeId(EntityManager em) {
- return ((Number) em.createQuery("SELECT MIN(e.id) FROM Employee e").getSingleResult()).intValue();
- }
-
- public Employee minimumEmployee(EntityManager em) {
- Query q = em.createQuery("SELECT e FROM Employee e WHERE e.id in (SELECT MIN(ee.id) FROM Employee ee)");
-
- return (Employee) q.getSingleResult();
- }
-
- public List<Employee> findEmployeesUsingGenderIn(EntityManager em) {
- return em.createQuery("SELECT e FROM Employee e WHERE e.gender IN (:GENDER1, :GENDER2)").setParameter("GENDER1", Gender.Male).setParameter("GENDER2", Gender.Female).getResultList();
- }
-
- public List<Employee> findUsingNativeReadAllQuery(EntityManager em) {
- ReadAllQuery raq = new ReadAllQuery(Employee.class);
- ExpressionBuilder eb = raq.getExpressionBuilder();
- raq.setSelectionCriteria(eb.get("gender").equal(Gender.Male));
-
- Query query = JpaHelper.createQuery(raq, em);
-
- return query.getResultList();
- }
-
- /**
- * Example of EclipseLink's native query-by-example support.
- *
- * @param em
- * @param sampleEmployee
- * @return
- */
- public Employee queryByExample(EntityManager em, Employee sampleEmployee) {
- QueryByExamplePolicy policy = new QueryByExamplePolicy();
- policy.excludeDefaultPrimitiveValues();
- ReadObjectQuery roq = new ReadObjectQuery(sampleEmployee, policy);
- // Wrap the native query in a JPA Query and execute it.
- Query query = new EJBQueryImpl<Employee>(roq, (EntityManagerImpl) JpaHelper.getEntityManager(em));
- return (Employee) query.getSingleResult();
- }
-
- public static Employee minEmployeeWithAddressAndPhones(EntityManager em) {
- return (Employee) em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT MIN(p.id) FROM PhoneNumber p)").getSingleResult();
- }
-
- public Employee minEmployeeWithManagerWithAddress(EntityManager em) {
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.manager WHERE e.manager.address IS NOT NULL ORDER BY e.id").getResultList();
- return emps.get(0);
- }
-
- public static int minEmployeeIdWithAddressAndPhones(EntityManager em) {
- return ((Number) em.createQuery("SELECT e.id FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT MIN(p.id) FROM PhoneNumber p)").getSingleResult()).intValue();
- }
-
-public List<Employee> fetchGroupExample(EntityManager em) {
- Query query = em.createQuery("SELECT e FROM Employee e ORDER BY e.id");
-
- FetchGroup fetchGroup = new FetchGroup();
- fetchGroup.addAttribute("id");
- fetchGroup.addAttribute("firstName");
- fetchGroup.addAttribute("lastName");
-
- query.setHint(QueryHints.FETCH_GROUP, fetchGroup);
-
- return query.getResultList();
-}
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/example/Sample.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/example/Sample.java
deleted file mode 100644
index 1f2a637..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/example/Sample.java
+++ /dev/null
@@ -1,676 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package example;
-
-import java.util.*;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import junit.framework.Assert;
-import model.*;
-
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.DeleteAllQuery;
-import org.eclipse.persistence.queries.ReportQuery;
-
-
-public class Sample {
-
- public static final Sample population = new Sample();
-
- public Employee[] employees = { basicEmployeeExample1(),
- basicEmployeeExample2(), basicEmployeeExample3(),
- basicEmployeeExample4(), basicEmployeeExample5(),
- basicEmployeeExample6(), basicEmployeeExample7(),
- basicEmployeeExample8(), basicEmployeeExample9(),
- basicEmployeeExample10(), basicEmployeeExample11(),
- basicEmployeeExample12() };
-
- private SmallProject[] smallProjects = { basicSmallProjectExample1(),
- basicSmallProjectExample2(), basicSmallProjectExample3(),
- basicSmallProjectExample4(), basicSmallProjectExample5(),
- basicSmallProjectExample7(), basicSmallProjectExample8(),
- basicSmallProjectExample9(), basicSmallProjectExample10() };
-
- private LargeProject[] largeProjects = { basicLargeProjectExample1(),
- basicLargeProjectExample2(), basicLargeProjectExample3(),
- basicLargeProjectExample4(), basicLargeProjectExample5() };
-
- private Sample() {
-
- // Setup management hierarchy
- addManagedEmployees(0, new int[] { 2, 3, 4 });
- addManagedEmployees(1, new int[] { 5, 0 });
- addManagedEmployees(2, new int[] {});
- addManagedEmployees(3, new int[] {});
- addManagedEmployees(4, new int[] {});
- addManagedEmployees(5, new int[] {});
- addManagedEmployees(6, new int[] {});
- addManagedEmployees(7, new int[] {});
- addManagedEmployees(8, new int[] {});
- addManagedEmployees(9, new int[] { 7, 8, 10, 11 });
- addManagedEmployees(10, new int[] { 6 });
- addManagedEmployees(11, new int[] { 1 });
-
- // Setup Employee-Project associations
- addProjects(0, new int[] { 0, 1, 2 }, new int[] {});
- addProjects(1, new int[] { 3, 4, 0 }, new int[] {});
- addProjects(2, new int[] { 3 }, new int[] { 3, 4 });
- addProjects(4, new int[] { 3, 1 }, new int[] { 2, 4 });
- addProjects(5, new int[] {}, new int[] { 1 });
- addProjects(6, new int[] {}, new int[] { 1 });
-
- // Setup LargeProject leads
- this.largeProjects[0].setTeamLeader(this.employees[1]);
- this.largeProjects[3].setTeamLeader(this.employees[2]);
- this.largeProjects[4].setTeamLeader(this.employees[2]);
- }
-
- public Employee basicEmployeeExample1() {
- Employee employee = new Employee();
-
- employee.setFirstName("Bob");
- employee.setLastName("Smith");
- employee.setGender(Gender.Male);
- employee.setSalary(35000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(1996, 0, 1);
- employmentPeriod.setStartDate(1993, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Toronto");
- address.setPostalCode("L5J2B5");
- address.setProvince("ONT");
- address.setStreet("1450 Acme Cr., Suite 4");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Water the office plants.");
- employee.addResponsibility("Maintain the kitchen facilities.");
- employee.addPhoneNumber("Work", "613", "5558812");
-
- return employee;
- }
-
- public Employee basicEmployeeExample10() {
- Employee employee = new Employee();
-
- employee.setFirstName("Jill");
- employee.setLastName("May");
- employee.setGender(Gender.Female);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setStartDate(1991, 10, 11);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Calgary");
- address.setPostalCode("J5J2B5");
- address.setProvince("AB");
- address.setStreet("1111 Mooseland Rd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.setSalary(56232);
- employee.addPhoneNumber("Work", "613", "5558812");
- employee.addPhoneNumber("Work Fax", "613", "5555943");
-
- return employee;
- }
-
- public Employee basicEmployeeExample11() {
- Employee employee = new Employee();
-
- employee.setFirstName("Sarah-Lou");
- employee.setLastName("Smitty");
- employee.setGender(Gender.Female);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(1996, 0, 1);
- employmentPeriod.setStartDate(1993, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Arnprior");
- address.setPostalCode("W1A2B5");
- address.setProvince("ONT");
- address.setStreet("1 Hawthorne Drive");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.setSalary(75000);
- employee.addPhoneNumber("Work Fax", "613", "5555943");
- employee.addPhoneNumber("Home", "613", "5551234");
- employee.addPhoneNumber("Cellular", "416", "5551111");
-
- return employee;
- }
-
- public Employee basicEmployeeExample12() {
- Employee employee = new Employee();
-
- employee.setFirstName("Jim-Bob");
- employee.setLastName("Jefferson");
- employee.setGender(Gender.Male);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 12);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Yellowknife");
- address.setPostalCode("Y5J2N5");
- address.setProvince("YK");
- address.setStreet("1112 Gold Rush Rd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.setSalary(50000);
- employee.addPhoneNumber("Home", "613", "5551234");
- employee.addPhoneNumber("Cellular", "416", "5551111");
-
- return employee;
- }
-
- public Employee basicEmployeeExample2() {
- Employee employee = new Employee();
-
- employee.setFirstName("John");
- employee.setLastName("Way");
- employee.setGender(Gender.Male);
- employee.setSalary(53000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setStartDate(1991, 10, 11);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Ottawa");
- address.setPostalCode("K5J2B5");
- address.setProvince("ONT");
- address.setStreet("12 Merivale Rd., Suite 5");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Hire people when more people are required.");
- employee.addResponsibility("Lay off employees when less people are required.");
- employee.addPhoneNumber("Work", "613", "5558812");
- employee.addPhoneNumber("ISDN", "905", "5553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample3() {
- Employee employee = new Employee();
-
- employee.setFirstName("Charles");
- employee.setLastName("Chanley");
- employee.setGender(Gender.Male);
- employee.setSalary(43000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Montreal");
- address.setPostalCode("Q2S5Z5");
- address.setProvince("QUE");
- address.setStreet("1 Canadien Place");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Perform code reviews as required.");
- employee.addPhoneNumber("Pager", "976", "5556666");
- employee.addPhoneNumber("ISDN", "905", "5553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample4() {
- Employee employee = new Employee();
-
- employee.setFirstName("Emanual");
- employee.setLastName("Smith");
- employee.setGender(Gender.Male);
- employee.setSalary(49631);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Vancouver");
- address.setPostalCode("N5J2N5");
- address.setProvince("BC");
- address.setStreet("20 Mountain Blvd., Floor 53, Suite 6");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Have to fix the Database problem.");
- employee.addPhoneNumber("Work Fax", "613", "5555943");
- employee.addPhoneNumber("Cellular", "416", "5551111");
- employee.addPhoneNumber("Pager", "976", "5556666");
- employee.addPhoneNumber("ISDN", "905", "5553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample5() {
- Employee employee = new Employee();
-
- employee.setFirstName("Sarah");
- employee.setLastName("Way");
- employee.setGender(Gender.Female);
- employee.setSalary(87000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 6, 31);
- employmentPeriod.setStartDate(1995, 4, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Prince Rupert");
- address.setPostalCode("K3K5D5");
- address.setProvince("BC");
- address.setStreet("3254 Parkway Place");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Write code documentation.");
- employee.addPhoneNumber("Work", "613", "5558812");
- employee.addPhoneNumber("ISDN", "905", "5553691");
- employee.addPhoneNumber("Home", "613", "5551234");
-
- return employee;
- }
-
- public Employee basicEmployeeExample6() {
- Employee employee = new Employee();
-
- employee.setFirstName("Marcus");
- employee.setLastName("Saunders");
- employee.setGender(Gender.Male);
- employee.setSalary(54300);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 12);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Perth");
- address.setPostalCode("Y3Q2N9");
- address.setProvince("ONT");
- address.setStreet("234 Caledonia Lane");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Write user specifications.");
- employee.addPhoneNumber("ISDN", "905", "5553691");
- employee.addPhoneNumber("Work", "613", "5558812");
-
- return employee;
- }
-
- public Employee basicEmployeeExample7() {
- Employee employee = new Employee();
-
- employee.setFirstName("Nancy");
- employee.setLastName("White");
- employee.setGender(Gender.Female);
- employee.setSalary(31000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(1996, 0, 1);
- employmentPeriod.setStartDate(1993, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Metcalfe");
- address.setPostalCode("Y4F7V6");
- address.setProvince("ONT");
- address.setStreet("2 Anderson Rd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addPhoneNumber("Home", "613", "5551234");
-
- return employee;
- }
-
- public Employee basicEmployeeExample8() {
- Employee employee = new Employee();
-
- employee.setFirstName("Fred");
- employee.setLastName("Jones");
- employee.setGender(Gender.Male);
- employee.setSalary(500000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Victoria");
- address.setPostalCode("Z5J2N5");
- address.setProvince("BC");
- address.setStreet("382 Hyde Park Blvd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addPhoneNumber("Cellular", "416", "5551111");
- employee.addPhoneNumber("ISDN", "905", "5553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample9() {
- Employee employee = new Employee();
-
- employee.setFirstName("Betty");
- employee.setLastName("Jones");
- employee.setGender(Gender.Female);
- employee.setSalary(500001);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setStartDate(2001, 11, 31);
- employmentPeriod.setEndDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Smith Falls");
- address.setPostalCode("C6C6C6");
- address.setProvince("ONT");
- address.setStreet("89 Chocolate Drive");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addPhoneNumber("Work", "613", "5558812");
- employee.addPhoneNumber("ISDN", "905", "5553691");
-
- return employee;
- }
-
- public LargeProject basicLargeProjectExample1() {
- LargeProject largeProject = new LargeProject();
-
- largeProject.setName("Sales Reporting");
- largeProject.setDescription("A reporting application to report on the corporations database through TopLink.");
- largeProject.setBudget((double) 5000);
- largeProject.getMilestone().set(1991, 10, 11, 12, 0, 0);
-
- return largeProject;
- }
-
- public LargeProject basicLargeProjectExample2() {
- LargeProject largeProject = new LargeProject();
-
- largeProject.setName("Light Reporter");
- largeProject.setDescription("A lightweight application to report on the corporations database through TopLink.");
- largeProject.setBudget(100.98);
- largeProject.getMilestone().set(1999, 11, 25, 11, 40, 44);
-
- return largeProject;
- }
-
- public LargeProject basicLargeProjectExample3() {
- LargeProject largeProject = new LargeProject();
-
- largeProject.setName("TOPEmployee Management");
- largeProject.setDescription("A management application to report on the corporations database through TopLink.");
- largeProject.setBudget(4000.98);
- largeProject.getMilestone().set(1997, 10, 12, 1, 0, 0);
-
- return largeProject;
- }
-
- public LargeProject basicLargeProjectExample4() {
- LargeProject largeProject = new LargeProject();
-
- largeProject.setName("Enterprise System");
- largeProject.setDescription("A enterprise wide application to report on the corporations database through TopLink.");
- largeProject.setBudget(40.98);
- largeProject.getMilestone().set(1996, 8, 6, 6, 40, 44);
-
- return largeProject;
- }
-
- public LargeProject basicLargeProjectExample5() {
- LargeProject largeProject = new LargeProject();
-
- largeProject.setName("Problem Reporting System");
- largeProject.setDescription("A PRS application to report on the corporations database through TopLink.");
- largeProject.setBudget(101.98);
- largeProject.getMilestone().set(1997, 9, 6, 1, 40, 44);
-
- return largeProject;
- }
-
- public SmallProject basicSmallProjectExample1() {
- return new SmallProject("Enterprise", "A enterprise wide application to report on the corporations database through TopLink.");
- }
-
- public SmallProject basicSmallProjectExample10() {
- return new SmallProject("Staff Query Tool", "A tool to help staff query various things.");
- }
-
- public SmallProject basicSmallProjectExample2() {
- return new SmallProject("Sales Reporter", "A reporting application using JDK to report on the corporations database through TopLink.");
- }
-
- public SmallProject basicSmallProjectExample3() {
- return new SmallProject("TOP-Employee Manager", "A management application to report on the corporations database through TopLink.");
- }
-
- public SmallProject basicSmallProjectExample4() {
- return new SmallProject("Problem Reporter", "A PRS application to report on the corporations database through TopLink.");
- }
-
- public SmallProject basicSmallProjectExample5() {
- return new SmallProject("Feather Reporter", "An extremely lightweight application to report on the corporations database through TopLink.");
- }
-
- public SmallProject basicSmallProjectExample6() {
- return new SmallProject("Makework", "A makework project.");
- }
-
- public SmallProject basicSmallProjectExample7() {
- return new SmallProject("Marketing Query Tool", "A tool to help marketing query various things.");
- }
-
- public SmallProject basicSmallProjectExample8() {
- return new SmallProject("Shipping Query Tool", "A tool to help shipping query various things.");
- }
-
- public SmallProject basicSmallProjectExample9() {
- return new SmallProject("Accounting Query Tool", "A tool to help accounting query various things.");
- }
-
- private void addManagedEmployees(int managerIndex, int[] employeeIndeces) {
- Employee manager = this.employees[managerIndex];
-
- if (manager.getManagedEmployees().isEmpty()) {
- for (int index = 0; index < employeeIndeces.length; index++) {
- manager.addManagedEmployee(this.employees[employeeIndeces[index]]);
- }
- }
- }
-
- private void addProjects(int empIndex, int[] smallProjIndeces, int[] largeProjIndeces) {
- Employee employee = this.employees[empIndex];
-
- for (int index = 0; index < smallProjIndeces.length; index++) {
- employee.addProject(this.smallProjects[smallProjIndeces[index]]);
- }
-
- for (int index = 0; index < largeProjIndeces.length; index++) {
- employee.addProject(this.largeProjects[largeProjIndeces[index]]);
- }
- }
-
- /**
- * Register all of the population in the provided EntityManager to be
- * persisted This method should only be called from within a test case. It
- * asserts that the provided EntityManager is in a transaction and that the
- * database tables are empty.
- */
- public void persistAll(EntityManager em) {
- Assert.assertTrue("EntityManager not in Transaction", em.getTransaction().isActive());
-
- // Verify that the database tables are empty
- assertCount(em, Employee.class, 0);
- assertCount(em, Address.class, 0);
- assertCount(em, PhoneNumber.class, 0);
- assertCount(em, Project.class, 0);
-
- for (int index = 0; index < this.employees.length; index++) {
- em.persist(this.employees[index]);
- }
- for (int index = 0; index < this.smallProjects.length; index++) {
- em.persist(this.smallProjects[index]);
- }
- for (int index = 0; index < this.largeProjects.length; index++) {
- em.persist(this.largeProjects[index]);
- }
-
- em.flush();
- verifyCounts(em);
- }
-
- public void verifyCounts(EntityManager em) {
- assertCount(em, Employee.class, this.employees.length);
- assertCount(em, Address.class, this.employees.length);
- assertCount(em, Project.class, this.smallProjects.length + this.largeProjects.length);
- }
-
- /**
- * Verify that the provided entity type has no rows in the database using a
- * native ReportQuery.
- *
- * @param entityClass
- * @param count
- */
- public void assertCount(EntityManager em, Class<?> entityClass, int count) {
- ReportQuery query = new ReportQuery(entityClass, new ExpressionBuilder());
- query.addCount();
- query.setShouldReturnSingleValue(true);
-
- int dbCount = ((Number) JpaHelper.getEntityManager(em).getUnitOfWork().executeQuery(query)).intValue();
- Assert.assertEquals("Incorrect quantity found of " + entityClass, count, dbCount);
- }
-
- /**
- * Verify that the provided list of Employee instances matches the sample
- * population.
- *
- * @param employees
- */
- public void assertSame(List<Employee> dbEmps) {
- Assert.assertEquals("Incorrect quantity of employees", this.employees.length, dbEmps.size());
-
- Collections.sort(dbEmps, new EmployeeComparator());
-
- for (int index = 0; index < this.employees.length; index++) {
- Employee emp = employees[index];
- Employee dbEmp = dbEmps.get(index);
-
- Assert.assertEquals("First name does not match on employees[" + index + "]", emp.getFirstName(), dbEmp.getFirstName());
- Assert.assertEquals("Last name does not match on employees[" + index + "]", emp.getLastName(), dbEmp.getLastName());
- Assert.assertEquals("Salary does not match on employees[" + index + "]", emp.getSalary(), dbEmp.getSalary());
- }
- }
-
- /**
- * Simple comparator used to order the employees for use within assertSame
- */
- class EmployeeComparator implements Comparator<Employee> {
-
- public int compare(Employee emp1, Employee emp2) {
- return emp1.getId() - emp2.getId();
- }
-
- }
-
- /**
- * Extract the id's from the sample Employee instances.
- *
- * @param em
- * @return
- */
- public int[] getEmployeeIds(EntityManager em) {
- int[] ids = new int[this.employees.length];
-
- for (int index = 0; index < this.employees.length; index++) {
- if (this.employees[index].getId() <= 0) {
- Employee emp = new Queries().queryByExample(em, this.employees[index]);
-
- if (emp == null) {
- throw new RuntimeException("Could not find Employee: " + this.employees[index]);
- }
- this.employees[index].setId(emp.getId());
- }
- ids[index] = this.employees[index].getId();
- }
-
- return ids;
- }
-
- /**
- * Reset the database so that only the sample population exists.
- *
- * @param em
- */
- public void resetDatabase(EntityManager em) {
- em.getTransaction().begin();
-
- DeleteAllQuery deleteEmpsQuery = new DeleteAllQuery(Employee.class);
- ExpressionBuilder eb = deleteEmpsQuery.getExpressionBuilder();
- deleteEmpsQuery.setSelectionCriteria(eb.get("id").notIn(getEmployeeIds(em)));
- deleteEmpsQuery.setFlushOnExecute(true);
-
- JpaHelper.getEntityManager(em).getUnitOfWork().executeQuery(deleteEmpsQuery);
-
- em.getTransaction().commit();
- }
-
- public void resetSalary(EntityManager em) {
- boolean startedTX = !em.getTransaction().isActive();
-
- if (startedTX) {
- em.getTransaction().begin();
- }
-
- for (int index = 0; index < this.employees.length; index++) {
- Employee emp = this.employees[index];
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.firstName = :FNAME AND e.lastName = :LNAME");
- query.setParameter("FNAME", emp.getFirstName());
- query.setParameter("LNAME", emp.getLastName());
-
- Employee dbEmp = (Employee) query.getSingleResult();
- dbEmp.setSalary(this.employees[index].getSalary());
- }
-
- if (startedTX) {
- em.getTransaction().commit();
- }
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/example/Transactions.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/example/Transactions.java
deleted file mode 100644
index ec25d7a..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/example/Transactions.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package example;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-
-import model.Address;
-import model.Employee;
-import model.Gender;
-
-import org.eclipse.persistence.config.PessimisticLock;
-import org.eclipse.persistence.config.QueryHints;
-
-public class Transactions {
-
- /**
- * New entities with new related related entities can be persisted using
- * <code>EntityManager.persist(newEntity)</code>. The cascade setting on the
- * mappings determine how the related entities are handled. In this case
- * Employee has its relationship to Address and PhoneNumber configured with
- * cascade-all so the associated new entities will also be persisted.
- */
- public Employee createUsingPersist(EntityManager em) {
- Employee emp = new Employee();
- emp.setFirstName("Sample");
- emp.setLastName("Employee");
- emp.setGender(Gender.Male);
- emp.setSalary(123456);
-
- Address address = new Address();
- emp.setAddress(address);
-
- emp.addPhoneNumber("Mobile", "613", "555-1212");
-
- em.getTransaction().begin();
- em.persist(emp);
- em.getTransaction().commit();
-
- return emp;
- }
-
- /**
- *
- */
- public Employee createUsingMerge(EntityManager em) {
- Employee emp = new Employee();
- emp.setFirstName("Sample");
- emp.setLastName("Employee");
- emp.setGender(Gender.Male);
- emp.setSalary(123456);
-
- Address address = new Address();
- emp.setAddress(address);
-
- emp.addPhoneNumber("Mobile", "613", "555-1212");
-
- em.getTransaction().begin();
- // When merging the managed instance is returned from the call.
- // Further usage within the transaction must be done with this managed
- // entity.
- emp = em.merge(emp);
- em.getTransaction().commit();
-
- return emp;
- }
-
- /**
- *
- * @param em
- * @throws Exception
- */
- public void pessimisticLocking(EntityManager em) throws Exception {
-
- // Find the Employee with the minimum ID
- int minId = Queries.minimumEmployeeId(em);
-
- em.getTransaction().begin();
-
- // Lock Employee using query with hint
- Employee emp = (Employee) em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID").setParameter("ID", minId).setHint(QueryHints.PESSIMISTIC_LOCK, PessimisticLock.Lock).getSingleResult();
-
- emp.setSalary(emp.getSalary() - 1);
-
- em.flush();
- }
-
- /**
- * This example illustrates the use of a query returning an entity and data
- * from a related entity within a transaction. The returned entities are
- * managed and thus any changes are reflected in the database upon flush.
- *
- * @param em
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- public void updateEmployeeWithCity(EntityManager em) throws Exception {
- em.getTransaction().begin();
-
- List<Object[]> emps = em.createQuery("SELECT e, e.address.city FROM Employee e").getResultList();
- Employee emp = (Employee) emps.get(0)[0];
- emp.setSalary(emp.getSalary() + 1);
-
- em.flush();
-
- em.getTransaction().rollback();
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/Address.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/Address.java
deleted file mode 100644
index 4b99ac5..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/Address.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package model;
-
-import java.io.Serializable;
-
-public class Address implements Serializable {
- private int id;
- private String city;
- private String country;
- private String province;
- private String postalCode;
- private String street;
-
- private static final long serialVersionUID = 1L;
-
- public Address() {
- }
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int addressId) {
- this.id = addressId;
- }
-
- public String getCity() {
- return city;
- }
-
- public void setCity(String city) {
- this.city = city;
- }
-
- public String getCountry() {
- return country;
- }
-
- public void setCountry(String country) {
- this.country = country;
- }
-
- public String getProvince() {
- return province;
- }
-
- public void setProvince(String province) {
- this.province = province;
- }
-
- public String getPostalCode() {
- return this.postalCode;
- }
-
- public void setPostalCode(String pCode) {
- this.postalCode = pCode;
- }
-
- public String getStreet() {
- return street;
- }
-
- public void setStreet(String street) {
- this.street = street;
- }
-
- public String toString() {
- return "Address(" + getId() + ")";
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/Employee.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/Employee.java
deleted file mode 100644
index 1b2a90e..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/Employee.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package model;
-
-import java.io.Serializable;
-import java.sql.Time;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.2
- */
-public class Employee implements Serializable {
- private int id;
- private String firstName;
- private String lastName;
- private Gender gender;
- private Time startTime;
- private Time endTime;
- private double salary;
- private long version;
- private EmploymentPeriod period = new EmploymentPeriod();
- private Address address;
- private List<Project> projects;
- private Employee manager;
- private List<Employee> managedEmployees;
- private List<PhoneNumber> phoneNumbers;
- private List<String> responsibilities;
-
- public Employee() {
- this.projects = new ArrayList<Project>();
- this.managedEmployees = new ArrayList<Employee>();
- this.phoneNumbers = new ArrayList<PhoneNumber>();
- this.responsibilities = new ArrayList<String>();
- this.period = new EmploymentPeriod();
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int empId) {
- this.id = empId;
- }
-
- public Time getEndTime() {
- return this.endTime;
- }
-
- public void setEndTime(Time endTime) {
- this.endTime = endTime;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String fName) {
- this.firstName = fName;
- }
-
- public Gender getGender() {
- return this.gender;
- }
-
- public void setGender(Gender gender) {
- this.gender = gender;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public void setLastName(String lName) {
- this.lastName = lName;
- }
-
- public Time getStartTime() {
- return startTime;
- }
-
- public void setStartTime(Time startTime) {
- this.startTime = startTime;
- }
-
- public Long getVersion() {
- return version;
- }
-
- public void setVersion(long value) {
- version = value;
- }
-
- public List<Project> getProjects() {
- return projects;
- }
-
- public Project addProject(Project project) {
- getProjects().add(project);
- return project;
- }
-
- public Project removeProject(Project project) {
- List<Project> projects = getProjects();
- projects.remove(project);
- return project;
- }
-
- public Employee getManager() {
- return manager;
- }
-
- public void setManager(Employee employee) {
- this.manager = employee;
- }
-
- public List<Employee> getManagedEmployees() {
- return this.managedEmployees;
- }
-
- public void setManagedEmployees(List<Employee> employeeList) {
- this.managedEmployees = employeeList;
- }
-
- public Employee addManagedEmployee(Employee employee) {
- getManagedEmployees().add(employee);
- employee.setManager(this);
- return employee;
- }
-
- public Employee removeManagedEmployee(Employee employee) {
- getManagedEmployees().remove(employee);
- employee.setManager(null);
- return employee;
- }
-
- public List<PhoneNumber> getPhoneNumbers() {
- return phoneNumbers;
- }
-
- public void setPhoneNumbers(List<PhoneNumber> phoneNumberList) {
- this.phoneNumbers = phoneNumberList;
- }
-
- public PhoneNumber addPhoneNumber(PhoneNumber phoneNumber) {
- getPhoneNumbers().add(phoneNumber);
- phoneNumber.setOwner(this);
- return phoneNumber;
- }
-
- public PhoneNumber addPhoneNumber(String type, String areaCode, String number) {
- PhoneNumber phoneNumber = new PhoneNumber(type, areaCode, number);
- return addPhoneNumber(phoneNumber);
- }
-
- public PhoneNumber removePhoneNumber(PhoneNumber phoneNumber) {
- getPhoneNumbers().remove(phoneNumber);
- phoneNumber.setOwner(null);
- return phoneNumber;
- }
-
- public void setAddress(Address address) {
- this.address = address;
- }
-
- public Address getAddress() {
- return address;
- }
-
- public void setPeriod(EmploymentPeriod period) {
- this.period = period;
- }
-
- public void setPeriod() {
- setPeriod(new EmploymentPeriod());
- }
-
- public EmploymentPeriod getPeriod() {
- return period;
- }
-
- public double getSalary() {
- return salary;
- }
-
- public void setSalary(double salary) {
- this.salary = salary;
- }
-
- public List<String> getResponsibilities() {
- return this.responsibilities;
- }
-
- public void setResponsibilities(List<String> responsibilities) {
- this.responsibilities = responsibilities;
- }
-
- public void addResponsibility(String responsibility) {
- getResponsibilities().add(responsibility);
- }
-
- public void removeResponsibility(String responsibility) {
- getResponsibilities().remove(responsibility);
- }
-
- public String toString() {
- return "Employee(" + getId() + ")";
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/EmploymentPeriod.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/EmploymentPeriod.java
deleted file mode 100644
index c6fff96..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/EmploymentPeriod.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package model;
-
-import java.io.Serializable;
-import java.util.Calendar;
-
-/**
- * Represents the period of time an employee has worked for the company. A null
- * endDate indicates that the employee is current.
- *
- * @author djclarke
- */
-public class EmploymentPeriod implements Serializable {
- private Calendar startDate;
- private Calendar endDate;
-
- public Calendar getStartDate() {
- return startDate;
- }
-
- public void setStartDate(Calendar startDate) {
- this.startDate = startDate;
- }
-
- public void setStartDate(int year, int month, int date) {
- if (this.startDate == null) {
- setStartDate(Calendar.getInstance());
- }
- getStartDate().set(year, month, date);
- }
-
- public Calendar getEndDate() {
- return endDate;
- }
-
- public void setEndDate(Calendar endDate) {
- this.endDate = endDate;
- }
-
- public void setEndDate(int year, int month, int date) {
- if (this.endDate == null) {
- setEndDate(Calendar.getInstance());
- }
- getEndDate().set(year, month, date);
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/Gender.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/Gender.java
deleted file mode 100644
index 39fcb37..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/Gender.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package model;
-
-/**
- * @author dclarke
- * @since EclipseLink 1.0
- */
-public enum Gender {
- Female, Male, ;
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/LargeProject.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/LargeProject.java
deleted file mode 100644
index 27dbd6b..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/LargeProject.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package model;
-
-import java.util.Calendar;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.0
- */
-public class LargeProject extends Project {
- private double budget;
- private Calendar milestone = Calendar.getInstance();
-
- public LargeProject() {
- }
-
- public double getBudget() {
- return this.budget;
- }
-
- public void setBudget(double budget) {
- this.budget = budget;
- }
-
- public Calendar getMilestone() {
- return milestone;
- }
-
- public void setMilestone(Calendar milestone) {
- this.milestone = milestone;
- }
-
- public String toString() {
- return "LargeProject(" + getId() + ", budget: " + getBudget()+ ")";
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/PhoneNumber.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/PhoneNumber.java
deleted file mode 100644
index 44942ea..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/PhoneNumber.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package model;
-
-import java.io.Serializable;
-
-public class PhoneNumber implements Serializable {
- private int id;
- private String areaCode;
- private String number;
- private String type;
- private Employee owner;
-
- public PhoneNumber() {
- }
-
- public PhoneNumber(String type, String areaCode, String number) {
- this();
- setType(type);
- setAreaCode(areaCode);
- setNumber(number);
- }
-
- public String getAreaCode() {
- return areaCode;
- }
-
- public void setAreaCode(String areaCode) {
- this.areaCode = areaCode;
- }
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int empId) {
- this.id = empId;
- }
-
- public String getNumber() {
- return this.number;
- }
-
- public void setNumber(String pNumber) {
- this.number = pNumber;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public Employee getOwner() {
- return this.owner;
- }
-
- public void setOwner(Employee employee) {
- this.owner = employee;
- if (employee == null) {
- this.id = 0;
- } else {
- this.id = employee.getId();
- }
- }
-
- public static class ID implements Serializable {
- public int id;
- public String type;
-
- public ID() {
- }
-
- public ID(int empId, String type) {
- this.id = empId;
- this.type = type;
- }
-
- public boolean equals(Object other) {
- if (other instanceof ID) {
- final ID otherID = (ID) other;
- return otherID.id == id && otherID.type.equals(type);
- }
- return false;
- }
-
- public int hashCode() {
- return super.hashCode();
- }
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/Project.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/Project.java
deleted file mode 100644
index ab02d57..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/Project.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package model;
-
-import java.io.Serializable;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.0
- */
-public abstract class Project implements Serializable {
- private int id;
- private String name;
- private String description;
- private Long version;
- private Employee teamLeader;
-
- public Project() {
- }
-
- public String getDescription() {
- return this.description;
- }
-
- public void setDescription(String descrip) {
- this.description = descrip;
- }
-
- public int getId() {
- return this.id;
- }
-
- public void setId(int projId) {
- this.id = projId;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String projName) {
- this.name = projName;
- }
-
- public Long getVersion() {
- return version;
- }
-
- public void setVersion(Long version) {
- this.version = version;
- }
-
- public Employee getTeamLeader() {
- return this.teamLeader;
- }
-
- public void setTeamLeader(Employee employee) {
- this.teamLeader = employee;
- }
-
- public String toString() {
- return "Project(" + getName() + ")";
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/SamplePopulation.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/SamplePopulation.java
deleted file mode 100644
index 31c33a7..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/SamplePopulation.java
+++ /dev/null
@@ -1,553 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package model;
-
-import javax.persistence.EntityManager;
-
-public class SamplePopulation {
-
- private Employee[] employees = { basicEmployeeExample1(),
- basicEmployeeExample2(), basicEmployeeExample3(),
- basicEmployeeExample4(), basicEmployeeExample5(),
- basicEmployeeExample6(), basicEmployeeExample7(),
- basicEmployeeExample8(), basicEmployeeExample9(),
- basicEmployeeExample10(), basicEmployeeExample11(),
- basicEmployeeExample12() };
-
- private SmallProject[] smallProjects = { basicSmallProjectExample1(),
- basicSmallProjectExample2(), basicSmallProjectExample3(),
- basicSmallProjectExample4(), basicSmallProjectExample5(),
- basicSmallProjectExample7(), basicSmallProjectExample8(),
- basicSmallProjectExample9(), basicSmallProjectExample10() };
-
- private LargeProject[] largeProjects = { basicLargeProjectExample1(),
- basicLargeProjectExample2(), basicLargeProjectExample3(),
- basicLargeProjectExample4(), basicLargeProjectExample5() };
-
- public SamplePopulation() {
-
- // Setup management hierarchy
- addManagedEmployees(0, new int[] { 2, 3, 4 });
- addManagedEmployees(1, new int[] { 5, 0 });
- addManagedEmployees(2, new int[] {});
- addManagedEmployees(3, new int[] {});
- addManagedEmployees(4, new int[] {});
- addManagedEmployees(5, new int[] {});
- addManagedEmployees(6, new int[] {});
- addManagedEmployees(7, new int[] {});
- addManagedEmployees(8, new int[] {});
- addManagedEmployees(9, new int[] { 11 });
- addManagedEmployees(10, new int[] { 6 });
- addManagedEmployees(11, new int[] { 1 });
-
- // Setup Employee-Project associations
- addProjects(0, new int[] { 0, 1, 2 }, new int[] {});
- addProjects(1, new int[] { 3, 4, 0 }, new int[] {});
- addProjects(2, new int[] { 3 }, new int[] { 3, 4 });
- addProjects(4, new int[] { 3, 1 }, new int[] { 2, 4 });
- addProjects(5, new int[] {}, new int[] { 1 });
- addProjects(6, new int[] {}, new int[] { 1 });
-
- // Setup LargeProject leads
- this.largeProjects[0].setTeamLeader(this.employees[1]);
- this.largeProjects[3].setTeamLeader(this.employees[2]);
- this.largeProjects[4].setTeamLeader(this.employees[2]);
- }
-
- public Employee basicEmployeeExample1() {
- Employee employee = new Employee();
-
- employee.setFirstName("Bob");
- employee.setLastName("Smith");
- employee.setGender(Gender.Male);
- employee.setSalary(35000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(1996, 0, 1);
- employmentPeriod.setStartDate(1993, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Toronto");
- address.setPostalCode("L5J2B5");
- address.setProvince("ONT");
- address.setStreet("1450 Acme Cr., Suite 4");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Water the office plants.");
- employee.addResponsibility("Maintain the kitchen facilities.");
- employee.addPhoneNumber("Work", "613", "5558812");
-
- return employee;
- }
-
- public Employee basicEmployeeExample10() {
- Employee employee = new Employee();
-
- employee.setFirstName("Jill");
- employee.setLastName("May");
- employee.setGender(Gender.Female);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setStartDate(1991, 10, 11);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Calgary");
- address.setPostalCode("J5J2B5");
- address.setProvince("AB");
- address.setStreet("1111 Mooseland Rd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.setSalary(56232);
- employee.addPhoneNumber("Work", "613", "5558812");
- employee.addPhoneNumber("Work Fax", "613", "5555943");
-
- return employee;
- }
-
- public Employee basicEmployeeExample11() {
- Employee employee = new Employee();
-
- employee.setFirstName("Sarah-Lou");
- employee.setLastName("Smitty");
- employee.setGender(Gender.Female);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(1996, 0, 1);
- employmentPeriod.setStartDate(1993, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Arnprior");
- address.setPostalCode("W1A2B5");
- address.setProvince("ONT");
- address.setStreet("1 Hawthorne Drive");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.setSalary(75000);
- employee.addPhoneNumber("Work Fax", "613", "5555943");
- employee.addPhoneNumber("Home", "613", "5551234");
- employee.addPhoneNumber("Cellular", "416", "5551111");
-
- return employee;
- }
-
- public Employee basicEmployeeExample12() {
- Employee employee = new Employee();
-
- employee.setFirstName("Jim-Bob");
- employee.setLastName("Jefferson");
- employee.setGender(Gender.Male);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 12);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Yellowknife");
- address.setPostalCode("Y5J2N5");
- address.setProvince("YK");
- address.setStreet("1112 Gold Rush Rd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.setSalary(50000);
- employee.addPhoneNumber("Home", "613", "5551234");
- employee.addPhoneNumber("Cellular", "416", "5551111");
-
- return employee;
- }
-
- public Employee basicEmployeeExample2() {
- Employee employee = new Employee();
-
- employee.setFirstName("John");
- employee.setLastName("Way");
- employee.setGender(Gender.Male);
- employee.setSalary(53000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setStartDate(1991, 10, 11);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Ottawa");
- address.setPostalCode("K5J2B5");
- address.setProvince("ONT");
- address.setStreet("12 Merivale Rd., Suite 5");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee
- .addResponsibility("Hire people when more people are required.");
- employee
- .addResponsibility("Lay off employees when less people are required.");
- employee.addPhoneNumber("Work", "613", "5558812");
- employee.addPhoneNumber("ISDN", "905", "5553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample3() {
- Employee employee = new Employee();
-
- employee.setFirstName("Charles");
- employee.setLastName("Chanley");
- employee.setGender(Gender.Male);
- employee.setSalary(43000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Montreal");
- address.setPostalCode("Q2S5Z5");
- address.setProvince("QUE");
- address.setStreet("1 Canadien Place");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Perform code reviews as required.");
- employee.addPhoneNumber("Pager", "976", "5556666");
- employee.addPhoneNumber("ISDN", "905", "5553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample4() {
- Employee employee = new Employee();
-
- employee.setFirstName("Emanual");
- employee.setLastName("Smith");
- employee.setGender(Gender.Male);
- employee.setSalary(49631);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Vancouver");
- address.setPostalCode("N5J2N5");
- address.setProvince("BC");
- address.setStreet("20 Mountain Blvd., Floor 53, Suite 6");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Have to fix the Database problem.");
- employee.addPhoneNumber("Work Fax", "613", "5555943");
- employee.addPhoneNumber("Cellular", "416", "5551111");
- employee.addPhoneNumber("Pager", "976", "5556666");
- employee.addPhoneNumber("ISDN", "905", "5553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample5() {
- Employee employee = new Employee();
-
- employee.setFirstName("Sarah");
- employee.setLastName("Way");
- employee.setGender(Gender.Female);
- employee.setSalary(87000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 6, 31);
- employmentPeriod.setStartDate(1995, 4, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Prince Rupert");
- address.setPostalCode("K3K5D5");
- address.setProvince("BC");
- address.setStreet("3254 Parkway Place");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Write code documentation.");
- employee.addPhoneNumber("Work", "613", "5558812");
- employee.addPhoneNumber("ISDN", "905", "5553691");
- employee.addPhoneNumber("Home", "613", "5551234");
-
- return employee;
- }
-
- public Employee basicEmployeeExample6() {
- Employee employee = new Employee();
-
- employee.setFirstName("Marcus");
- employee.setLastName("Saunders");
- employee.setGender(Gender.Male);
- employee.setSalary(54300);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 12);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Perth");
- address.setPostalCode("Y3Q2N9");
- address.setProvince("ONT");
- address.setStreet("234 Caledonia Lane");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addResponsibility("Write user specifications.");
- employee.addPhoneNumber("ISDN", "905", "5553691");
- employee.addPhoneNumber("Work", "613", "5558812");
-
- return employee;
- }
-
- public Employee basicEmployeeExample7() {
- Employee employee = new Employee();
-
- employee.setFirstName("Nancy");
- employee.setLastName("White");
- employee.setGender(Gender.Female);
- employee.setSalary(31000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(1996, 0, 1);
- employmentPeriod.setStartDate(1993, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Metcalfe");
- address.setPostalCode("Y4F7V6");
- address.setProvince("ONT");
- address.setStreet("2 Anderson Rd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addPhoneNumber("Home", "613", "5551234");
-
- return employee;
- }
-
- public Employee basicEmployeeExample8() {
- Employee employee = new Employee();
-
- employee.setFirstName("Fred");
- employee.setLastName("Jones");
- employee.setGender(Gender.Male);
- employee.setSalary(500000);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setEndDate(2001, 11, 31);
- employmentPeriod.setStartDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Victoria");
- address.setPostalCode("Z5J2N5");
- address.setProvince("BC");
- address.setStreet("382 Hyde Park Blvd.");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addPhoneNumber("Cellular", "416", "5551111");
- employee.addPhoneNumber("ISDN", "905", "5553691");
-
- return employee;
- }
-
- public Employee basicEmployeeExample9() {
- Employee employee = new Employee();
-
- employee.setFirstName("Betty");
- employee.setLastName("Jones");
- employee.setGender(Gender.Female);
- employee.setSalary(500001);
-
- EmploymentPeriod employmentPeriod = new EmploymentPeriod();
- employmentPeriod.setStartDate(2001, 11, 31);
- employmentPeriod.setEndDate(1995, 0, 1);
- employee.setPeriod(employmentPeriod);
-
- Address address = new Address();
- address.setCity("Smith Falls");
- address.setPostalCode("C6C6C6");
- address.setProvince("ONT");
- address.setStreet("89 Chocolate Drive");
- address.setCountry("Canada");
- employee.setAddress(address);
-
- employee.addPhoneNumber("Work", "613", "5558812");
- employee.addPhoneNumber("ISDN", "905", "5553691");
-
- return employee;
- }
-
- public LargeProject basicLargeProjectExample1() {
- LargeProject largeProject = new LargeProject();
-
- largeProject.setName("Sales Reporting");
- largeProject
- .setDescription("A reporting application to report on the corporations database through TopLink.");
- largeProject.setBudget((double) 5000);
- largeProject.getMilestone().set(1991, 10, 11, 12, 0, 0);
-
- return largeProject;
- }
-
- public LargeProject basicLargeProjectExample2() {
- LargeProject largeProject = new LargeProject();
-
- largeProject.setName("Light Reporter");
- largeProject
- .setDescription("A lightweight application to report on the corporations database through TopLink.");
- largeProject.setBudget(100.98);
- largeProject.getMilestone().set(1999, 11, 25, 11, 40, 44);
-
- return largeProject;
- }
-
- public LargeProject basicLargeProjectExample3() {
- LargeProject largeProject = new LargeProject();
-
- largeProject.setName("TOPEmployee Management");
- largeProject
- .setDescription("A management application to report on the corporations database through TopLink.");
- largeProject.setBudget(4000.98);
- largeProject.getMilestone().set(1997, 10, 12, 1, 0, 0);
-
- return largeProject;
- }
-
- public LargeProject basicLargeProjectExample4() {
- LargeProject largeProject = new LargeProject();
-
- largeProject.setName("Enterprise System");
- largeProject
- .setDescription("A enterprise wide application to report on the corporations database through TopLink.");
- largeProject.setBudget(40.98);
- largeProject.getMilestone().set(1996, 8, 6, 6, 40, 44);
-
- return largeProject;
- }
-
- public LargeProject basicLargeProjectExample5() {
- LargeProject largeProject = new LargeProject();
-
- largeProject.setName("Problem Reporting System");
- largeProject
- .setDescription("A PRS application to report on the corporations database through TopLink.");
- largeProject.setBudget(101.98);
- largeProject.getMilestone().set(1997, 9, 6, 1, 40, 44);
-
- return largeProject;
- }
-
- public SmallProject basicSmallProjectExample1() {
- return new SmallProject(
- "Enterprise",
- "A enterprise wide application to report on the corporations database through TopLink.");
- }
-
- public SmallProject basicSmallProjectExample10() {
- return new SmallProject("Staff Query Tool",
- "A tool to help staff query various things.");
- }
-
- public SmallProject basicSmallProjectExample2() {
- return new SmallProject(
- "Sales Reporter",
- "A reporting application using JDK to report on the corporations database through TopLink.");
- }
-
- public SmallProject basicSmallProjectExample3() {
- return new SmallProject(
- "TOP-Employee Manager",
- "A management application to report on the corporations database through TopLink.");
- }
-
- public SmallProject basicSmallProjectExample4() {
- return new SmallProject("Problem Reporter",
- "A PRS application to report on the corporations database through TopLink.");
- }
-
- public SmallProject basicSmallProjectExample5() {
- return new SmallProject(
- "Feather Reporter",
- "An extremely lightweight application to report on the corporations database through TopLink.");
- }
-
- public SmallProject basicSmallProjectExample6() {
- return new SmallProject("Makework", "A makework project.");
- }
-
- public SmallProject basicSmallProjectExample7() {
- return new SmallProject("Marketing Query Tool",
- "A tool to help marketing query various things.");
- }
-
- public SmallProject basicSmallProjectExample8() {
- return new SmallProject("Shipping Query Tool",
- "A tool to help shipping query various things.");
- }
-
- public SmallProject basicSmallProjectExample9() {
- return new SmallProject("Accounting Query Tool",
- "A tool to help accounting query various things.");
- }
-
- private void addManagedEmployees(int managerIndex, int[] employeeIndeces) {
- Employee manager = this.employees[managerIndex];
-
- if (manager.getManagedEmployees().isEmpty()) {
- for (int index = 0; index < employeeIndeces.length; index++) {
- manager
- .addManagedEmployee(this.employees[employeeIndeces[index]]);
- }
- }
- }
-
- private void addProjects(int empIndex, int[] smallProjIndeces,
- int[] largeProjIndeces) {
- Employee employee = this.employees[empIndex];
-
- for (int index = 0; index < smallProjIndeces.length; index++) {
- employee.addProject(this.smallProjects[smallProjIndeces[index]]);
- }
-
- for (int index = 0; index < largeProjIndeces.length; index++) {
- employee.addProject(this.largeProjects[largeProjIndeces[index]]);
- }
- }
-
- /**
- *
- * @param em
- */
- public void persistAll(EntityManager em) {
- for (int index = 0; index < this.employees.length; index++) {
- em.persist(this.employees[index]);
- }
- for (int index = 0; index < this.smallProjects.length; index++) {
- em.persist(this.smallProjects[index]);
- }
- for (int index = 0; index < this.largeProjects.length; index++) {
- em.persist(this.largeProjects[index]);
- }
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/SmallProject.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/SmallProject.java
deleted file mode 100644
index 11fec4d..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/SmallProject.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package model;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.0
- */
-public class SmallProject extends Project {
-
- private SmallProject() {
- super();
- }
-
- public SmallProject(String name, String description) {
- this();
- setName(name);
- setDescription(description);
- }
-
-}
-
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/persistence/PhoneNumberCustomizer.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/persistence/PhoneNumberCustomizer.java
deleted file mode 100644
index 4cd25ed..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/example.jpa.employee.xml/model/persistence/PhoneNumberCustomizer.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - TODO
- ******************************************************************************/
-package model.persistence;
-
-import org.eclipse.persistence.config.DescriptorCustomizer;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.mappings.OneToOneMapping;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-
-/**
- * Customize the PhoneNumber.owner relationship to use a minimal FetchGroup so
- * that if it is being resolved to a partial entity in the persistence context
- * it will not force the entire entity to be resolved.
- * <p>
- * This type of configuration will be required on mappings where the user wants
- * the 1:1 or M:1 lookup to simply connect to the partially entity already in the
- * context.
- *
- * @author dclarke
- * @since EclipseLink 1.2
- */
-public class PhoneNumberCustomizer implements DescriptorCustomizer {
-
- public void customize(ClassDescriptor descriptor) throws Exception {
- FetchGroup minEmpFG = new FetchGroup();
- minEmpFG.addAttribute("id");
- OneToOneMapping ownerMapping = (OneToOneMapping) descriptor.getMappingForAttributeName("owner");
- ((ReadObjectQuery)ownerMapping.getSelectionQuery()).setFetchGroup(minEmpFG);
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/example/FetchPlanExamples.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/example/FetchPlanExamples.java
deleted file mode 100644
index c16bb83..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/example/FetchPlanExamples.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: Extensions Incubator - FetchPlan
- ******************************************************************************/
-package example;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import model.Employee;
-import model.Gender;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.extension.fetchplan.FetchPlan;
-import org.eclipse.persistence.extension.fetchplan.JpaFetchPlanHelper;
-import org.eclipse.persistence.jpa.JpaHelper;
-
-@SuppressWarnings("unchecked")
-public class FetchPlanExamples {
-
- /**
- * Query for all employees with a salary greater then zero using a
- * FetchGroup to only load id, firstName, lastName, gender, salary, and
- * version and then fetch their address and phone numbers using the same
- * FetchPlan.
- */
- public List<Employee> employeesFetchAddressAndPhones(EntityManager em) {
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("firstName");
- fetchPlan.addAttribute("lastName");
- fetchPlan.addAttribute("gender");
- fetchPlan.addAttribute("salary");
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.salary > 0");
-
- // Configure a dynamic FetchGroup based on the FetchPlan
- query.setHint(QueryHints.FETCH_GROUP, fetchPlan.createFetchGroup());
-
- List<Employee> emps = query.getResultList();
-
- // Force the fetch operation on the query result
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- return emps;
- }
-
- /**
- * Similar to {@link #employeesFetchAddressAndPhones(EntityManager)} but the
- * loading of the related address and phoneNumbers is optimized using batch
- * reading.
- */
- // Note: FetchGroup with FETCH (JOIN) does not work - see bug XXX
- public List<Employee> employeesFetchAddressAndPhones_optimized(EntityManager em) {
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("firstName");
- fetchPlan.addAttribute("lastName");
- fetchPlan.addAttribute("gender");
- fetchPlan.addAttribute("salary");
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.salary > 0");
-
- // Configure a dynamic FetchGroup based on the FetchPlan
- query.setHint(QueryHints.FETCH_GROUP, fetchPlan.createFetchGroup());
-
- query.setHint(QueryHints.BATCH, "e.address");
- query.setHint(QueryHints.BATCH, "e.phoneNumbers");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- return emps;
- }
-
- public List<Employee> employeesFetchAddressAndPhonesBatchAndUsingRedirector(EntityManager em) {
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("firstName");
- fetchPlan.addAttribute("lastName");
- fetchPlan.addAttribute("gender");
- fetchPlan.addAttribute("salary");
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.salary > 0");
-
- // Configure a dynamic FetchGroup based on the FetchPlan
- query.setHint(QueryHints.FETCH_GROUP, fetchPlan.createFetchGroup());
-
- query.setHint(QueryHints.BATCH, "e.address");
- query.setHint(QueryHints.BATCH, "e.phoneNumbers");
-
- // Configure redirector so the FetchPlan.fetch is executed automatically
- fetchPlan.fetchOnExecute(JpaHelper.getReadAllQuery(query));
-
- return query.getResultList();
- }
-
- /**
- * Simple example retrieving just the firstName and lastName of the
- * Employee. This will also include the required identifier and optimistic
- * locking values (id and version).
- */
- public List<Employee> maleEmployeeCopyNames(EntityManager em) {
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("firstName");
- fetchPlan.addAttribute("lastName");
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- query.setParameter("GENDER", Gender.Male);
-
- // Configure a dynamic FetchGroup based on the FetchPlan
- query.setHint(QueryHints.FETCH_GROUP, fetchPlan.createFetchGroup());
-
- List<Employee> emps = query.getResultList();
-
- // This ensures all required relationships are loaded
- // In this case it does nothing
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- // Get a set of copies with only the names and required attributes
- // populated
- List<Employee> copies = JpaFetchPlanHelper.copy(em, fetchPlan, emps);
-
- return copies;
- }
-
- /**
- * This example illustrates how a FetchPlan can be constructed based on the
- * default fetch configuration of the mappings and used to copy the
- * resulting entities. This can be used to create a detached entity graph
- * where all EAGER attributes are loaded and all LAZY attributes are
- * returned as NULL.
- */
- public List<Employee> copyEagerAttributesOnly(EntityManager em) {
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.firstName IS NOT NULL AND e.lastName IS NOT NULL AND e.salary > 0 ");
-
- // The result of this query is a collection of Employee instances where
- // all EAGER attributes are populated and all LAZY attributes are
- // available
- // for loading with proxy objects (FetchGroup for basics, ValueHolders
- // for 1:1 and M:1, and IndirectList/Map/Set for collections). If
- // serialized at this point these will not appear as null.
- List<Employee> emps = query.getResultList();
-
- // Create a FetchPlan based on the default FetchGroup
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- JpaFetchPlanHelper.addDefaultFetchAttributes(em, fetchPlan);
-
- // Get a set of copies with only the names and required attributes
- // populated
- List<Employee> copies = JpaFetchPlanHelper.copy(em, fetchPlan, emps);
-
- return copies;
- }
-
- /**
- * Load all employees's first and last names (plus required id and version)
- * attributes based on a FetchGroup and copy the results based on this plan.
- */
- public List<Employee> employeeCopyNamesWithFetchGroup(EntityManager em) {
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("firstName");
- fetchPlan.addAttribute("lastName");
-
- // Configure a dynamic FetchGroup based on the FetchPlan
- query.setHint(QueryHints.FETCH_GROUP, fetchPlan.createFetchGroup());
-
- List<Employee> emps = query.getResultList();
-
- return JpaFetchPlanHelper.copy(em, fetchPlan, emps);
- }
-
- /**
- * Create copies of managed objects requiring relationships that were not
- * loaded in the initial query. The copy operation will force the fetching
- * of required relationships.
- */
- public List<Employee> employeeCopyWithNamesAddressAndPhones(EntityManager em) {
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.salary > 0");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("firstName");
- fetchPlan.addAttribute("lastName");
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- List<Employee> emps = query.getResultList();
-
- return JpaFetchPlanHelper.copy(em, fetchPlan, emps);
- }
-
- /**
- * Create copies of managed objects requiring relationships that were not
- * loaded in the initial query. The copy operation will force the fetching
- * of required relationships.
- */
- public List<Employee> employeeCopyWithNamesAddressAndPhonesWithBatching(EntityManager em) {
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.salary > 0");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("firstName");
- fetchPlan.addAttribute("lastName");
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- // Optimize graph loading using batching
- query.setHint(QueryHints.BATCH, "e.address");
- query.setHint(QueryHints.BATCH, "e.phoneNumbers");
-
- List<Employee> emps = query.getResultList();
-
- return JpaFetchPlanHelper.copy(em, fetchPlan, emps);
- }
-
- /**
- * Illustrate a multi-level fetch
- */
- public List<Employee> managerManagerManagerFetchWithNames(EntityManager em) {
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("firstName");
- fetchPlan.addAttribute("lastName");
- fetchPlan.addAttribute("manager.firstName");
- fetchPlan.addAttribute("manager.lastName");
- fetchPlan.addAttribute("manager.manager.firstName");
- fetchPlan.addAttribute("manager.manager.lastName");
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.manager.manager IS NOT NULL");
-
- List<Employee> emps = query.getResultList();
-
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- return emps;
- }
-
- /**
- * Example of a composite select returning both an Employee and its count of
- * PhoneNumbers. To use the {@link FetchPlan} in this case you must also
- * provide the index into the resulting Object[].
- */
- public List<Object[]> employeeAddress_ReturnBoth(EntityManager em) {
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- Query query = em.createQuery("SELECT e, e.address FROM Employee e WHERE e.firstName <> e.lastName");
- List<Object[]> results = query.getResultList();
-
- JpaFetchPlanHelper.fetch(em, fetchPlan, results, 0);
-
- return results;
- }
-
- /**
- * Example of using a FetchPlan to retrieve an entity and copy a partial
- * unmanaged graph of the entity which is then modified and merged back into
- * the persistence context.
- *
- * Note: caller manages transactions
- */
- public void copyMergeExample(EntityManager em, boolean clear) {
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("firstName");
- fetchPlan.addAttribute("lastName");
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = (SELECT MIN(ee.id) FROM Employee ee)");
- query.setHint(QueryHints.FETCH_GROUP, fetchPlan.createFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- Employee copy = JpaFetchPlanHelper.copy(em, fetchPlan, emp);
-
- copy.setSalary(Integer.MAX_VALUE);
- copy.setFirstName(emp.getLastName());
- copy.setLastName(emp.getFirstName());
-
- if (clear) {
- em.clear();
- JpaHelper.getEntityManager(em).getServerSession().getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- JpaFetchPlanHelper.merge(em, fetchPlan, copy);
- }
-
- /**
- *
- */
- public List<Employee> createFetchPlanFromDefaultFetchGroup(EntityManager em) {
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- JpaFetchPlanHelper.addDefaultFetchAttributes(em, fetchPlan);
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.salary > 0");
- query.setHint(QueryHints.FETCH_GROUP, fetchPlan.createFetchGroup());
-
- List<Employee> emps = query.getResultList();
-
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- return emps;
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/fetchplan/FetchItem.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/fetchplan/FetchItem.java
deleted file mode 100644
index 22a427f..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/fetchplan/FetchItem.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: FetchPlan Example
- * ssmith - various minor edits
- ******************************************************************************/
-package org.eclipse.persistence.extension.fetchplan;
-
-import javax.persistence.Transient;
-
-import org.eclipse.persistence.exceptions.QueryException;
-import org.eclipse.persistence.extension.fetchplan.FetchPlan.CopyTrace;
-import org.eclipse.persistence.internal.sessions.AbstractSession;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.sessions.ObjectCopyingPolicy;
-import org.eclipse.persistence.sessions.Session;
-
-/**
- * A FetchItem refers to a single attribute in a FetchPlan that is used when
- * fetching, copying, or merging entities. A FetchItem can be used for a basic
- * (direct-to-field) attribute as well as relationships (entity->entity or
- * entity->embedded) with the FetchItem optionally holding a FetchGroup
- * indicating how that related entity or embeddable should be treated.
- * <p>
- * This class is mostly internal to the FetchPlan but is made public so that
- * users can interrogate the state of the FetchPlan and its nested FetchItems.
- * These can only be created through the use of
- * {@link FetchPlan#addAttribute(String...)}
- *
- * @author dclarke
- * @since EclipseLink 1.2
- */
-public class FetchItem {
-
- /**
- * @see #getName()
- */
- private String name;
-
- /**
- * @see #getParent()
- */
- private FetchPlan parent;
-
- /**
- * @see #getFetchPlan()
- */
- private FetchPlan fetchPlan;
-
- /**
- * Optimization to hold a reference to the database mapping for the
- * {@link #name} on the descriptor of the {@link #parent}.
- */
- @Transient
- private DatabaseMapping mapping;
-
- protected FetchItem(FetchPlan parent, String name) {
- this.parent = parent;
- this.name = name;
- }
-
- protected FetchItem(FetchPlan parent, DatabaseMapping mapping) {
- this(parent, mapping.getAttributeName());
- this.mapping = mapping;
- }
-
- /**
- * Name of the attribute. This is a simple name corresponding to a mapped
- * attribute of the entity type this FetchItem is applied to.
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Reference to the owning {@link FetchItem} which has the attribute mapped
- * for {@link #getName()}
- */
- public FetchPlan getParent() {
- return parent;
- }
-
- /**
- * Optional FetchPlan that is used to describe how a related entity or
- * embeddable should be fetched. This FetchPlan is only used in
- * relationships and is ignored in basic (direct-to-field) mapping scenarios
- * or in operations where the entity being processed has a null or empty
- * collection.
- */
- public FetchPlan getFetchPlan() {
- return fetchPlan;
- }
-
- public void setFetchPlan(FetchPlan fetchPlan) {
- this.fetchPlan = fetchPlan;
- }
-
- protected DatabaseMapping getMapping(Session session) {
- if (this.mapping == null) {
- initialize(session);
- }
- return mapping;
- }
-
- /*
- * Initialize this item to lookup its mapping and cascade initialize its
- * nested FetchPlan
- */
- protected void initialize(Session session) {
- this.mapping = getParent().getDescriptor(session).getMappingForAttributeName(getName());
-
- if (this.mapping == null) {
- throw QueryException.fetchGroupAttributeNotMapped(getName());
- }
-
- if (getFetchPlan() != null) {
- // If there is no ref descriptor then there should not be a
- // FetchPlan
- if (this.mapping.getReferenceDescriptor() == null) {
- throw new RuntimeException("FetchPlan initialize: FetchItem found with FetchPlan for " + this.mapping);
- }
-
- getFetchPlan().setEntityClass(this.mapping.getReferenceDescriptor().getJavaClass());
- getFetchPlan().initialize(session);
- }
- }
-
- /**
- * Force the mapped attribute to be loaded if it is not null and is
- * assignable to the type of the item's plan.
- */
- protected void fetch(Object entity, AbstractSession session) {
- if (entity != null && getParent().getEntityClass().isAssignableFrom(entity.getClass())) {
- getMapping(session).instantiateAttribute(entity, session);
-
- if (getFetchPlan() != null) {
- Object target = mapping.getRealAttributeValueFromObject(entity, session);
- if (target != null) {
- getFetchPlan().fetch(target, session);
- }
- }
- }
- }
-
- /**
- * Populate the copy with a copy or value (depending on type) of this mapped
- * attribute
- */
- protected void copy(Object source, Object target, AbstractSession session, ObjectCopyingPolicy policy, CopyTrace copies) {
- copy(source, target, getMapping(session), getFetchPlan(), session, policy, copies);
- }
-
- /**
- *
- */
- private void copy(Object source, Object target, DatabaseMapping mapping, FetchPlan targetFetchPlan, AbstractSession session, ObjectCopyingPolicy policy, CopyTrace copies) {
- if (mapping.getReferenceDescriptor() != null) {
- Object sourceValue = mapping.getRealAttributeValueFromObject(source, session);
- Object copyValue = null;
-
- if (sourceValue != null) {
- if (targetFetchPlan == null) {
- targetFetchPlan = FetchPlan.defaultFetchPlan(mapping);
- }
- copyValue = targetFetchPlan.copy(sourceValue, session, copies);
- mapping.setRealAttributeValueInObject(target, copyValue);
- }
- } else {
- mapping.buildCopy(target, source, policy);
- }
- }
-
- public String toString() {
- return "FetchItem(" + getName() + ")";
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/fetchplan/FetchPlan.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/fetchplan/FetchPlan.java
deleted file mode 100644
index ece4ccd..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/fetchplan/FetchPlan.java
+++ /dev/null
@@ -1,667 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: FetchPlan Example
- ******************************************************************************/
-package org.eclipse.persistence.extension.fetchplan;
-
-import java.lang.reflect.Constructor;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.persistence.Query;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.exceptions.QueryException;
-import org.eclipse.persistence.internal.helper.DatabaseField;
-import org.eclipse.persistence.internal.sessions.AbstractRecord;
-import org.eclipse.persistence.internal.sessions.AbstractSession;
-import org.eclipse.persistence.internal.sessions.UnitOfWorkImpl;
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.logging.SessionLogEntry;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.mappings.ForeignReferenceMapping;
-import org.eclipse.persistence.queries.DatabaseQuery;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.ObjectLevelReadQuery;
-import org.eclipse.persistence.queries.QueryRedirector;
-import org.eclipse.persistence.queries.ReportQuery;
-import org.eclipse.persistence.sessions.ObjectCopyingPolicy;
-import org.eclipse.persistence.sessions.Record;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.UnitOfWork;
-
-/**
- * A FetchPlan is an extension to EclipseLink that allows a required graph of
- * entities to be returned from a query execution or copy operation as well as
- * being used to do a sparse merge of an unmanaged graph of entities into a
- * persistence context.
- * <p>
- * A FetchPlan is created/retrieved from a query using the
- * {@link #getFetchPlan(Query)} or {@link #getFetchPlan(ObjectLevelReadQuery)}
- * methods. Relationships that are to be loaded can then be added using
- * {@link #addFetchItem(String...)} which creates a {@link FetchItem} within the
- * plan for the requested relationship in the results graph.
- *
- * @author dclarke
- * @since TBD
- */
-public class FetchPlan {
-
- /**
- * Name for this FetchPlan. Offers some assistance with debugging as name is
- * used in log messages. Also align with future FetchGroup enhancements
- * where named fetchGroups are stored and available for use.
- */
- private String name;
-
- /**
- * Map of items where each item represents an attribute to be fetched/copied
- * depending on the usage of the plan.
- *
- * @see FetchItem
- */
- private Map<String, FetchItem> items;
-
- /**
- * The entity type this fetchPlan will be used against.
- */
- private Class<?> entityClass;
-
- /**
- * Descriptor cached for the entity class of this FetchPlan.
- */
- private ClassDescriptor descriptor;
-
- /**
- * {@link SessionLog} category used for messages logged during the use of a
- * FetchPlan. To enable all messages in this category configure the
- * persistence unit property:
- * <p>
- * <code>
- * <property name =eclipselink.logging.level.fetch_plan" value="ALL" />
- * </code>
- */
- public static final String LOG_CATEGORY = "fetch_plan";
-
- public FetchPlan(String name, Class<?> entityClass) {
- this.name = name;
- this.entityClass = entityClass;
- this.items = new HashMap<String, FetchItem>();
- }
-
- public FetchPlan(Class<?> entityClass) {
- this(null, entityClass);
- }
-
- /**
- * TODO Create an initialized {@link FetchPlan} (meaning its descriptor,
- * required mappings, and items are configured when returned so that
- * {@link #initialize(Session)} will not do anything).
- */
- protected FetchPlan(ClassDescriptor descriptor) {
- this(descriptor.getJavaClass());
- this.descriptor = descriptor;
- }
-
- /**
- * TODO
- */
- @SuppressWarnings("unchecked")
- protected void addDefaultMappings() {
- if (descriptor.hasFetchGroupManager() && descriptor.getFetchGroupManager().getDefaultFetchGroup() != null) {
- FetchGroup fg = descriptor.getFetchGroupManager().getDefaultFetchGroup();
-
- for (String attr : (Set<String>) fg.getAttributes()) {
- addAttribute(descriptor.getMappingForAttributeName(attr));
- }
- return;
- }
-
- for (DatabaseMapping mapping : descriptor.getMappings()) {
- if (!mapping.isLazy()) {
- addAttribute(mapping);
- }
- }
-
- // Add identifier and optimistic locking version attributes
- if (!descriptor.isAggregateDescriptor()) {
- for (DatabaseMapping pkMapping : descriptor.getObjectBuilder().getPrimaryKeyMappings()) {
- if (!getItems().containsKey(pkMapping.getAttributeName())) {
- addAttribute(pkMapping);
- }
- }
-
- if (descriptor.usesOptimisticLocking()) {
- DatabaseField lockField = descriptor.getOptimisticLockingPolicy().getWriteLockField();
- if (lockField != null) {
- DatabaseMapping lockMapping = descriptor.getObjectBuilder().getMappingForField(lockField);
- if (lockMapping != null && !getItems().containsKey(lockMapping.getAttributeName())) {
- addAttribute(lockMapping);
- }
- }
- }
- }
- }
-
- public String getName() {
- return this.name;
- }
-
- public Class<?> getEntityClass() {
- return this.entityClass;
- }
-
- /*
- * Used in {@link FetchItem#initialize(Session)} to populate the target
- * entity type of relationships from the mapping.
- */
- protected void setEntityClass(Class<?> entityClass) {
- this.entityClass = entityClass;
- }
-
- public Map<String, FetchItem> getItems() {
- return this.items;
- }
-
- /**
- * @return a read-only collection of {@link FetchItem} in this plan.
- */
- public Collection<FetchItem> getFetchItems() {
- return getItems().values();
- }
-
- /**
- * Initialize the FetchPlan and all of its FetchItem and nested FetchPlan to
- * lookup and hold their corresponding descriptors and mappings. If any of
- * the FetchPlan's state does not match the mappings an exception will be
- * raised.
- * <p>
- * This is used within {@link #getDescriptor(Session)} to lazily lookup the
- * {@link ClassDescriptor} but it can also be used externally to validate
- * the configuration of the FetchPlan.
- *
- * @throws IllegalStateException
- * if {@link #entityClass} is null or no descriptor can be found
- * for the provided class
- * @throws QueryException
- * if any of the items or nested items cannot be associated with
- * a mapping
- */
- public void initialize(Session session) {
- if (this.descriptor != null) {
- return;
- }
-
- if (this.entityClass == null) {
- throw new IllegalStateException("FetchPlan.initialize: Null entityClass found");
- }
-
- this.descriptor = session.getClassDescriptor(getEntityClass());
- if (this.descriptor == null) {
- throw new IllegalStateException("No descriptor found for class: " + getEntityClass());
- }
-
- if (session.getSessionLog().shouldLog(SessionLog.FINER, LOG_CATEGORY)) {
- SessionLogEntry entry = new SessionLogEntry(SessionLog.FINEST, LOG_CATEGORY, (AbstractSession) session, "FetchPlan: initializing {0}", new Object[] { this }, null, false);
- session.getSessionLog().log(entry);
- }
-
- // Add identifier and optimistic locking version attributes
- for (DatabaseMapping mapping : this.descriptor.getObjectBuilder().getPrimaryKeyMappings()) {
- if (!getItems().containsKey(mapping.getAttributeName())) {
- addAttribute(mapping.getAttributeName());
-
- if (session.getSessionLog().shouldLog(SessionLog.FINEST, LOG_CATEGORY)) {
- SessionLogEntry entry = new SessionLogEntry(SessionLog.FINEST, LOG_CATEGORY, (AbstractSession) session, "FetchPlan: Added required id attribute {0} to {1}", new Object[] { mapping.getAttributeName(), this }, null, false);
- session.getSessionLog().log(entry);
- }
- }
- }
-
- if (this.descriptor.usesOptimisticLocking()) {
- DatabaseField lockField = this.descriptor.getOptimisticLockingPolicy().getWriteLockField();
- if (lockField != null) {
- DatabaseMapping lockMapping = this.descriptor.getObjectBuilder().getMappingForField(lockField);
- if (lockMapping != null && !getItems().containsKey(lockMapping.getAttributeName())) {
- addAttribute(lockMapping.getAttributeName());
-
- if (session.getSessionLog().shouldLog(SessionLog.FINEST, LOG_CATEGORY)) {
- SessionLogEntry entry = new SessionLogEntry(SessionLog.FINEST, LOG_CATEGORY, (AbstractSession) session, "FetchPlan: Added required lock attribute {0} to {1}", new Object[] { lockMapping.getAttributeName(), this }, null, false);
- session.getSessionLog().log(entry);
- }
- }
- }
- }
-
- for (FetchItem item : getItems().values()) {
- item.initialize(session);
- }
- }
-
- protected ClassDescriptor getDescriptor(Session session) {
- initialize(session);
- return this.descriptor;
- }
-
- /**
- * Add an item to be fetched. This can be either a mapped attribute name of
- * the current {@link #entityClass} or it can be a path of mapped attribute
- * names '.' separated. The values are not validated against the mappings
- * when added but are instead validated during {@link #initialize(Session)}
- * when the plan is used in a fetch/copy/merge operation.
- */
- public FetchItem addAttribute(String... nameOrPath) {
- String[] attributePaths = convert(nameOrPath);
- FetchPlan currentFP = this;
- FetchItem item = null;
-
- for (int index = 0; index < attributePaths.length; index++) {
- String attrName = attributePaths[index];
- item = (FetchItem) currentFP.getItems().get(attrName);
-
- if (item == null) {
- item = new FetchItem(currentFP, attrName);
- currentFP.getItems().put(attrName, item);
- }
-
- currentFP = item.getFetchPlan();
- if (currentFP == null && index < (attributePaths.length - 1)) {
- currentFP = new FetchPlan(getName() + "-" + attrName, null);
- item.setFetchPlan(currentFP);
- }
- }
-
- return item;
- }
-
- private FetchItem addAttribute(DatabaseMapping mapping) {
- FetchItem item = new FetchItem(this, mapping);
- getItems().put(mapping.getAttributeName(), item);
- return item;
- }
-
- /**
- * Add all of the attributes from the provided FetchGroup.
- */
- @SuppressWarnings("unchecked")
- public void addAttributes(FetchGroup fetchGroup) {
- for (String attribute : (Set<String>) fetchGroup.getAttributes()) {
- addAttribute(attribute);
- }
- }
-
- /**
- * Identifies if the attribute name or path exists in the plan.
- */
- public boolean containsAttribute(String... attributeNameOrPath) {
- String[] attributePaths = convert(attributeNameOrPath);
- FetchPlan currentFP = this;
- FetchItem item = null;
-
- for (int index = 0; index < attributePaths.length; index++) {
- String attrName = attributePaths[index];
- item = (FetchItem) currentFP.getItems().get(attrName);
-
- if (item == null) {
- return false;
- }
-
- currentFP = item.getFetchPlan();
- if (currentFP == null && index < (attributePaths.length - 1)) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Convert a provided name or path which could be a single attributeName, a
- * single string with dot separated attribute names, or an array of
- * attribute names defining the path.
- */
- private String[] convert(String... nameOrPath) {
- if (nameOrPath == null || nameOrPath.length == 0 || (nameOrPath.length == 1 && (nameOrPath[0] == null || nameOrPath[0].length() == 0))) {
- throw new IllegalArgumentException("FetchPlan: illegal attribute name or path: '" + nameOrPath + "'");
- }
-
- String[] path = nameOrPath;
- if (nameOrPath.length > 1 || !nameOrPath[0].contains(".")) {
- path = nameOrPath;
- } else {
- if (nameOrPath[0].endsWith(".")) {
- throw new IllegalArgumentException("Invalid path: " + nameOrPath[0]);
- }
- path = nameOrPath[0].split("\\.");
- }
-
- if (path.length == 0) {
- throw new IllegalArgumentException("Invalid path: " + nameOrPath[0]);
- }
-
- for (int index = 0; index < path.length; index++) {
- if (path[index] == null || path[index].length() == 0 || !path[index].trim().equals(path[index])) {
- throw new IllegalArgumentException("Invalid path: " + nameOrPath[0]);
- }
- }
- return path;
- }
-
- /**
- * Instantiate all items ({@link FetchItem}) for the result provided. This
- * walks through the query result using the items and the session's mapping
- * metadata to populate all requested attributes and relationships.
- * <p>
- * This method ensures that the provided entity has at least the attributes
- * specified in the plan loaded. Additional attributes may already have been
- * loaded or will be loaded through interaction with {@link FetchGroup}
- * behavior.
- * <p>
- * In the case of composite results (Collection<Object[]) all result
- * elements of the array have fetch performed on them.
- */
- public void fetch(Object entity, AbstractSession session) {
- initialize(session);
-
- if (entity instanceof Collection<?>) {
- for (Object e : (Collection<?>) entity) {
- if (e instanceof Object[]) {
- for (int index = 0; index < ((Object[]) e).length; index++) {
- if (((Object[]) e)[index].getClass() == getEntityClass()) {
- fetch(((Object[]) e)[index], session);
- }
- }
- } else {
- fetch(e, session);
- }
- }
- } else {
- for (Map.Entry<String, FetchItem> entry : getItems().entrySet()) {
- entry.getValue().fetch(entity, session);
- }
- }
- }
-
- /**
- * Special fetch operation for composite query results where the SELECT
- * returned multiple items and each result is an array of objects. This
- * method allows an index to be specified so that only the result in
- * question is used in the fetch operation.
- *
- * @see #fetch(Object, AbstractSession)
- */
- public void fetch(Collection<Object[]> entities, int resultIndex, AbstractSession session) {
- for (Object[] entity : entities) {
- fetch(entity[resultIndex], session);
- }
- }
-
- /**
- * Configure a redirector on the query so that this {@link FetchPlan} is
- * applied on the result before it is returned. This cannot be used in
- * conjunction with other redirectors or queries that return results that
- * are not a single entity or collection of entities (No {@link ReportQuery}
- * ).
- */
- public void fetchOnExecute(ObjectLevelReadQuery query) {
- query.setRedirector(new QueryRedirector() {
- public Object invokeQuery(DatabaseQuery query, Record arguments, Session session) {
- Object result = query.execute((AbstractSession) session, (AbstractRecord) arguments);
- fetch(result, (AbstractSession) session);
- return result;
- }
- });
- }
-
- /**
- * Make a copy of the provided source (entity or collection of
- * entities)copying only the attributes specified in this plan. If a
- * relationship does not specify a target
- *
- * @param <T>
- * @param source
- * @param session
- * @return
- */
- @SuppressWarnings("unchecked")
- public <T> T copy(T source, AbstractSession session) {
- initialize(session);
-
- if (source == null) {
- return null;
- }
-
- return (T) copy(source, session, new CopyTrace());
- }
-
- /**
- * Create a copy of the entity or collection of entities ensure identity
- * through maintenance of a map of copies (original -> copy).
- */
- protected Object copy(Object source, AbstractSession session, CopyTrace copies) {
- if (source instanceof Object[]) {
- throw new IllegalArgumentException("Fetchplan.copy does not support Object[]");
- }
-
- CopyFetchPlans copyPlans = copies.get(source);
- if (copyPlans.isCopied(this)) {
- return copyPlans.getCopy();
- }
-
- if (source instanceof Collection<?>) {
- return copyAll((Collection<?>) source, session, copies);
- }
-
- ClassDescriptor descriptor = getDescriptor(session);
-
- Object copy = copyPlans.getCopy();
-
- if (copy == null) {
- copy = descriptor.getInstantiationPolicy().buildNewInstance();
- copyPlans.setCopy(copy);
- }
- copyPlans.addCopied(this);
-
- ObjectCopyingPolicy policy = new ObjectCopyingPolicy();
- policy.setShouldResetPrimaryKey(false);
- policy.setSession(session);
-
- // Copy all specified items
- for (Map.Entry<String, FetchItem> entry : getItems().entrySet()) {
- entry.getValue().copy(source, copy, session, policy, copies);
- }
-
- return copy;
- }
-
- /**
- * Create copy of a collection
- */
- @SuppressWarnings("unchecked")
- protected Object copyAll(Collection<?> source, AbstractSession session, CopyTrace copies) {
- CopyFetchPlans copyPlans = copies.get(source);
- Collection<Object> copiesCollection = (Collection<Object>) copyPlans.getCopy();
- boolean newCollection = false;
-
- if (copiesCollection == null) {
- try {
- Constructor<?> constructor = source.getClass().getConstructor(int.class);
- copiesCollection = (Collection<Object>) constructor.newInstance(source.size());
- } catch (Exception e) {
- throw new RuntimeException("FetchPlan.copy: failed to create copy of result container for: " + source.getClass(), e);
- }
- newCollection = true;
- }
-
- for (Object entity : source) {
- Object copy = copy(entity, session, copies);
- if (newCollection) {
- copiesCollection.add(copy);
- }
- }
-
- copyPlans.setCopy(copiesCollection);
- copyPlans.addCopied(this);
-
- return copiesCollection;
- }
-
- /**
- * Do a partial merge of the provided entity into the UnitOfWork using the
- * items specified in this FetchPlan.
- *
- * @return the working copy for the entity that may include additional
- * attributes then what was merged.
- */
- @SuppressWarnings("unchecked")
- public <T> T merge(T entity, UnitOfWork uow) {
- initialize(uow);
-
- FetchPlanMergeManager mergeManager = new FetchPlanMergeManager((AbstractSession) uow);
- mergeManager.getFetchPlans().put(entity, this);
-
- return (T) ((UnitOfWorkImpl) uow).mergeCloneWithReferences(entity, mergeManager);
- }
-
- /**
- * Create a dynamic {@link FetchGroup} that includes all of the mapped
- * attributes on the {@link #entityClass}. The returned FetchGroup will not
- * cause relationships to be loaded or any nested FetchItems to be applied.
- * This is generally used in combination with the fetch/copy methods on
- * FetchPlan or {@link JpaFetchPlanHelper} to post process the query results
- * ensuring that all requested attributes in the graph are loaded (or
- * copied).
- * <p>
- * <b>JPA Usage Example</b>:
- * <p>
- * <code>
- * query.setHint(QueryHints.FETCH_GROUP, fetchPlan.createFetchGroup());<br/>
- * List<Employee> emps = query.getResultList();<br/>
- * JpaFetchPlanHelper.fetch(em, fetchPlan, emps);<br/>
- * </code>
- */
- public FetchGroup createFetchGroup() {
- FetchGroup group = new FetchGroup(toString() + "_fetch-group");
- for (String attrName : getItems().keySet()) {
- group.addAttribute(attrName);
- }
- return group;
- }
-
- public String toString() {
- return "FetchPlan(" + getName() + ")";
- }
-
- /**
- * Utility class that tracks the copying of the graph to ensure the identity
- * of the entities based on source so that only one copy per source is
- * created
- */
- protected class CopyTrace {
-
- private Map<Object, CopyFetchPlans> copies = new HashMap<Object, CopyFetchPlans>();
-
- public CopyFetchPlans get(Object source) {
- CopyFetchPlans copyFetchPlans = this.copies.get(source);
-
- if (copyFetchPlans == null) {
- copyFetchPlans = new CopyFetchPlans();
- this.copies.put(source, copyFetchPlans);
- }
- return copyFetchPlans;
- }
-
- }
-
- /**
- * TODO
- */
- protected class CopyFetchPlans {
-
- /**
- * Entity being copied
- */
- private Object copy;
-
- /**
- * Plans processed for this copy
- */
- private Set<FetchPlan> plans;
-
- CopyFetchPlans() {
- this.plans = new HashSet<FetchPlan>();
- }
-
- protected Object getCopy() {
- return this.copy;
- }
-
- protected boolean hasCopy() {
- return this.copy != null;
- }
-
- protected void setCopy(Object copy) {
- this.copy = copy;
- }
-
- protected boolean isCopied(FetchPlan fetchPlan) {
- return hasCopy() && this.plans.contains(fetchPlan);
- }
-
- protected void addCopied(FetchPlan fetchPlan) {
- this.plans.add(fetchPlan);
- }
- }
-
- private static final String PROPERTY = "DEFAULT-FETCH-PLAN";
-
- /**
- * TODO
- */
- @SuppressWarnings("unchecked")
- protected static FetchPlan defaultFetchPlan(DatabaseMapping mapping) {
- if (mapping.getReferenceDescriptor() == null) {
- return null;
- }
-
- ClassDescriptor targetDescriptor = mapping.getReferenceDescriptor();
- FetchPlan fp = (FetchPlan) mapping.getProperty(PROPERTY);
-
- if (fp == null) {
- fp = new FetchPlan(targetDescriptor);
- mapping.setProperty(PROPERTY, fp);
-
- if (mapping.isForeignReferenceMapping()) {
- FetchGroup mappingFG = null;
- ForeignReferenceMapping frMapping = (ForeignReferenceMapping) mapping;
- ObjectLevelReadQuery mappingQuery = (ObjectLevelReadQuery) frMapping.getSelectionQuery();
-
- if (mappingQuery.getFetchGroup() != null) {
- mappingFG = mappingQuery.getFetchGroup();
- } else if (mappingQuery.getFetchGroupName() != null && targetDescriptor.hasFetchGroupManager()) {
- mappingFG = targetDescriptor.getFetchGroupManager().getFetchGroup(mappingQuery.getFetchGroupName());
- }
-
- if (mappingFG != null) {
- for (String attr : (Set<String>) mappingFG.getAttributes()) {
- fp.addAttribute(targetDescriptor.getMappingForAttributeName(attr));
- }
- return fp;
- }
- }
- fp.addDefaultMappings();
- }
- return fp;
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/fetchplan/FetchPlanMergeManager.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/fetchplan/FetchPlanMergeManager.java
deleted file mode 100644
index 2299bc9..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/fetchplan/FetchPlanMergeManager.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: Fetch Plan Extension Incubator
- ******************************************************************************/
-package org.eclipse.persistence.extension.fetchplan;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.descriptors.DescriptorEventManager;
-import org.eclipse.persistence.descriptors.VersionLockingPolicy;
-import org.eclipse.persistence.exceptions.OptimisticLockException;
-import org.eclipse.persistence.indirection.IndirectContainer;
-import org.eclipse.persistence.indirection.ValueHolderInterface;
-import org.eclipse.persistence.internal.descriptors.ObjectBuilder;
-import org.eclipse.persistence.internal.sessions.AbstractSession;
-import org.eclipse.persistence.internal.sessions.MergeManager;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-
-/**
- * Custom MergeManager to support sparse merge based on a FetchPlan.
- *
- * @see FetchPlan
- *
- * @author dclarke
- * @since EclipseLink 1.2
- */
-public class FetchPlanMergeManager extends MergeManager {
-
- /**
- * Map of entities to FetchPlan used to do sparse merge on entities in the
- * graph described by a FetchPlan. When started only the root entity being
- * merged is set in the map and then as each level of the graph being merged
- * is traversed the additional objects are added before calling merge on the
- * mapping so that when called back into
- * {@link #mergeIntoObject(Object, boolean, Object, boolean, boolean, ClassDescriptor)}
- * method the appropriate plan can be looked up and used.
- */
- private Map<Object, FetchPlan> fetchPlans = new HashMap<Object, FetchPlan>();
-
- public FetchPlanMergeManager(AbstractSession session) {
- super(session);
- setMergePolicy(CLONE_INTO_WORKING_COPY);
- }
-
- protected Map<Object, FetchPlan> getFetchPlans() {
- return this.fetchPlans;
- }
-
- @Override
- protected Object mergeChangesOfCloneIntoWorkingCopy(Object rmiClone) {
- Object registeredObject = registerObjectForMergeCloneIntoWorkingCopy(rmiClone);
-
- if (registeredObject == rmiClone && !shouldForceCascade()) {
- // need to find better better fix. prevents merging into itself.
- return rmiClone;
- }
-
- ClassDescriptor descriptor = this.session.getDescriptor(rmiClone);
- try {
- ObjectBuilder builder = descriptor.getObjectBuilder();
-
- if (registeredObject != rmiClone && descriptor.usesVersionLocking() && !mergedNewObjects.containsKey(registeredObject)) {
- VersionLockingPolicy policy = (VersionLockingPolicy) descriptor.getOptimisticLockingPolicy();
- if (policy.isStoredInObject()) {
- Object currentValue = builder.extractValueFromObjectForField(registeredObject, policy.getWriteLockField(), session);
-
- if (policy.isNewerVersion(currentValue, rmiClone, session.keyFromObject(rmiClone), session)) {
- throw OptimisticLockException.objectChangedSinceLastMerge(rmiClone);
- }
- }
- }
-
- // Toggle change tracking during the merge.
- descriptor.getObjectChangePolicy().dissableEventProcessing(registeredObject);
-
- boolean cascadeOnly = false;
- if (registeredObject == rmiClone || mergedNewObjects.containsKey(registeredObject)) {
- // GF#1139 Cascade merge operations to relationship mappings
- // even if already registered
- cascadeOnly = true;
- }
-
- // Merge into the clone from the original and use the clone as
- // backup as anything different should be merged.
- mergeIntoObject(registeredObject, false, rmiClone, cascadeOnly, false, descriptor);
- } finally {
- descriptor.getObjectChangePolicy().enableEventProcessing(registeredObject);
- }
-
- return registeredObject;
- }
-
- /**
- * This code is copied from
- * {@link ObjectBuilder#mergeIntoObject(Object, boolean, Object, MergeManager, boolean, boolean)}
- * to enable {@link FetchPlan} specific merging. The method in ObjectBuilder
- * merges all relationships based on mappings and cascade configuration
- * where as this does it by FetchPlan's items.
- */
- public void mergeIntoObject(Object target, boolean isUnInitialized, Object source, boolean cascadeOnly, boolean isTargetCloneOfOriginal, ClassDescriptor descriptor) {
- FetchPlan plan = getFetchPlans().get(source);
-
- if (plan == null) {
- descriptor.getObjectBuilder().mergeIntoObject(target, isUnInitialized, source, this);
- return;
- }
-
- for (FetchItem item : plan.getItems().values()) {
- DatabaseMapping mapping = item.getMapping(getSession());
-
- if (mapping.getReferenceDescriptor() != null) {
- Object sourceValue = mapping.getAttributeValueFromObject(source);
-
- if (sourceValue instanceof IndirectContainer && ((IndirectContainer) sourceValue).isInstantiated()) {
- sourceValue = ((IndirectContainer) sourceValue).getValueHolder();
- }
- if (sourceValue instanceof ValueHolderInterface && ((ValueHolderInterface) sourceValue).isInstantiated()) {
- sourceValue = ((ValueHolderInterface) sourceValue).getValue();
- }
-
- // Configure FetchPlan usage for related objects
- if (sourceValue != null && !getFetchPlans().containsKey(sourceValue)) {
- FetchPlan fp = item.getFetchPlan();
-
- if (fp == null && mapping.getReferenceDescriptor() != null) {
- fp = FetchPlan.defaultFetchPlan(mapping);
- }
- if (sourceValue instanceof Collection<?>) {
- for (Object obj : (Collection<?>) sourceValue) {
- getFetchPlans().put(obj, fp);
- }
- } else {
- getFetchPlans().put(sourceValue, fp);
- }
- }
- }
-
- mapping.mergeIntoObject(target, isUnInitialized, source, this);
- }
-
- // PERF: Avoid events if no listeners.
- if (descriptor.getEventManager().hasAnyEventListeners()) {
- org.eclipse.persistence.descriptors.DescriptorEvent event = new org.eclipse.persistence.descriptors.DescriptorEvent(target);
- event.setSession(getSession());
- event.setOriginalObject(source);
- event.setEventCode(DescriptorEventManager.PostMergeEvent);
- descriptor.getEventManager().executeEvent(event);
- }
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/fetchplan/JpaFetchPlanHelper.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/fetchplan/JpaFetchPlanHelper.java
deleted file mode 100644
index 97f689e..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/fetchplan/JpaFetchPlanHelper.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: FetchPlan Example
- ******************************************************************************/
-package org.eclipse.persistence.extension.fetchplan;
-
-import java.util.Collection;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.internal.jpa.EntityManagerImpl;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.sessions.Session;
-
-/**
- * Helper class to simplify the usage of the {@link FetchPlan} extension with an
- * EclipseLink JPA context. The API on FetchPlan makes use of native EclipseLink
- * session types while these methods handle the unwrapping of the provided
- * EntityManager as needed.
- *
- * @author dclarke
- * @since EclipseLink 2.1
- */
-public class JpaFetchPlanHelper {
-
- /**
- * @see FetchPlan#fetch(Object,
- * org.eclipse.persistence.internal.sessions.AbstractSession)
- */
- public static void fetch(EntityManager em, FetchPlan fetchPlan, Object entity) {
- fetchPlan.fetch(entity, JpaHelper.getEntityManager(em).getServerSession());
- }
-
- /**
- * @see FetchPlan#fetch(Object,
- * org.eclipse.persistence.internal.sessions.AbstractSession)
- */
- public static void fetch(EntityManager em, FetchPlan fetchPlan, Collection<?> entities) {
- fetchPlan.fetch(entities, JpaHelper.getEntityManager(em).getServerSession());
- }
-
- /**
- * @see FetchPlan#fetch(Object,
- * org.eclipse.persistence.internal.sessions.AbstractSession)
- */
- public static void fetch(EntityManager em, FetchPlan fetchPlan, Collection<Object[]> results, int resultIndex) {
- fetchPlan.fetch(results, resultIndex, JpaHelper.getEntityManager(em).getServerSession());
- }
-
- /**
- * @see FetchPlan#copy(Object,
- * org.eclipse.persistence.internal.sessions.AbstractSession, boolean)
- */
- public static <T> T copy(EntityManager em, FetchPlan fetchPlan, T entity) {
- return fetchPlan.copy(entity, JpaHelper.getEntityManager(em).getServerSession());
- }
-
- /**
- * @see FetchPlan#merge(Object, org.eclipse.persistence.sessions.UnitOfWork)
- */
- public static <T> T merge(EntityManager em, FetchPlan fetchPlan, T entity) {
- return fetchPlan.merge(entity, JpaHelper.getEntityManager(em).getUnitOfWork());
- }
-
- /**
- * @see #addDefaultFetchGroupAttributes(EntityManagerFactory, FetchPlan)
- */
- public static void addDefaultFetchAttributes(EntityManager em, FetchPlan fetchPlan) {
- EntityManagerImpl emImpl = (EntityManagerImpl) JpaHelper.getEntityManager(em);
-
- if (emImpl == null) {
- throw new IllegalArgumentException("JpaFetchPlanHelper.addDefaultFetchGroupAttributes: could not unwrap EntityManager: " + em);
- }
- addDefaultFetchAttributes(emImpl.getEntityManagerFactory(), fetchPlan);
- }
-
- /**
- * Add all of the EAGER mapped attributes to the FetchPlan. This will match
- * the default FetchGroup if one is configured on the entity type's
- * descriptor (using the entityClass in the provided FetchPlan) or the
- * mappings if no default FetchGroup is available.
- *
- * @throws IllegalArgumentException
- * if no descriptor can be found for the entityClass of the
- * FetchPlan provided.
- */
- public static void addDefaultFetchAttributes(EntityManagerFactory emf, FetchPlan fetchPlan) {
- Session session = JpaHelper.getServerSession(emf);
- ClassDescriptor descriptor = session.getClassDescriptor(fetchPlan.getEntityClass());
-
- if (descriptor == null) {
- throw new IllegalArgumentException("No descriptor found for: " + fetchPlan.getEntityClass());
- }
- // TODO - is this really required?
- fetchPlan.initialize(session);
- fetchPlan.addDefaultMappings();
- }
-
- /**
- * Add all of the attributes from the named FetchGroup to the FetchPlan.
- */
- public static void addNamedFetchGroupAttributes(EntityManager em, String fetchGroupName, FetchPlan fetchPlan) {
- EntityManagerImpl emImpl = (EntityManagerImpl) JpaHelper.getEntityManager(em);
-
- if (emImpl == null) {
- throw new IllegalArgumentException("JpaFetchPlanHelper.addNamedFetchGroupAttributes: could not unwrap EntityManager: " + em);
- }
- addNamedFetchGroupAttributes(emImpl.getEntityManagerFactory(), fetchGroupName, fetchPlan);
- }
-
- /**
- * Add all of the attributes from the named FetchGroup to the FetchPlan.
- */
- public static void addNamedFetchGroupAttributes(EntityManagerFactory emf, String fetchGroupName, FetchPlan fetchPlan) {
- Session session = JpaHelper.getServerSession(emf);
- ClassDescriptor descriptor = session.getClassDescriptor(fetchPlan.getEntityClass());
-
- if (descriptor != null && descriptor.hasFetchGroupManager()) {
- FetchGroup fg = descriptor.getFetchGroupManager().getFetchGroup(fetchGroupName);
- if (fg != null) {
- fetchPlan.addAttributes(fg);
- return;
- }
- }
- throw new IllegalArgumentException("JpaFetchPlanHelper.addNamedFetchGroupAttributes: No descriptor or default FetchGroup on: " + fetchPlan.getEntityClass());
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/query/BatchInConfig.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/query/BatchInConfig.java
deleted file mode 100644
index f0418b1..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/src/org/eclipse/persistence/extension/query/BatchInConfig.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - TODO
- ******************************************************************************/
-package org.eclipse.persistence.extension.query;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.expressions.Expression;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.indirection.IndirectContainer;
-import org.eclipse.persistence.indirection.ValueHolderInterface;
-import org.eclipse.persistence.internal.indirection.BatchValueHolder;
-import org.eclipse.persistence.internal.indirection.QueryBasedValueHolder;
-import org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder;
-import org.eclipse.persistence.internal.sessions.AbstractSession;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.mappings.ForeignReferenceMapping;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-import org.eclipse.persistence.mappings.OneToOneMapping;
-import org.eclipse.persistence.queries.ReadAllQuery;
-import org.eclipse.persistence.queries.ReadQuery;
-
-/**
- * This is an extension to EclipseLink intending to assist customers who need to
- * use BATCH reading with an IN operator instead of joining from the target
- * table back to the source table.
- * <p>
- * Usage Requirements:
- * <ul>
- * <li>Can only be used on the results of a query with batching configured. This
- * also means that the query can only return a single entity type in select.
- * <li>The source of the query must be an entity with a single part primary key
- * <li>The mapping that is to be batched using IN must be a 1:1, M:1 or 1:M with
- * a single FK mapping.
- * <li>The quantity of ids to use with the IN must not exceed the limits of the
- * target database
- * </ul>
- * <p>
- * <b>Usage Example</b>: <code><br/>
- * Query q = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");<br/>
- * q.setParameter("GENDER", Gender.Male);<br/>
- * q.setHint(QueryHints.BATCH, "e.address");<br/>
- * List<Employee> emps = q.getResultList();<br/>
- * //The batch-in configuration is made after the results are retrieved<br/>
- * BatchInConfig.config(em, emps, "address");<br/>
- * </code>
- *
- * @author dclarke
- * @since EclipseLink 1.2
- */
-public class BatchInConfig {
-
- /**
- * Configure the batching in query results to use IN instead of joining back
- * to the source tables. This method should be called after the results of a
- * query using batch with fetch=LAZY but before the BatchValueHolder on the
- * first result has been instantiated.
- *
- * @param em
- * EntityManager the query was run against
- * @param results
- * A list of query results assumed to all be of the same entity
- * type.
- * @param attribute
- * name of attribute to be batched
- */
- public static void config(EntityManager em, List<?> results, String attribute) {
- if (results == null || results.isEmpty()) {
- return;
- }
-
- AbstractSession session = JpaHelper.getEntityManager(em).getServerSession();
- ClassDescriptor descriptor = session.getClassDescriptor(results.get(0));
-
- if (descriptor == null) {
- throw new IllegalArgumentException("No descriptor found for entity: " + results.get(0));
- }
-
- DatabaseMapping mapping = descriptor.getMappingForAttributeName(attribute);
-
- if (mapping == null) {
- throw new IllegalArgumentException("No mapping found on " + descriptor + " with name:" + attribute);
- }
- if (!mapping.isOneToOneMapping() && !mapping.isOneToManyMapping()) {
- throw new IllegalArgumentException("Invalid mapping type found: " + mapping);
- }
-
- ForeignReferenceMapping frMapping = (ForeignReferenceMapping) mapping;
- if (!frMapping.usesIndirection()) {
- throw new IllegalArgumentException("Invalid mapping type found: " + mapping);
- }
-
- BatchValueHolder batchVH = getBatchValueHolder(frMapping, results, (AbstractSession) session);
-
- if (batchVH == null) {
- SessionLog log = JpaHelper.getEntityManager(em).getServerSession().getSessionLog();
- log.log(SessionLog.FINE, "BatchInConfig::No BatchValueHolder found for " + attribute);
- return;
- }
-
- if (mapping.isOneToOneMapping()) {
- configBatchInQuery(session, (OneToOneMapping) mapping, (ReadAllQuery) batchVH.getQuery(), results);
- } else if (mapping.isOneToManyMapping()) {
- configBatchInQuery(session, (OneToManyMapping) mapping, (ReadAllQuery) batchVH.getQuery(), results);
- }
- }
-
- /**
- * Find the first BatchValueHolder in the results
- */
- private static BatchValueHolder getBatchValueHolder(ForeignReferenceMapping mapping, List<?> results, AbstractSession session) {
- Object result = results.get(0);
-
- Object value = mapping.getAttributeValueFromObject(result);
- if (value instanceof IndirectContainer) {
- value = ((IndirectContainer) value).getValueHolder();
- }
- if (value instanceof UnitOfWorkValueHolder) {
- value = ((UnitOfWorkValueHolder) value).getWrappedValueHolder();
- }
- if (value instanceof BatchValueHolder) {
- // This assumes that if the first value holder is batched its for
- // this collection of results and all results have the same batch
- // value holder
- return (BatchValueHolder) value;
- }
-
- if (value instanceof QueryBasedValueHolder) {
- replaceQueryBasedValueHolders(mapping, results, session);
- return getBatchValueHolder(mapping, results, session);
- }
-
- throw new IllegalStateException("TODO: How can we get here?");
- }
-
- /**
- * Customize the query for a 1:1 or M:1
- */
- private static void configBatchInQuery(AbstractSession session, OneToOneMapping mapping, ReadAllQuery raq, List<?> results) {
- if (mapping.getForeignKeyFields().size() != 1) {
- throw new IllegalArgumentException("Cannot configure batch using IN with composite FK: " + mapping);
- }
-
- Object[] ids = new Object[results.size()];
-
- for (int index = 0; index < results.size(); index++) {
- ValueHolderInterface vhi = (ValueHolderInterface) mapping.getAttributeValueFromObject(results.get(index));
- if (vhi instanceof UnitOfWorkValueHolder) {
- vhi = ((UnitOfWorkValueHolder) vhi).getWrappedValueHolder();
- }
- QueryBasedValueHolder bvh = (QueryBasedValueHolder) vhi;
-
- ids[index] = bvh.getRow().get(mapping.getForeignKeyFields().get(0));
- }
-
- ExpressionBuilder eb = new ExpressionBuilder(mapping.getReferenceClass());
- raq.setExpressionBuilder(eb);
- Expression idExp = eb.getField(mapping.getReferenceDescriptor().getPrimaryKeyFields().get(0)).in(ids);
- raq.setSelectionCriteria(idExp);
- }
-
- /**
- * Customize the query for a 1:M
- */
- private static void configBatchInQuery(AbstractSession session, OneToManyMapping mapping, ReadAllQuery raq, List<?> results) {
- if (raq == null) {
- // TODO: This occurs when there is no query available.
- return;
- }
-
- if (mapping.getTargetForeignKeyFields().size() != 1) {
- throw new IllegalArgumentException("Cannot configure batch using IN with composite FK: " + mapping);
- }
-
- Object[] ids = new Object[results.size()];
-
- for (int index = 0; index < results.size(); index++) {
- List<?> idValues = mapping.getDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(results.get(index), (AbstractSession) session);
- ids[index] = idValues.get(0);
- }
-
- ExpressionBuilder eb = new ExpressionBuilder(mapping.getReferenceClass());
- raq.setExpressionBuilder(eb);
- Expression idExp = eb.getField(mapping.getTargetForeignKeyFields().get(0)).in(ids);
- raq.setSelectionCriteria(idExp);
- }
-
- public static void config(Query query, List<?> results, String attribute) {
- if (results == null || results.isEmpty()) {
- return;
- }
-
- ReadAllQuery raq = JpaHelper.getReadAllQuery(query);
- ClassDescriptor descriptor = raq.getDescriptor();
-
- if (descriptor == null) {
- throw new IllegalArgumentException("No descriptor found for query: " + raq);
- }
-
- DatabaseMapping mapping = descriptor.getMappingForAttributeName(attribute);
-
- if (mapping == null) {
- throw new IllegalArgumentException("No mapping found on " + descriptor + " with name:" + attribute);
- }
- if (!mapping.isOneToOneMapping() && !mapping.isOneToManyMapping()) {
- throw new IllegalArgumentException("Invalid mapping type found: " + mapping);
- }
-
- ForeignReferenceMapping frMapping = (ForeignReferenceMapping) mapping;
- if (!frMapping.usesIndirection()) {
- throw new IllegalArgumentException("Invalid mapping type found: " + mapping);
- }
-
- ReadQuery batchQuery = frMapping.prepareNestedBatchQuery(raq);
- Object value = frMapping.getIndirectionPolicy().valueFromBatchQuery(batchQuery, null, raq);
-
- for (Object result : results) {
- frMapping.setAttributeValueInObject(result, value);
- }
- }
-
- /**
- * Replace All existing {@link QueryBasedValueHolder} in a set of entities
- * for the provided mapping with {@link BatchValueHolder} that are later
- * updated to use the IN operation.
- */
- private static void replaceQueryBasedValueHolders(ForeignReferenceMapping mapping, List<?> results, AbstractSession session) {
- // Create fake source query
- ReadAllQuery sourceQuery = new ReadAllQuery(mapping.getDescriptor().getJavaClass());
- sourceQuery.setSession(session);
- sourceQuery.setDescriptor(mapping.getDescriptor());
-
- ReadQuery batchQuery = mapping.prepareNestedBatchQuery(sourceQuery);
-
- for (Object obj : results) {
- ValueHolderInterface vhi = (ValueHolderInterface) mapping.getAttributeValueFromObject(obj);
- if (vhi instanceof UnitOfWorkValueHolder) {
- vhi = ((UnitOfWorkValueHolder) vhi).getWrappedValueHolder();
- }
- Object batchVH = mapping.getIndirectionPolicy().valueFromBatchQuery(batchQuery, ((QueryBasedValueHolder) vhi).getRow(), sourceQuery);
- mapping.setAttributeValueInObject(obj, batchVH);
- }
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/AllTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/AllTests.java
deleted file mode 100644
index 1ef3747..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/AllTests.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: Extensions Incubator - FetchPlan
- ******************************************************************************/
-package test;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { CreateDatabase.class,
- test.batchin.BatchInTests.class,
- test.fetchplan.AllTests.class,
- FetchPlanFetchWithBatchInTests.class})
-public class AllTests {
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/CreateDatabase.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/CreateDatabase.java
deleted file mode 100644
index 3a9582b..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/CreateDatabase.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package test;
-
-import static org.eclipse.persistence.config.PersistenceUnitProperties.DDL_GENERATION;
-import static org.eclipse.persistence.config.PersistenceUnitProperties.DROP_AND_CREATE;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.tools.schemaframework.SchemaManager;
-import org.junit.Test;
-
-import example.Sample;
-import example.util.ExamplePropertiesLoader;
-
-/**
- * Utility class to create the database schema and populate it for the Employee
- * JPA example using XML configuration. This
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-@SuppressWarnings("unchecked")
-public class CreateDatabase {
-
- @Test
- public void createSchemaAndPopulate() {
- populate(new HashMap());
- }
-
- public static void populate(Map properties) {
- properties.put(DDL_GENERATION, DROP_AND_CREATE);
-
- ExamplePropertiesLoader.loadProperties(properties);
- EntityManagerFactory emf = Persistence.createEntityManagerFactory("employee", properties);
-
- new SchemaManager(JpaHelper.getServerSession(emf)).createSequences();
-
- EntityManager em = null;
-
- try {
- em = emf.createEntityManager();
-
- em.getTransaction().begin();
- Sample.population.persistAll(em);
- em.getTransaction().commit();
- } finally {
- if (em != null && em.isOpen()) {
- if (em.getTransaction().isActive()) {
- em.getTransaction().rollback();
- }
- em.close();
- emf.close();
- }
- }
- }
-
- public static void main(String[] args) {
- new CreateDatabase().createSchemaAndPopulate();
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/FetchPlanFetchWithBatchInTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/FetchPlanFetchWithBatchInTests.java
deleted file mode 100644
index cee17f7..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/FetchPlanFetchWithBatchInTests.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: Extensions Incubator - FetchPlan
- ******************************************************************************/
-package test;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-
-import model.Address;
-import model.Employee;
-import model.SmallProject;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.extension.fetchplan.FetchPlan;
-import org.eclipse.persistence.extension.fetchplan.JpaFetchPlanHelper;
-import org.eclipse.persistence.extension.query.BatchInConfig;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.junit.After;
-import org.junit.Test;
-
-import test.fetchplan.FetchPlanAssert;
-import testing.EclipseLinkJPATest;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.2
- */
-@PersistenceContext(unitName = "employee")
-public class FetchPlanFetchWithBatchInTests extends EclipseLinkJPATest {
-
- @SuppressWarnings("unchecked")
- @Test
- public void fetchAddressAndPhones() {
- EntityManager em = getEntityManager();
-
- FetchPlan plan = new FetchPlan(Employee.class);
- plan.addAttribute("address");
- plan.addAttribute("phoneNumbers");
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.salary > 0.0");
-
- query.setHint(QueryHints.BATCH, "e.address");
- query.setHint(QueryHints.BATCH, "e.phoneNumbers");
-
- List<Employee> emps = query.getResultList();
-
- BatchInConfig.config(em, emps, "address");
- BatchInConfig.config(em, emps, "phoneNumbers");
-
- JpaFetchPlanHelper.fetch(em, plan, emps);
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void fetchManagerManager() {
- EntityManager em = getEntityManager();
-
- FetchPlan plan = new FetchPlan(Employee.class);
- plan.addAttribute("managedEmployees.managedEmployees");
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.managedEmployees IS NOT EMPTY");
-
- query.setHint(QueryHints.BATCH, "e.managedEmployees");
- query.setHint(QueryHints.BATCH, "e.managedEmployees.managedEmployees");
-
- List<Employee> emps = query.getResultList();
-
- BatchInConfig.config(em, emps, "managedEmployees");
- BatchInConfig.config(em, emps.get(0).getManagedEmployees(), "managedEmployees");
-
- JpaFetchPlanHelper.fetch(em, plan, emps);
-
- for (Employee emp : emps) {
- System.out.println("> " + emp);
- for (Employee me : emp.getManagedEmployees()) {
- System.out.println("\t> " + me);
- for (Employee me2 : me.getManagedEmployees()) {
- System.out.println("\t\t> " + me2);
- }
- }
- }
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- /**
- * In this test we only try to select all small projects and fetch their
- * teamleaders. Somehow a strange sql gets created and a database exception
- * occurs.
- */
- @Test
- public void findSmallProjectsWithBatchInConfigFetch() {
- EntityManager em = getEntityManager();
- em.getTransaction().begin();
-
- Query q = em.createQuery("SELECT sm FROM SmallProject sm");
- q.setHint(QueryHints.BATCH, "sm.teamLeader");
-
- List<SmallProject> sms = q.getResultList();
-
- BatchInConfig.config(em, sms, "teamLeader");
- FetchPlan fp = new FetchPlan(SmallProject.class);
- fp.addAttribute("teamLeader");
- JpaFetchPlanHelper.fetch(em, fp, sms);
- // Here comes Exception
- em.getTransaction().rollback();
- }
-
- /**
- * In this test, we select all employees with their managed employees and
- * their addresses. Because of unknown reason, we get a
- * IllegalArgumentException on the second call to BatchInConfig.config. The
- * BatchValueHolder should not be set. But we have set the batch hint. So
- * whats wrong?
- */
- @SuppressWarnings("unchecked")
- @Test
- public void findEmployeesWithBatchInConfigFetch() {
- EntityManager em = getEntityManager();
-
- Query q = em.createQuery("SELECT em FROM Employee em ORDER BY em.id");
- q.setHint(QueryHints.BATCH, "em.managedEmployees");
- q.setHint(QueryHints.BATCH, "em.managedEmployees.address");
-
- List<Employee> ems = q.getResultList();
-
- // Display initial Employees read:
- System.out.println("Employees Read - " + ems.size());
- for (Employee emp : ems) {
- System.out.println("\t> " + emp);
- }
-
- BatchInConfig.config(em, ems, "managedEmployees");
- FetchPlan fp = new FetchPlan(Employee.class);
- fp.addAttribute("managedEmployees");
- JpaFetchPlanHelper.fetch(em, fp, ems);
-
- // iterate through all employees and collect their managers
- Set<Employee> managedEmployees = new HashSet<Employee>();
- for (Employee employee : ems) {
- managedEmployees.addAll(employee.getManagedEmployees());
- }
-
- // Fetch for all managers the addresses
- BatchInConfig.config(em, new ArrayList<Employee>(managedEmployees), "address");
- FetchPlan fp2 = new FetchPlan(Employee.class);
- fp2.addAttribute("address");
- JpaFetchPlanHelper.fetch(em, fp2, managedEmployees);
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- System.out.println("Employees Read - " + ems.size());
- for (Employee emp : ems) {
- System.out.println("\t> " + emp);
- for (Employee managedEmp : emp.getManagedEmployees()) {
- System.out.println("\t\t> " + managedEmp);
- System.out.println("\t\t\t> " + managedEmp.getAddress());
- }
- if (emp.getManagedEmployees() == null) {
-
- }
- }
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- em.clear();
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
-
- q = em.createNativeQuery("SELECT EMP_ID, ADDR_ID, MANAGER_ID FROM EMPLOYEE ORDER BY EMP_ID");
- List<Object[]> ids = q.getResultList();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertEquals(ems.size(), ids.size());
-
- for (int index = 0; index < ems.size(); index++) {
- Employee emp = ems.get(index);
- Object[] idRow = ids.get(index);
-
- assertEquals(emp.getId(), ((Number) idRow[0]).intValue());
- if (idRow[2] != null) { // We have a manager
- assertNotNull(emp.getAddress());
- assertEquals(emp.getAddress().getId(), ((Number) idRow[1]).intValue());
- } else {
-
- }
- }
- }
-
- /**
- * This test does not used BatchIn but is here to provide a verification for
- * the assertions of {@link #findEmployeesWithBatchInConfigFetch()}
- */
- @SuppressWarnings("unchecked")
- @Test
- public void findEmployeesWithJoinBatching() {
- EntityManager em = getEntityManager();
-
- Query q = em.createQuery("SELECT em FROM Employee em ORDER BY em.id");
- q.setHint(QueryHints.BATCH, "em.managedEmployees");
- q.setHint(QueryHints.BATCH, "em.managedEmployees.address");
-
- List<Employee> ems = q.getResultList();
-
- // Display initial Employees read:
- System.out.println("Employees Read - " + ems.size());
- for (Employee emp : ems) {
- System.out.println("\t> " + emp);
- }
-
- //BatchInConfig.config(em, ems, "managedEmployees");
- FetchPlan fp = new FetchPlan(Employee.class);
- fp.addAttribute("managedEmployees");
- JpaFetchPlanHelper.fetch(em, fp, ems);
-
- // iterate through all employees and collect their managers
- Set<Employee> managedEmployees = new HashSet<Employee>();
- for (Employee employee : ems) {
- managedEmployees.addAll(employee.getManagedEmployees());
- }
-
- // Fetch for all managers the addresses
- //BatchInConfig.config(em, new ArrayList<Employee>(managedEmployees), "address");
- FetchPlan fp2 = new FetchPlan(Employee.class);
- fp2.addAttribute("address");
- JpaFetchPlanHelper.fetch(em, fp2, managedEmployees);
-
- assertEquals(13, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- System.out.println("Employees Read - " + ems.size());
- for (Employee emp : ems) {
- System.out.println("\t> " + emp);
- for (Employee managedEmp : emp.getManagedEmployees()) {
- System.out.println("\t\t> " + managedEmp);
- System.out.println("\t\t\t> " + managedEmp.getAddress());
- }
- if (emp.getManagedEmployees() == null) {
-
- }
- }
-
- assertEquals(13, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- em.clear();
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
-
- q = em.createNativeQuery("SELECT e.EMP_ID, e.ADDR_ID, e.MANAGER_ID FROM EMPLOYEE e, SALARY s WHERE s.EMP_ID = e.EMP_ID ORDER BY e.EMP_ID");
- List<Object[]> ids = q.getResultList();
-
- assertEquals(14, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertEquals(ems.size(), ids.size());
-
- for (int index = 0; index < ems.size(); index++) {
- Employee emp = ems.get(index);
- Object[] idRow = ids.get(index);
-
- assertEquals(emp.getId(), ((Number) idRow[0]).intValue());
- if (idRow[2] != null) { // We have a manager
- assertNotNull(emp.getAddress());
- assertEquals("Incorrect address on: " + emp, emp.getAddress().getId(), ((Number) idRow[1]).intValue());
- } else {
-
- }
- }
- }
-
- /**
- * Here we just want to show that in the merge SQLs are fired which we
- * consider unnecessary.
- *
- * @throws Exception
- */
- @Test
- public void findEmployeesWithBatchInConfigFetchAndDetachThem() throws Exception {
- EntityManager em = getEntityManager();
- em.getTransaction().begin();
-
- Query q = em.createQuery("SELECT em FROM Employee em");
- q.setHint(QueryHints.BATCH, "em.managedEmployees");
-
- List<Employee> ems = q.getResultList();
-
- BatchInConfig.config(em, ems, "managedEmployees");
- FetchPlan fp = new FetchPlan(Employee.class);
- fp.addAttribute("managedEmployees");
- JpaFetchPlanHelper.fetch(em, fp, ems);
-
- // Employee deserializedEmployee =
- // (Employee)SerializationHelper.clone(ems.get(0));
- // Hier clone statt copy führt im merge zu
- // anderem Ergebnis.
- Employee deserializedEmployee = JpaFetchPlanHelper.copy(em, new FetchPlan(Employee.class), ems.get(0));
- em.getTransaction().commit();
- closeEMF();
- super.cleanupClosedEMF();
- em = getEntityManager();
- System.out.println(deserializedEmployee.getAddress());// Would throw
- // exception,
- // because
- // relation not instantiated. But only on clone object. On copied
- // object, null is returned.
- em.getTransaction().begin();
- deserializedEmployee.setFirstName(deserializedEmployee.getFirstName() + "x");
- Employee mergedEmployee = getEntityManager().merge(deserializedEmployee);
- Address address = mergedEmployee.getAddress();
- System.out.println(mergedEmployee.getAddress());
-
- em.getTransaction().commit();
- }
-
- @After
- public void clearCache() {
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- @Override
- protected void verifyConfig(EntityManager em) {
- super.verifyConfig(em);
- FetchPlanAssert.verifyEmployeeConfig(getEMF());
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/batchin/BatchInTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/batchin/BatchInTests.java
deleted file mode 100644
index 3e0f119..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/batchin/BatchInTests.java
+++ /dev/null
@@ -1,375 +0,0 @@
-package test.batchin;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-
-import static org.junit.Assert.*;
-import model.Employee;
-import model.Gender;
-
-import org.eclipse.persistence.config.HintValues;
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.extension.query.BatchInConfig;
-import org.eclipse.persistence.indirection.IndirectContainer;
-import org.eclipse.persistence.indirection.ValueHolder;
-import org.eclipse.persistence.internal.indirection.BatchValueHolder;
-import org.eclipse.persistence.internal.indirection.QueryBasedValueHolder;
-import org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-import org.eclipse.persistence.mappings.OneToOneMapping;
-import org.junit.Before;
-import org.junit.Test;
-
-import testing.EclipseLinkJPAAssert;
-import testing.EclipseLinkJPATest;
-
-@SuppressWarnings("unchecked")
-@PersistenceContext(unitName = "employee")
-public class BatchInTests extends EclipseLinkJPATest {
-
- @Test
- public void findAllEmployeesBatchJoinAddress() {
- EntityManager em = getEntityManager();
-
- Query q = em.createQuery("SELECT e FROM Employee e");
- q.setHint(QueryHints.BATCH, "e.address");
-
- List<Employee> emps = q.getResultList();
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNotNull(emps);
- assertFalse(emps.isEmpty());
-
- Employee emp1 = emps.get(0);
- ClassDescriptor desc = JpaHelper.getServerSession(getEMF()).getClassDescriptor(emp1);
- OneToOneMapping addressMapping = (OneToOneMapping) desc.getMappingForAttributeName("address");
- UnitOfWorkValueHolder uowvh = (UnitOfWorkValueHolder) addressMapping.getAttributeValueFromObject(emp1);
- assertTrue(uowvh.getWrappedValueHolder() instanceof BatchValueHolder);
-
- emp1.getAddress();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertNotNull(emp.getAddress());
- }
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void findAllEmployeesBatchInAddress() {
- EntityManager em = getEntityManager();
-
- Query q = em.createQuery("SELECT e FROM Employee e");
- q.setHint(QueryHints.BATCH, "e.address");
-
- List<Employee> emps = q.getResultList();
-
- BatchInConfig.config(em, emps, "address");
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNotNull(emps);
- assertFalse(emps.isEmpty());
-
- Employee emp1 = emps.get(0);
- ClassDescriptor desc = JpaHelper.getServerSession(getEMF()).getClassDescriptor(emp1);
- OneToOneMapping addressMapping = (OneToOneMapping) desc.getMappingForAttributeName("address");
- UnitOfWorkValueHolder uowvh = (UnitOfWorkValueHolder) addressMapping.getAttributeValueFromObject(emp1);
- assertTrue(uowvh.getWrappedValueHolder() instanceof BatchValueHolder);
-
- emp1.getAddress();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertNotNull(emp.getAddress());
- }
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void findMaleEmployeesBatchJoinAddress() {
- EntityManager em = getEntityManager();
-
- Query q = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- q.setParameter("GENDER", Gender.Male);
- q.setHint(QueryHints.BATCH, "e.address");
-
- List<Employee> emps = q.getResultList();
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNotNull(emps);
- assertFalse(emps.isEmpty());
-
- Employee emp1 = emps.get(0);
- ClassDescriptor desc = JpaHelper.getServerSession(getEMF()).getClassDescriptor(emp1);
- OneToOneMapping addressMapping = (OneToOneMapping) desc.getMappingForAttributeName("address");
- UnitOfWorkValueHolder uowvh = (UnitOfWorkValueHolder) addressMapping.getAttributeValueFromObject(emp1);
- assertTrue(uowvh.getWrappedValueHolder() instanceof BatchValueHolder);
-
- emp1.getAddress();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertNotNull(emp.getAddress());
- }
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void findMaleEmployeesBatchInAddress() {
- EntityManager em = getEntityManager();
-
- Query q = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- q.setParameter("GENDER", Gender.Male);
- q.setHint(QueryHints.BATCH, "e.address");
-
- List<Employee> emps = q.getResultList();
-
- BatchInConfig.config(em, emps, "address");
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNotNull(emps);
- assertFalse(emps.isEmpty());
-
- Employee emp1 = emps.get(0);
- ClassDescriptor desc = JpaHelper.getServerSession(getEMF()).getClassDescriptor(emp1);
- OneToOneMapping addressMapping = (OneToOneMapping) desc.getMappingForAttributeName("address");
- UnitOfWorkValueHolder uowvh = (UnitOfWorkValueHolder) addressMapping.getAttributeValueFromObject(emp1);
- assertTrue(uowvh.getWrappedValueHolder() instanceof BatchValueHolder);
-
- emp1.getAddress();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertNotNull(emp.getAddress());
- }
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void findAllEmployeesBatchJoinPhones() {
- EntityManager em = getEntityManager();
-
- Query q = em.createQuery("SELECT e FROM Employee e");
- q.setHint(QueryHints.BATCH, "e.phoneNumbers");
-
- List<Employee> emps = q.getResultList();
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNotNull(emps);
- assertFalse(emps.isEmpty());
-
- Employee emp1 = emps.get(0);
- ClassDescriptor desc = JpaHelper.getServerSession(getEMF()).getClassDescriptor(emp1);
- OneToManyMapping phoneMapping = (OneToManyMapping) desc.getMappingForAttributeName("phoneNumbers");
- IndirectContainer phonesContainer = (IndirectContainer) phoneMapping.getAttributeValueFromObject(emp1);
- UnitOfWorkValueHolder uowvh = (UnitOfWorkValueHolder) phonesContainer.getValueHolder();
- assertTrue(uowvh.getWrappedValueHolder() instanceof BatchValueHolder);
-
- emp1.getPhoneNumbers().size();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertFalse(emp.getPhoneNumbers().isEmpty());
- }
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void findAllEmployeesBatchInPhones() {
- EntityManager em = getEntityManager();
-
- Query q = em.createQuery("SELECT e FROM Employee e");
- q.setHint(QueryHints.BATCH, "e.phoneNumbers");
-
- List<Employee> emps = q.getResultList();
-
- BatchInConfig.config(em, emps, "phoneNumbers");
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNotNull(emps);
- assertFalse(emps.isEmpty());
-
- Employee emp1 = emps.get(0);
- ClassDescriptor desc = JpaHelper.getServerSession(getEMF()).getClassDescriptor(emp1);
- OneToManyMapping phoneMapping = (OneToManyMapping) desc.getMappingForAttributeName("phoneNumbers");
- IndirectContainer phonesContainer = (IndirectContainer) phoneMapping.getAttributeValueFromObject(emp1);
- UnitOfWorkValueHolder uowvh = (UnitOfWorkValueHolder) phonesContainer.getValueHolder();
- assertTrue(uowvh.getWrappedValueHolder() instanceof BatchValueHolder);
-
- emp1.getPhoneNumbers().size();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertFalse(emp.getPhoneNumbers().isEmpty());
- }
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void findMaleEmployeesBatchJoinPhones() {
- EntityManager em = getEntityManager();
-
- Query q = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- q.setParameter("GENDER", Gender.Male);
- q.setHint(QueryHints.BATCH, "e.phoneNumbers");
-
- List<Employee> emps = q.getResultList();
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNotNull(emps);
- assertFalse(emps.isEmpty());
-
- Employee emp1 = emps.get(0);
- ClassDescriptor desc = JpaHelper.getServerSession(getEMF()).getClassDescriptor(emp1);
- OneToManyMapping phoneMapping = (OneToManyMapping) desc.getMappingForAttributeName("phoneNumbers");
- IndirectContainer phonesContainer = (IndirectContainer) phoneMapping.getAttributeValueFromObject(emp1);
- UnitOfWorkValueHolder uowvh = (UnitOfWorkValueHolder) phonesContainer.getValueHolder();
- assertTrue(uowvh.getWrappedValueHolder() instanceof BatchValueHolder);
-
- emp1.getPhoneNumbers().size();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertFalse(emp.getPhoneNumbers().isEmpty());
- }
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void findMaleEmployeesBatchInPhones() {
- EntityManager em = getEntityManager();
-
- Query q = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- q.setParameter("GENDER", Gender.Male);
- q.setHint(QueryHints.BATCH, "e.phoneNumbers");
-
- List<Employee> emps = q.getResultList();
-
- BatchInConfig.config(em, emps, "phoneNumbers");
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNotNull(emps);
- assertFalse(emps.isEmpty());
-
- Employee emp1 = emps.get(0);
- ClassDescriptor desc = JpaHelper.getServerSession(getEMF()).getClassDescriptor(emp1);
- OneToManyMapping phoneMapping = (OneToManyMapping) desc.getMappingForAttributeName("phoneNumbers");
- IndirectContainer phonesContainer = (IndirectContainer) phoneMapping.getAttributeValueFromObject(emp1);
- UnitOfWorkValueHolder uowvh = (UnitOfWorkValueHolder) phonesContainer.getValueHolder();
- assertTrue(uowvh.getWrappedValueHolder() instanceof BatchValueHolder);
-
- emp1.getPhoneNumbers().size();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertFalse(emp.getPhoneNumbers().isEmpty());
- }
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- /**
- * Test that batch reading where entities are already in memory works
- */
- @Test
- public void verifyBatchingOnReadEntities() {
- OneToOneMapping addrMapping = (OneToOneMapping) getDescriptor("Employee").getMappingForAttributeName("address");
- OneToManyMapping phonesMapping = (OneToManyMapping) getDescriptor("Employee").getMappingForAttributeName("phoneNumbers");
- OneToOneMapping managerMapping = (OneToOneMapping) getDescriptor("Employee").getMappingForAttributeName("manager");
- OneToManyMapping managedEmpsMapping = (OneToManyMapping) getDescriptor("Employee").getMappingForAttributeName("managedEmployees");
-
- EntityManager em = getEntityManager();
-
- List<Employee> allEmps = em.createQuery("SELECT e FROM Employee e").getResultList();
-
- // Verify that just a UOW
- for (Employee emp : allEmps) {
- assertQueryBasedValueHolder(addrMapping.getAttributeValueFromObject(emp));
- assertQueryBasedValueHolder(phonesMapping.getAttributeValueFromObject(emp));
- assertQueryBasedValueHolder(managerMapping.getAttributeValueFromObject(emp));
- assertQueryBasedValueHolder(managedEmpsMapping.getAttributeValueFromObject(emp));
- }
-
- Query query = em.createQuery("SELECT e FROM Employee e");
- query.setHint(QueryHints.BATCH, "e.address");
- query.setHint(QueryHints.BATCH, "e.phoneNumbers");
- query.setHint(QueryHints.BATCH, "e.manager");
- query.setHint(QueryHints.BATCH, "e.managedEmployees");
-
- // Currently the Batch ValueHolders are only added when the cahe is clear
- em.clear();
- allEmps = query.getResultList();
-
- // Verify that just a UOW
- for (Employee emp : allEmps) {
- assertBatchValueHolder(addrMapping.getAttributeValueFromObject(emp));
- assertBatchValueHolder(phonesMapping.getAttributeValueFromObject(emp));
- assertBatchValueHolder(managerMapping.getAttributeValueFromObject(emp));
- assertBatchValueHolder(managedEmpsMapping.getAttributeValueFromObject(emp));
- }
- }
-
- @Before
- public void clearCache() {
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- @Override
- protected void verifyConfig(EntityManager em) {
- super.verifyConfig(em);
-
- ClassDescriptor employeeDescriptor = EclipseLinkJPAAssert.assertEntity(getEMF(), "Employee");
- EclipseLinkJPAAssert.assertWoven(employeeDescriptor);
- EclipseLinkJPAAssert.assertLazy(employeeDescriptor, "address");
- EclipseLinkJPAAssert.assertLazy(employeeDescriptor, "phoneNumbers");
- EclipseLinkJPAAssert.assertLazy(employeeDescriptor, "manager");
- EclipseLinkJPAAssert.assertLazy(employeeDescriptor, "managedEmployees");
- }
-
- private void assertQueryBasedValueHolder(Object value) {
- assertNotNull(value);
-
- Object proxy = value;
-
- if (proxy instanceof IndirectContainer) {
- proxy = ((IndirectContainer) proxy).getValueHolder();
- }
-
- if (proxy instanceof UnitOfWorkValueHolder) {
- proxy = ((UnitOfWorkValueHolder) proxy).getWrappedValueHolder();
- }
- if (proxy.getClass() != ValueHolder.class) {
- assertEquals(QueryBasedValueHolder.class, proxy.getClass());
- }
- }
-
- private void assertBatchValueHolder(Object value) {
- assertNotNull(value);
-
- Object proxy = value;
-
- if (proxy instanceof IndirectContainer) {
- proxy = ((IndirectContainer) proxy).getValueHolder();
- }
-
- if (proxy instanceof UnitOfWorkValueHolder) {
- proxy = ((UnitOfWorkValueHolder) proxy).getWrappedValueHolder();
- }
-
- if (proxy.getClass() != ValueHolder.class) {
- assertEquals(BatchValueHolder.class, proxy.getClass());
- }
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/AllTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/AllTests.java
deleted file mode 100644
index 41f0435..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/AllTests.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: Extensions Incubator - FetchPlan
- ******************************************************************************/
-package test.fetchplan;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { FetchPlanAPITests.class,
- FetchPlanExamplesTests.class,
- ReadObjectFetchPlanTests.class,
- CompositeResultsFetchTests.class,
- FetchPlanCopyTests.class,
- FetchPlanMergeTests.class,
- DetachedResultsTests.class,
- SerializedResultsTests.class,
- DefaultFetchPlanTests.class,
- TestOTTO.class})
-public class AllTests {
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/CompositeResultsFetchTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/CompositeResultsFetchTests.java
deleted file mode 100644
index 99aaf54..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/CompositeResultsFetchTests.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: Extensions Incubator - FetchPlan
- ******************************************************************************/
-package test.fetchplan;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-
-import model.Employee;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.extension.fetchplan.FetchPlan;
-import org.eclipse.persistence.extension.fetchplan.JpaFetchPlanHelper;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.junit.After;
-import org.junit.Test;
-
-import testing.EclipseLinkJPAAssert;
-import testing.EclipseLinkJPATest;
-
-@SuppressWarnings("unchecked")
-@PersistenceContext(unitName = "employee")
-public class CompositeResultsFetchTests extends EclipseLinkJPATest {
-
- @Test
- public void employeeManagerPhonesAndAddressByIndex() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e, e.address FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("manager.address");
- fetchPlan.addAttribute("manager.phoneNumbers");
-
- List<Object[]> emps = query.getResultList();
-
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps, 0);
- }
-
- @Test
- public void employeeManagerPhonesAndAddress() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e, e.address FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("manager.address");
- fetchPlan.addAttribute("manager.phoneNumbers");
-
- List<Object[]> results = query.getResultList();
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- JpaFetchPlanHelper.fetch(em, fetchPlan, results, 0);
-
- getQuerySQLTracker(em).reset();
-
- FetchPlanAssert.assertFetched(fetchPlan, results, 0);
-
- for (Object[] values : results) {
- Employee e = (Employee) values[0];
- if (e.getManager() != null) {
- e.getManager().getAddress();
- e.getManager().getPhoneNumbers().size();
- }
- }
-
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void employeeManager_FetchEmployeeManagerAddressAndPhones() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e, e.manager FROM Employee e");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("manager.address");
- fetchPlan.addAttribute("phoneNumbers");
-
- List<Object[]> results = query.getResultList();
-
- JpaFetchPlanHelper.fetch(em, fetchPlan, results, 0);
-
- FetchPlanAssert.assertFetched(fetchPlan, results, 0);
- }
-
- @Test
- public void employeeCountPhones_FetchManageraddressAndPhones() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e, COUNT(e.phoneNumbers) FROM Employee e GROUP BY e");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("manager.address");
- fetchPlan.addAttribute("phoneNumbers");
-
- List<Object[]> results = query.getResultList();
-
- JpaFetchPlanHelper.fetch(em, fetchPlan, results, 0);
-
- FetchPlanAssert.assertFetched(fetchPlan, results, 0);
- }
-
- @Test
- public void employeeWithId_FetchingManagerPhonesAndAddress() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e.id, e FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("manager.address");
- fetchPlan.addAttribute("manager.phoneNumbers");
-
- List<Object[]> results = query.getResultList();
-
- JpaFetchPlanHelper.fetch(em, fetchPlan, results, 1);
-
- FetchPlanAssert.assertFetched(fetchPlan, results, 1);
- }
-
- @Test
- public void employeeManager_FetchingManagerPhonesAndAddress() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e.manager FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("manager.address");
- fetchPlan.addAttribute("manager.phoneNumbers");
-
- List<Object[]> results = query.getResultList();
-
- JpaFetchPlanHelper.fetch(em, fetchPlan, results);
-
- FetchPlanAssert.assertFetched(fetchPlan, results);
- }
-
- @After
- public void clearCache() {
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- @Override
- protected void verifyConfig(EntityManager em) {
- super.verifyConfig(em);
- FetchPlanAssert.verifyEmployeeConfig(getEMF());
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/DefaultFetchPlanTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/DefaultFetchPlanTests.java
deleted file mode 100644
index c7f0539..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/DefaultFetchPlanTests.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: Extensions Incubator - FetchPlan
- ******************************************************************************/
-package test.fetchplan;
-
-import static org.junit.Assert.*;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import model.Employee;
-import model.LargeProject;
-import model.PhoneNumber;
-import model.Project;
-import model.SmallProject;
-
-import org.eclipse.persistence.extension.fetchplan.FetchPlan;
-import org.eclipse.persistence.extension.fetchplan.JpaFetchPlanHelper;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.junit.After;
-import org.junit.Test;
-
-import testing.EclipseLinkJPAAssert;
-import testing.EclipseLinkJPATest;
-
-/**
- * Tests that verify the {@link JpaFetchPlanHelper} API around the creation of
- * FetchPlan instances based on the mappings and FetchGroups associated with an
- * entity type's descriptor.
- *
- * @author dclarke
- * @since EclispeLink 1.2
- */
-@PersistenceContext(unitName = "employee")
-public class DefaultFetchPlanTests extends EclipseLinkJPATest {
-
- @Test
- public void defaultFetchPlan_Employee() {
- FetchPlan fp = new FetchPlan(Employee.class);
-
- JpaFetchPlanHelper.addDefaultFetchAttributes(getEMF(), fp);
-
- assertEquals(9, fp.getFetchItems().size());
- assertTrue(fp.containsAttribute("id"));
- assertTrue(fp.containsAttribute("version"));
- assertTrue(fp.containsAttribute("firstName"));
- assertTrue(fp.containsAttribute("lastName"));
- assertTrue(fp.containsAttribute("gender"));
- assertTrue(fp.containsAttribute("startTime"));
- assertTrue(fp.containsAttribute("endTime"));
- assertTrue(fp.containsAttribute("salary"));
- assertTrue(fp.containsAttribute("period"));
- assertFalse(fp.containsAttribute("address"));
- assertFalse(fp.containsAttribute("phoneNumbers"));
- assertFalse(fp.containsAttribute("projects"));
- assertFalse(fp.containsAttribute("responsibilities"));
- }
-
- @Test
- public void defaultFetchPlan_SmallProject() {
- FetchPlan fp = new FetchPlan(SmallProject.class);
-
- JpaFetchPlanHelper.addDefaultFetchAttributes(getEMF(), fp);
-
- assertEquals(4, fp.getFetchItems().size());
- assertTrue(fp.containsAttribute("id"));
- assertTrue(fp.containsAttribute("name"));
- assertTrue(fp.containsAttribute("description"));
- assertTrue(fp.containsAttribute("version"));
- assertFalse(fp.containsAttribute("teamLeader"));
- }
-
- @Test
- public void defaultFetchPlan_LargeProject() {
- FetchPlan fp = new FetchPlan(LargeProject.class);
-
- JpaFetchPlanHelper.addDefaultFetchAttributes(getEMF(), fp);
-
- assertEquals(6, fp.getFetchItems().size());
- assertTrue(fp.containsAttribute("id"));
- assertTrue(fp.containsAttribute("name"));
- assertTrue(fp.containsAttribute("description"));
- assertTrue(fp.containsAttribute("version"));
- assertFalse(fp.containsAttribute("teamLeader"));
- assertTrue(fp.containsAttribute("budget"));
- assertTrue(fp.containsAttribute("milestone"));
- }
-
- @Test
- public void defaultFetchPlan_Project() {
- FetchPlan fp = new FetchPlan(Project.class);
-
- JpaFetchPlanHelper.addDefaultFetchAttributes(getEMF(), fp);
-
- assertEquals(4, fp.getFetchItems().size());
- assertTrue(fp.containsAttribute("id"));
- assertTrue(fp.containsAttribute("name"));
- assertTrue(fp.containsAttribute("description"));
- assertTrue(fp.containsAttribute("version"));
- assertFalse(fp.containsAttribute("teamLeader"));
- }
-
- @Test
- public void requireAttributesFetchPlan_PhoneNumber() {
- FetchPlan fp = new FetchPlan(PhoneNumber.class);
-
- fp.initialize(JpaHelper.getServerSession(getEMF()));
-
- assertEquals(2, fp.getFetchItems().size());
- assertTrue(fp.containsAttribute("type"));
- assertTrue(fp.containsAttribute("owner"));
- assertFalse(fp.containsAttribute("number"));
- assertFalse(fp.containsAttribute("areaCode"));
- }
-
- @After
- public void clearCache() {
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- @Override
- protected void verifyConfig(EntityManager em) {
- super.verifyConfig(em);
-
- EclipseLinkJPAAssert.assertWoven(getDescriptor("Employee"));
- FetchPlanAssert.verifyEmployeeConfig(getEMF());
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/DetachedResultsTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/DetachedResultsTests.java
deleted file mode 100644
index 3321695..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/DetachedResultsTests.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - FetchPlan Extension incubator
- ******************************************************************************/
-package test.fetchplan;
-
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-
-import junit.framework.Assert;
-import model.Employee;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.extension.fetchplan.FetchPlan;
-import org.eclipse.persistence.extension.fetchplan.JpaFetchPlanHelper;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.eclipse.persistence.queries.ReadAllQuery;
-import org.junit.After;
-import org.junit.Test;
-
-import testing.EclipseLinkJPAAssert;
-import testing.EclipseLinkJPATest;
-
-/**
- * Tests to verify that {@link FetchPlan} produced results can be dettached as
- * expected and later merged into other transactions in the same and different
- * {@link EntityManager} instances.
- *
- * @author dclarke
- * @since EclipseLink 2.0
- */
-@SuppressWarnings("unchecked")
-@PersistenceContext(unitName = "employee")
-public class DetachedResultsTests extends EclipseLinkJPATest {
-
- @Test
- public void employeeAddressPhones() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("id");
- fetchPlan.addAttribute("firstName");
- fetchPlan.addAttribute("lastName");
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- List<Employee> emps = query.getResultList();
-
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
- FetchPlanAssert.assertFetched(fetchPlan, emps);
-
- List<Employee> detachedEmps = new ArrayList<Employee>(emps.size());
- for (Employee emp : emps) {
- detachedEmps.add(JpaFetchPlanHelper.copy(em, fetchPlan, emp));
- }
-
- FetchPlanAssert.assertFetched(fetchPlan, detachedEmps);
- }
-
- @Test
- public void employeeAddressPhones_Batching() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- query.setHint(QueryHints.BATCH, "e.address");
- query.setHint(QueryHints.BATCH, "e.phoneNumbers");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
-
- List<Employee> detachedEmps = new ArrayList<Employee>(emps.size());
- for (Employee emp : emps) {
- detachedEmps.add(JpaFetchPlanHelper.copy(em, fetchPlan, emp));
- }
-
- FetchPlanAssert.assertFetched(fetchPlan, detachedEmps);
- }
-
- @Test
- public void employeeAddressPhones_Joining() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- query.setHint(QueryHints.FETCH, "e.address");
- query.setHint(QueryHints.FETCH, "e.phoneNumbers");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
-
- List<Employee> detachedEmps = new ArrayList<Employee>(emps.size());
- for (Employee emp : emps) {
- detachedEmps.add(JpaFetchPlanHelper.copy(em, fetchPlan, emp));
- }
-
- FetchPlanAssert.assertFetched(fetchPlan, detachedEmps);
- }
-
- @Test
- public void managerAddressPhones() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("manager.address");
- fetchPlan.addAttribute("manager.phoneNumbers");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
-
- List<Employee> detachedEmps = new ArrayList<Employee>(emps.size());
- for (Employee emp : emps) {
- detachedEmps.add(JpaFetchPlanHelper.copy(em, fetchPlan, emp));
- }
-
- FetchPlanAssert.assertFetched(fetchPlan, detachedEmps);
- }
-
- @Test
- public void responsibilities() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("responsibilities");
-
- List<Employee> emps = query.getResultList();
-
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
-
- List<Employee> detachedEmps = new ArrayList<Employee>(emps.size());
- for (Employee emp : emps) {
- detachedEmps.add(JpaFetchPlanHelper.copy(em, fetchPlan, emp));
- }
-
- FetchPlanAssert.assertFetched(fetchPlan, detachedEmps);
- }
-
- @Test
- public void responsibilitiesBatch() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
- query.setHint(QueryHints.BATCH, "e.responsibilities");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("responsibilities");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
-
- List<Employee> detachedEmps = new ArrayList<Employee>(emps.size());
- for (Employee emp : emps) {
- detachedEmps.add(JpaFetchPlanHelper.copy(em, fetchPlan, emp));
- }
-
- FetchPlanAssert.assertFetched(fetchPlan, detachedEmps);
- }
-
- @Test
- public void managedEmployeesAddress() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("managedEmployees.address");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
-
- List<Employee> detachedEmps = new ArrayList<Employee>(emps.size());
- for (Employee emp : emps) {
- detachedEmps.add(JpaFetchPlanHelper.copy(em, fetchPlan, emp));
- }
-
- FetchPlanAssert.assertFetched(fetchPlan, detachedEmps);
- }
-
- @Test
- public void readAllEmployee() throws Exception {
- EntityManager em = getEntityManager();
-
- ReadAllQuery raq = new ReadAllQuery(Employee.class);
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- Query query = JpaHelper.createQuery(raq, em);
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
-
- List<Employee> detachedEmps = new ArrayList<Employee>(emps.size());
- for (Employee emp : emps) {
- detachedEmps.add(JpaFetchPlanHelper.copy(em, fetchPlan, emp));
- }
-
- FetchPlanAssert.assertFetched(fetchPlan, detachedEmps);
- }
-
- @Test
- public void employeeAddress_Batching() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e");
-
- query.setHint(QueryHints.BATCH, "e.address");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("address");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- Assert.assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- FetchPlanAssert.assertFetched(fetchPlan, emps);
- Assert.assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- EclipseLinkJPAAssert.assertLoaded(getEMF(), emp, "address");
- EclipseLinkJPAAssert.assertNotLoaded(getEMF(), emp, "phoneNumbers");
- EclipseLinkJPAAssert.assertNotLoaded(getEMF(), emp, "manager");
- EclipseLinkJPAAssert.assertNotLoaded(getEMF(), emp, "projects");
-
- // Assumption that all employees have an address
- Assert.assertNotNull(emp.getAddress());
- }
-
- List<Employee> detachedEmps = new ArrayList<Employee>(emps.size());
- for (Employee emp : emps) {
- detachedEmps.add(JpaFetchPlanHelper.copy(em, fetchPlan, emp));
- }
-
- for (Employee emp : detachedEmps) {
- EclipseLinkJPAAssert.assertLoaded(getEMF(), emp, "address");
- EclipseLinkJPAAssert.assertNotLoaded(getEMF(), emp, "phoneNumbers");
- EclipseLinkJPAAssert.assertNotLoaded(getEMF(), emp, "manager");
- EclipseLinkJPAAssert.assertNotLoaded(getEMF(), emp, "projects");
-
- // Assumption that all employees have an address
- Assert.assertNotNull(emp.getAddress());
- }
-
- Assert.assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @After
- public void clearCache() {
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- @Override
- protected void verifyConfig(EntityManager em) {
- super.verifyConfig(em);
- FetchPlanAssert.verifyEmployeeConfig(getEMF());
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanAPITests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanAPITests.java
deleted file mode 100644
index e46f878..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanAPITests.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: Fetch Plan Extension Incubator
- ******************************************************************************/
-package test.fetchplan;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceContext;
-
-import model.Employee;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.extension.fetchplan.FetchItem;
-import org.eclipse.persistence.extension.fetchplan.FetchPlan;
-import org.eclipse.persistence.extension.fetchplan.JpaFetchPlanHelper;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.junit.Test;
-
-import testing.EclipseLinkJPATest;
-
-/**
- * Basic set of test verifying that the FetchPlan public API performs as
- * expected. No persistence related validation or usage is performed.
- *
- * @author dclarke
- * @since EclipseLink 1.2
- */
-@PersistenceContext(unitName = "employee")
-public class FetchPlanAPITests extends EclipseLinkJPATest {
-
- @Test
- public void verifyConstructor_nullEntityClass() {
- FetchPlan plan = new FetchPlan(null);
- assertNull(plan.getEntityClass());
-
- try {
- plan.initialize(null);
- } catch (IllegalStateException ise) {
- return;
- }
- fail("IllegalStateException expected on initialize with null entityClass");
- }
-
- @Test
- public void verifyConstructor_withEntityClass() {
- FetchPlan plan = new FetchPlan(Employee.class);
- assertEquals(Employee.class, plan.getEntityClass());
- assertTrue(plan.getFetchItems().isEmpty());
-
- // With a valid entity class and null session initialize should throw an
- // NPE
- try {
- plan.initialize(null);
- } catch (NullPointerException npe) {
- return;
- }
- fail("NullPointerException expected on initialize with null session");
- }
-
- @Test
- public void verifyGetFetchItems_add() {
- FetchPlan plan = new FetchPlan(Employee.class);
- assertTrue(plan.getFetchItems().isEmpty());
-
- // With a valid entity class and null session initialize should throw an
- // NPE
- try {
- plan.getFetchItems().add(null);
- } catch (UnsupportedOperationException npe) {
- return;
- }
- fail("UnsupportedOperationException expected on Fetchplan.getFetchItems().add()");
- }
-
- @Test
- public void verifyAddAttribute_nullString() {
- FetchPlan plan = new FetchPlan(Employee.class);
- assertTrue(plan.getFetchItems().isEmpty());
-
- // With a valid entity class and null session initialize should throw an
- // NPE
- try {
- plan.addAttribute((String) null);
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected");
- }
-
- @Test
- public void verifyAddAttribute_nullStringArray() {
- FetchPlan plan = new FetchPlan(Employee.class);
- assertTrue(plan.getFetchItems().isEmpty());
-
- // With a valid entity class and null session initialize should throw an
- // NPE
- try {
- plan.addAttribute((String[]) null);
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected");
- }
-
- @Test
- public void verifyAddAttribute_emptyString() {
- FetchPlan plan = new FetchPlan(Employee.class);
- assertTrue(plan.getFetchItems().isEmpty());
-
- // With a valid entity class and null session initialize should throw an
- // NPE
- try {
- plan.addAttribute("");
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected");
- }
-
- @Test
- public void verifyAddAttribute_period() {
- FetchPlan plan = new FetchPlan(Employee.class);
- assertTrue(plan.getFetchItems().isEmpty());
-
- // With a valid entity class and null session initialize should throw an
- // NPE
- try {
- plan.addAttribute(".");
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected");
- }
-
- @Test
- public void verifyAddAttribute_EndWithPeriod() {
- FetchPlan plan = new FetchPlan(Employee.class);
- assertTrue(plan.getFetchItems().isEmpty());
-
- // With a valid entity class and null session initialize should throw an
- // NPE
- try {
- plan.addAttribute("test.");
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected");
- }
-
- @Test
- public void verifyAddAttribute_StartWithPeriod() {
- FetchPlan plan = new FetchPlan(Employee.class);
- assertTrue(plan.getFetchItems().isEmpty());
-
- // With a valid entity class and null session initialize should throw an
- // NPE
- try {
- plan.addAttribute(".test");
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected");
- }
-
- @Test
- public void verifyAddAttribute_StartAndEndWithPeriod() {
- FetchPlan plan = new FetchPlan(Employee.class);
- assertTrue(plan.getFetchItems().isEmpty());
-
- // With a valid entity class and null session initialize should throw an
- // NPE
- try {
- plan.addAttribute(".test.");
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected");
- }
-
- @Test
- public void verifyAddAttribute_space() {
- FetchPlan plan = new FetchPlan(Employee.class);
- assertTrue(plan.getFetchItems().isEmpty());
-
- // With a valid entity class and null session initialize should throw an
- // NPE
- try {
- plan.addAttribute(" ");
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected");
- }
-
- @Test
- public void verifyAddAttribute_basic() {
- FetchPlan plan = new FetchPlan(Employee.class);
- assertTrue(plan.getFetchItems().isEmpty());
-
- plan.addAttribute("attribute");
-
- assertFalse(plan.getFetchItems().isEmpty());
- assertEquals(1, plan.getFetchItems().size());
-
- FetchItem item = (FetchItem) plan.getFetchItems().toArray()[0];
-
- assertEquals("attribute", item.getName());
- assertNull(item.getFetchPlan());
- assertSame(plan, item.getParent());
- }
-
- @Test
- public void verifyAddAttribute_nested() {
- FetchPlan plan = new FetchPlan(Employee.class);
- assertTrue(plan.getFetchItems().isEmpty());
-
- plan.addAttribute("attribute");
-
- assertFalse(plan.getFetchItems().isEmpty());
- assertEquals(1, plan.getFetchItems().size());
-
- FetchItem item = (FetchItem) plan.getFetchItems().toArray()[0];
-
- assertEquals("attribute", item.getName());
- assertNull(item.getFetchPlan());
- assertSame(plan, item.getParent());
-
- plan.addAttribute("attribute.attribute2");
-
- assertEquals(1, plan.getFetchItems().size());
- assertNotNull(item.getFetchPlan());
-
- FetchItem item2 = (FetchItem) item.getFetchPlan().getFetchItems().toArray()[0];
-
- assertEquals("attribute2", item2.getName());
- assertNull(item2.getFetchPlan());
- assertSame(item.getFetchPlan(), item2.getParent());
- }
-
- @Test
- public void verifyContains_nullString() {
- FetchPlan fp = new FetchPlan(Employee.class);
-
- try {
- fp.containsAttribute((String) null);
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected.");
- }
-
- @Test
- public void verifyContains_nullStringArray() {
- FetchPlan fp = new FetchPlan(Employee.class);
-
- try {
- fp.containsAttribute((String[]) null);
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected.");
- }
-
- @Test
- public void verifyContains_emptyString() {
- FetchPlan fp = new FetchPlan(Employee.class);
-
- try {
- fp.containsAttribute("");
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected.");
- }
-
- @Test
- public void verifyContains_emptyStringArray() {
- FetchPlan fp = new FetchPlan(Employee.class);
-
- try {
- fp.containsAttribute(new String[0]);
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected.");
- }
-
- @Test
- public void verifyContains_dot() {
- FetchPlan fp = new FetchPlan(Employee.class);
-
- try {
- fp.containsAttribute(".");
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected.");
- }
-
- @Test
- public void verifyContains_nonExistent() {
- FetchPlan fp = new FetchPlan(Employee.class);
-
- assertTrue(fp.getFetchItems().isEmpty());
- assertFalse(fp.containsAttribute("test"));
-
- assertFalse(fp.containsAttribute("test.test"));
- assertTrue(fp.getFetchItems().isEmpty());
- }
-
- @Test
- public void verifyCreateFetchGroup_empty() {
- FetchPlan fp = new FetchPlan("empty", Employee.class);
-
- FetchGroup fg = fp.createFetchGroup();
-
- assertNotNull(fg);
- assertTrue(fg.getAttributes().isEmpty());
- assertEquals("FetchPlan(empty)_fetch-group", fg.getName());
- }
-
- @Test
- public void verifyCopy_null_null() {
- FetchPlan fp = new FetchPlan(Employee.class);
-
- try {
- fp.copy(null, null);
- } catch (NullPointerException e) {
- return;
- }
- fail("NullPointerException expected");
- }
-
- @Test
- public void verifyFetch_null_null() {
- FetchPlan fp = new FetchPlan(Employee.class);
-
- try {
- fp.fetch(null, null);
- } catch (NullPointerException e) {
- return;
- }
- fail("NullPointerException expected");
- }
-
- @Test
- public void verifyFetch_null_0_null() {
- FetchPlan fp = new FetchPlan(Employee.class);
-
- try {
- fp.fetch(null, 0, null);
- } catch (NullPointerException e) {
- return;
- }
- fail("NullPointerException expected");
-
- }
-
- @Test
- public void jpaFetchGroupHelper_addDefaultFetchGroup_nullEM_null() {
- try {
- JpaFetchPlanHelper.addDefaultFetchAttributes((EntityManager) null, null);
- } catch (NullPointerException e) {
- return;
- }
- fail("NullPointerException expected");
- }
-
- @Test
- public void jpaFetchGroupHelper_addDefaultFetchGroup_nullEMF_null() {
- try {
- JpaFetchPlanHelper.addDefaultFetchAttributes((EntityManagerFactory) null, null);
- } catch (NullPointerException e) {
- return;
- }
- fail("NullPointerException expected");
- }
-
- @Test
- public void jpaFetchGroupHelper_addDefaultFetchGroup_EM_null() {
- try {
- JpaFetchPlanHelper.addDefaultFetchAttributes(getEntityManager(), null);
- } catch (NullPointerException e) {
- return;
- }
- fail("NullPointerException expected");
- }
-
- @Test
- public void jpaFetchGroupHelper_addDefaultFetchGroup_NoEntityClass() {
- FetchPlan fp = new FetchPlan(null);
-
- try {
- JpaFetchPlanHelper.addDefaultFetchAttributes(getEntityManager(), fp);
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected");
- }
-
- @Test
- public void jpaFetchGroupHelper_addDefaultFetchGroup_UnknownEntityClass() {
- FetchPlan fp = new FetchPlan(Object.class);
-
- try {
- JpaFetchPlanHelper.addDefaultFetchAttributes(getEntityManager(), fp);
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected");
- }
-
- @Test
- public void jpaFetchGroupHelper_addNamedFetchGroup_nullEM_null() {
- try {
- JpaFetchPlanHelper.addNamedFetchGroupAttributes((EntityManager) null, null, null);
- } catch (NullPointerException e) {
- return;
- }
- fail("NullPointerException expected");
- }
-
- @Test
- public void jpaFetchGroupHelper_addNamedFetchGroup_nullEMF_null() {
- try {
- JpaFetchPlanHelper.addNamedFetchGroupAttributes((EntityManagerFactory) null, null, null);
- } catch (NullPointerException e) {
- return;
- }
- fail("NullPointerException expected");
- }
-
- @Test
- public void jpaFetchGroupHelper_addNamedFetchGroup_EM_null_null() {
- try {
- JpaFetchPlanHelper.addNamedFetchGroupAttributes(getEntityManager(), null, null);
- } catch (NullPointerException e) {
- return;
- }
- fail("NullPointerException expected");
- }
-
- @Test
- public void jpaFetchGroupHelper_addNamedFetchGroup_NoEntityClass() {
- FetchPlan fp = new FetchPlan(null);
-
- try {
- JpaFetchPlanHelper.addNamedFetchGroupAttributes(getEntityManager(), "unknown", fp);
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected");
- }
-
- @Test
- public void jpaFetchGroupHelper_addNamedFetchGroup_UnknownEntityClass() {
- FetchPlan fp = new FetchPlan(Object.class);
-
- try {
- JpaFetchPlanHelper.addNamedFetchGroupAttributes(getEntityManager(), "unknown", fp);
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected");
- }
-
- @Test
- public void jpaFetchGroupHelper_addNamedFetchGroup_UnknownName() {
- FetchPlan fp = new FetchPlan(Employee.class);
-
- try {
- JpaFetchPlanHelper.addNamedFetchGroupAttributes(getEntityManager(), "unknown", fp);
- } catch (IllegalArgumentException e) {
- return;
- }
- fail("IllegalArgumentException expected");
- }
-
- @Test
- public void requiredAttributesPhoneNumber() {
- FetchPlan fp = new FetchPlan(PhoneNumber.class);
- fp.initialize(JpaHelper.getServerSession(getEMF()));
-
- assertEquals(2, fp.getFetchItems().size());
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanAssert.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanAssert.java
deleted file mode 100644
index 2fcbd84..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanAssert.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Fetch Plan Extension Incubator
- ******************************************************************************/
-package test.fetchplan;
-
-import static org.junit.Assert.assertTrue;
-
-import java.lang.reflect.Method;
-import java.util.Collection;
-
-import javax.persistence.EntityManagerFactory;
-
-import junit.framework.Assert;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.extension.fetchplan.FetchItem;
-import org.eclipse.persistence.extension.fetchplan.FetchPlan;
-import org.eclipse.persistence.indirection.IndirectContainer;
-import org.eclipse.persistence.indirection.ValueHolderInterface;
-import org.eclipse.persistence.internal.security.PrivilegedAccessHelper;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.eclipse.persistence.sessions.Session;
-
-import testing.EclipseLinkJPAAssert;
-
-/**
- * Helper class used by test cases to ensure that the expected attributes and
- * relationships were loaded.
- *
- * @author dclarke
- * @since EclipseLink 2.0.0
- */
-public class FetchPlanAssert {
-
- public static void assertFetched(FetchPlan fetchPlan, Object result) {
- Assert.assertNotNull("Null FetchPlan", fetchPlan);
- Assert.assertNotNull("Null Result", result);
-
- for (FetchItem item : fetchPlan.getFetchItems()) {
- assertFetched(item, result);
- }
- }
-
- public static void assertFetched(FetchPlan fetchPlan, Object[] result, int resultIndex) {
- Assert.assertNotNull("Null FetchPlan", fetchPlan);
- Assert.assertNotNull("Null Result", result);
-
- for (FetchItem item : fetchPlan.getFetchItems()) {
- assertFetched(item, result[resultIndex]);
- }
- }
-
- public static void assertFetched(FetchPlan fetchPlan, Collection<?> results) {
- for (Object result : results) {
- if (result != null) {
- assertFetched(fetchPlan, result);
- }
- }
- }
-
- public static void assertFetched(FetchPlan fetchPlan, Collection<Object[]> results, int resultIndex) {
- for (Object[] result : results) {
- assertFetched(fetchPlan, result, resultIndex);
- }
- }
-
- private static void assertFetched(FetchItem fetchItem, Object result) {
- Assert.assertNotNull("Null FetchItem", fetchItem);
- Assert.assertNotNull("Null Result", result);
-
- // Check FetchGroup
- if (result instanceof FetchGroupTracker && ((FetchGroupTracker) result)._persistence_getFetchGroup() != null) {
- Assert.assertTrue(((FetchGroupTracker) result)._persistence_isAttributeFetched(fetchItem.getName()));
- return;
- }
-
- // Check actual value
- Object value = getMapping(fetchItem, null).getAttributeValueFromObject(result);
- if (value instanceof IndirectContainer) {
- Assert.assertTrue(((IndirectContainer) value).isInstantiated());
- } else if (value instanceof ValueHolderInterface) {
- Assert.assertTrue(((ValueHolderInterface) value).isInstantiated());
- }
- }
-
- private static Method GET_MAPPING_METHOD = null;
-
- /**
- * Helper to access the protected getMapping method on FetchItem
- */
- private static DatabaseMapping getMapping(FetchItem item, Session session) {
- try {
- if (GET_MAPPING_METHOD == null) {
- GET_MAPPING_METHOD = PrivilegedAccessHelper.getMethod(FetchItem.class, "getMapping", new Class[] { Session.class }, true);
- }
-
- return (DatabaseMapping) PrivilegedAccessHelper.invokeMethod(GET_MAPPING_METHOD, item, new Object[] { session });
- } catch (Exception e) {
- throw new RuntimeException("FetchPlanAssert.getMapping failed", e);
- }
- }
-
- public static void verifyEmployeeConfig(EntityManagerFactory emf) {
- ClassDescriptor employeeDescriptor = EclipseLinkJPAAssert.assertEntity(emf, "Employee");
- assertTrue("Entity does not implement FetchGroupTracker: " + employeeDescriptor, FetchGroupTracker.class.isAssignableFrom(employeeDescriptor.getJavaClass()));
- EclipseLinkJPAAssert.assertLazy(employeeDescriptor, "address");
- EclipseLinkJPAAssert.assertLazy(employeeDescriptor, "phoneNumbers");
- EclipseLinkJPAAssert.assertLazy(employeeDescriptor, "manager");
- EclipseLinkJPAAssert.assertLazy(employeeDescriptor, "managedEmployees");
-
- ClassDescriptor addressDescriptor = EclipseLinkJPAAssert.assertEntity(emf, "Address");
- assertTrue("Entity does not implement FetchGroupTracker: " + employeeDescriptor, FetchGroupTracker.class.isAssignableFrom(addressDescriptor.getJavaClass()));
-
- ClassDescriptor phoneDescriptor = EclipseLinkJPAAssert.assertEntity(emf, "PhoneNumber");
- assertTrue("Entity does not implement FetchGroupTracker: " + employeeDescriptor, FetchGroupTracker.class.isAssignableFrom(phoneDescriptor.getJavaClass()));
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanCopyTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanCopyTests.java
deleted file mode 100644
index 4729385..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanCopyTests.java
+++ /dev/null
@@ -1,408 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: Extensions Incubator - FetchPlan
- ******************************************************************************/
-package test.fetchplan;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.*;
-import static junit.framework.Assert.assertNotSame;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import model.Employee;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.extension.fetchplan.FetchPlan;
-import org.eclipse.persistence.extension.fetchplan.JpaFetchPlanHelper;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.junit.After;
-import org.junit.Test;
-
-import testing.EclipseLinkJPAAssert;
-import testing.EclipseLinkJPATest;
-
-/**
- * Set of tests that verify the
- * {@link FetchPlan#copy(Object, org.eclipse.persistence.internal.sessions.AbstractSession)}
- * operation.
- *
- * @author dclarke
- * @since EclispeLink 1.2
- */
-@SuppressWarnings("unchecked")
-@PersistenceContext(unitName = "employee")
-public class FetchPlanCopyTests extends EclipseLinkJPATest {
-
- /**
- * Verify the behavior of a new entity
- */
- @Test
- public void verifyDetachedEntity_DefaultConstructor() {
- Employee newEmp = new Employee();
-
- assertNotNull(newEmp.getPhoneNumbers());
- assertTrue(newEmp.getPhoneNumbers() instanceof List);
- assertNotNull(newEmp.getProjects());
- assertTrue(newEmp.getProjects() instanceof List);
- assertNotNull(newEmp.getManagedEmployees());
- assertTrue(newEmp.getManagedEmployees() instanceof List);
- }
-
- /**
- * Verify the behavior of a new entity
- */
- @Test
- public void verifyDetachedEntity_InstantiationPolicy() {
- ClassDescriptor descriptor = getDescriptor("Employee");
-
- Employee newEmp = (Employee) descriptor.getInstantiationPolicy().buildNewInstance();
-
- assertNull(newEmp.getPhoneNumbers());
- assertNull(newEmp.getProjects());
- assertNull(newEmp.getManagedEmployees());
- }
-
- @Test
- public void allEmployees_copyNames() {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e").getResultList();
-
- FetchPlan fp = new FetchPlan("Just Names", Employee.class);
- fp.addAttribute("firstName");
- fp.addAttribute("lastName");
-
- List<Employee> copies = JpaFetchPlanHelper.copy(em, fp, emps);
-
- assertEquals(emps.size(), copies.size());
-
- for (int index = 0; index < emps.size(); index++) {
- Employee emp = emps.get(index);
- Employee copy = copies.get(index);
-
- assertEquals(emp.getId(), copy.getId());
- assertEquals(emp.getVersion(), copy.getVersion());
-
- assertEquals(emp.getFirstName(), copy.getFirstName());
- assertEquals(emp.getLastName(), copy.getLastName());
-
- assertNull(copy.getGender());
- assertNull(copy.getPeriod());
- assertNull(copy.getAddress());
- assertNull(copy.getPhoneNumbers());
- assertNull(copy.getProjects());
- assertNull(copy.getManagedEmployees());
- }
- }
-
- @Test
- public void allEmployees_copyPeriod() throws Exception {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e").getResultList();
-
- FetchPlan fp = new FetchPlan(Employee.class);
- fp.addAttribute("period");
-
- List<Employee> copies = JpaFetchPlanHelper.copy(em, fp, emps);
-
- assertEquals(emps.size(), copies.size());
-
- for (int index = 0; index < emps.size(); index++) {
- Employee emp = emps.get(index);
- Employee copy = copies.get(index);
-
- assertEquals(emp.getId(), copy.getId());
- assertEquals(emp.getVersion(), copy.getVersion());
-
- assertNull(copy.getFirstName());
- assertNull(copy.getLastName());
- assertNull(copy.getGender());
- assertNull(copy.getAddress());
- assertNull(copy.getPhoneNumbers());
- assertNull(copy.getProjects());
- assertNull(copy.getManagedEmployees());
- assertNotNull(copy.getPeriod());
- assertEquals(emp.getPeriod().getStartDate(), copy.getPeriod().getStartDate());
- assertEquals(emp.getPeriod().getEndDate(), copy.getPeriod().getEndDate());
- }
- }
-
- @Test
- public void allEmployees_copyNamesAdress() throws Exception {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e").getResultList();
-
- FetchPlan fp = new FetchPlan("Just Names", Employee.class);
- fp.addAttribute("firstName");
- fp.addAttribute("lastName");
- fp.addAttribute("address");
-
- List<Employee> copies = JpaFetchPlanHelper.copy(em, fp, emps);
-
- assertEquals(emps.size(), copies.size());
-
- for (int index = 0; index < emps.size(); index++) {
- Employee emp = emps.get(index);
- Employee copy = copies.get(index);
-
- assertEquals(emp.getId(), copy.getId());
- assertEquals(emp.getVersion(), copy.getVersion());
-
- assertEquals(emp.getFirstName(), copy.getFirstName());
- assertEquals(emp.getLastName(), copy.getLastName());
-
- assertNull(copy.getGender());
- assertNull(copy.getPeriod());
- assertNotNull(copy.getAddress());
- assertNull(copy.getPhoneNumbers());
- assertNull(copy.getProjects());
- assertNull(copy.getManagedEmployees());
- }
- }
-
- @Test
- public void allEmployees_copyNamesAddressCity() throws Exception {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e").getResultList();
-
- FetchPlan fp = new FetchPlan("Just Names", Employee.class);
- fp.addAttribute("firstName");
- fp.addAttribute("lastName");
- fp.addAttribute("address.city");
-
- List<Employee> copies = JpaFetchPlanHelper.copy(em, fp, emps);
-
- assertEquals(emps.size(), copies.size());
-
- for (int index = 0; index < emps.size(); index++) {
- Employee emp = emps.get(index);
- Employee copy = copies.get(index);
-
- assertEquals(emp.getId(), copy.getId());
- assertEquals(emp.getVersion(), copy.getVersion());
-
- assertEquals(emp.getFirstName(), copy.getFirstName());
- assertEquals(emp.getLastName(), copy.getLastName());
-
- assertNull(copy.getGender());
- assertNull(copy.getPeriod());
- assertNotNull(copy.getAddress());
- assertNull(copy.getPhoneNumbers());
- assertNull(copy.getProjects());
- assertNull(copy.getManagedEmployees());
- }
- }
-
- @Test
- public void allEmployees_copyNamesPhoneNumbers() throws Exception {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e").getResultList();
-
- FetchPlan fp = new FetchPlan("Just Names", Employee.class);
- fp.addAttribute("firstName");
- fp.addAttribute("lastName");
- fp.addAttribute("phoneNumbers");
-
- List<Employee> copies = JpaFetchPlanHelper.copy(em, fp, emps);
-
- assertEquals(emps.size(), copies.size());
-
- for (int index = 0; index < emps.size(); index++) {
- Employee emp = emps.get(index);
- Employee copy = copies.get(index);
-
- assertNotSame(emp, copy);
- assertEquals(emp.getId(), copy.getId());
- assertEquals(emp.getVersion(), copy.getVersion());
-
- assertEquals(emp.getFirstName(), copy.getFirstName());
- assertEquals(emp.getLastName(), copy.getLastName());
-
- assertNotNull(emp.getGender());
- assertNull(copy.getGender());
-
- assertNotNull(emp.getAddress());
- assertNull(copy.getAddress());
-
- assertEquals(emp.getPhoneNumbers().size(), copy.getPhoneNumbers().size());
-
- for (int pI = 0; pI < emp.getPhoneNumbers().size(); pI++) {
- PhoneNumber phone = emp.getPhoneNumbers().get(pI);
- PhoneNumber phoneCopy = copy.getPhoneNumbers().get(pI);
-
- assertEquals(phone.getId(), phoneCopy.getId());
- assertEquals(phone.getNumber(), phoneCopy.getNumber());
- assertEquals(phone.getAreaCode(), phoneCopy.getAreaCode());
- assertEquals(phone.getType(), phoneCopy.getType());
-
- assertNotNull(phone.getOwner());
- assertSame(emp, phone.getOwner());
-
- assertNotNull(phoneCopy.getOwner());
- assertSame(copy, phoneCopy.getOwner());
- }
- }
- }
-
- @Test
- public void allEmployees_copyNamesPhoneNumbersAreaCodeAndNumber() throws Exception {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e").getResultList();
-
- FetchPlan fp = new FetchPlan("Just Names", Employee.class);
- fp.addAttribute("id");
- fp.addAttribute("version");
- fp.addAttribute("firstName");
- fp.addAttribute("lastName");
- fp.addAttribute("phoneNumbers.type");
- fp.addAttribute("phoneNumbers.number");
- fp.addAttribute("phoneNumbers.areaCode");
-
- List<Employee> copies = JpaFetchPlanHelper.copy(em, fp, emps);
-
- assertEquals(emps.size(), copies.size());
-
- for (int index = 0; index < emps.size(); index++) {
- Employee emp = emps.get(index);
- Employee copy = copies.get(index);
-
- assertTrue(emp.getId() > 0);
- assertEquals(emp.getId(), copy.getId());
- assertEquals(emp.getVersion(), copy.getVersion());
-
- assertEquals(emp.getFirstName(), copy.getFirstName());
- assertEquals(emp.getLastName(), copy.getLastName());
-
- assertNotNull(emp.getGender());
- assertNull(copy.getGender());
-
- assertNotNull(emp.getAddress());
- assertNull(copy.getAddress());
-
- assertEquals(emp.getPhoneNumbers().size(), copy.getPhoneNumbers().size());
-
- for (int pI = 0; pI < emp.getPhoneNumbers().size(); pI++) {
- PhoneNumber phone = emp.getPhoneNumbers().get(pI);
- PhoneNumber phoneCopy = copy.getPhoneNumbers().get(pI);
-
- assertEquals(0, phoneCopy.getId());
- assertEquals(phone.getNumber(), phoneCopy.getNumber());
- assertEquals(phone.getAreaCode(), phoneCopy.getAreaCode());
- assertEquals(phone.getType(), phoneCopy.getType());
-
- assertNotNull(phone.getOwner());
- assertSame(emp, phone.getOwner());
-
- assertNotNull(phoneCopy.getOwner());
- assertSame(copy, phoneCopy.getOwner());
- }
- }
- }
-
- /**
- * Test that copying handles entities in the root collection also existing
- * within the graph. In this case the initial query retrieves a collection
- * of entities populating their managedEmployees list. The employees in this
- * list only have their id copied. The challenge is that when an entity
- * exists in the root query as well as in one of the entity's
- * managedEmployees list then the copy operation must ensure that the root
- * entities are properly populated.
- */
- @Test
- public void selfReferencedRelationshipCopying() {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e").getResultList();
-
- FetchPlan fetchplan = new FetchPlan(Employee.class);
- fetchplan.addAttribute("managedEmployees");
-
- List<Employee> copiedEmps = JpaFetchPlanHelper.copy(em, fetchplan, emps);
-
- assertEquals(emps.size(), copiedEmps.size());
-
- for (int index = 0; index < emps.size(); index++) {
- Employee emp = emps.get(index);
- Employee empCopy = copiedEmps.get(index);
-
- assertNotSame(emp, empCopy);
-
- // Verify required attributes
- assertEquals(emp.getId(), empCopy.getId());
- assertEquals(emp.getVersion(), empCopy.getVersion());
- assertEquals(emp.getManagedEmployees().size(), empCopy.getManagedEmployees().size());
-
- // These should not be loaded in the original and should be null in
- // all copies
- EclipseLinkJPAAssert.assertNotLoaded(getEMF(), emp, "address");
- assertNull(empCopy.getAddress());
- EclipseLinkJPAAssert.assertNotLoaded(getEMF(), emp, "projects");
- assertNull(empCopy.getProjects());
- EclipseLinkJPAAssert.assertNotLoaded(getEMF(), emp, "phoneNumbers");
- assertNull(empCopy.getPhoneNumbers());
-
- // if the employee has a manager then it should have all non-lazy
- // attributes
- if (emp.getManager() != null) {
- assertEquals(emp.getFirstName(), empCopy.getFirstName());
- assertEquals(emp.getLastName(), empCopy.getLastName());
- assertEquals(emp.getGender(), empCopy.getGender());
- assertEquals(emp.getSalary(), empCopy.getSalary());
- assertEquals(emp.getStartTime(), empCopy.getStartTime());
- assertEquals(emp.getEndTime(), empCopy.getEndTime());
-
- if (emp.getPeriod() != null) {
- assertEquals(emp.getPeriod().getStartDate(), empCopy.getPeriod().getStartDate());
- assertEquals(emp.getPeriod().getEndDate(), empCopy.getPeriod().getEndDate());
- }
- }
- // otherwise only the managedEmployees should be populated
- else {
- assertNull(empCopy.getFirstName());
- assertNull(empCopy.getLastName());
- assertNull(empCopy.getGender());
- assertEquals(0d, empCopy.getSalary());
- assertNull(empCopy.getStartTime());
- assertNull(empCopy.getEndTime());
- assertNull(empCopy.getPeriod());
- assertNull(empCopy.getManager());
- }
-
- }
- }
-
- @After
- public void clearCache() {
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- @Override
- protected void verifyConfig(EntityManager em) {
- super.verifyConfig(em);
-
- EclipseLinkJPAAssert.assertWoven(getDescriptor("Employee"));
- FetchPlanAssert.verifyEmployeeConfig(getEMF());
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanExamplesTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanExamplesTests.java
deleted file mode 100644
index b009635..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanExamplesTests.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: Extensions Incubator - FetchPlan
- ******************************************************************************/
-package test.fetchplan;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.HashSet;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-
-import junit.framework.Assert;
-import model.Employee;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.extension.fetchplan.FetchPlan;
-import org.eclipse.persistence.extension.fetchplan.JpaFetchPlanHelper;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.junit.After;
-import org.junit.Test;
-
-import testing.EclipseLinkJPATest;
-import example.FetchPlanExamples;
-
-@PersistenceContext(unitName = "employee")
-public class FetchPlanExamplesTests extends EclipseLinkJPATest {
-
- FetchPlanExamples examples = new FetchPlanExamples();
-
- @Test
- public void employeesFetchAddressAndPhones() {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = this.examples.employeesFetchAddressAndPhones(em);
-
- assertNotNull(emps);
- assertTrue(emps.size() > 0);
- // assertEquals(1 + (emps.size() * 2),
- // getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertTrue(emp instanceof FetchGroupTracker);
- FetchGroupTracker empTracker = (FetchGroupTracker) emp;
- assertNotNull(empTracker._persistence_getFetchGroup());
-
- assertTrue(empTracker._persistence_isAttributeFetched("id"));
- assertTrue(empTracker._persistence_isAttributeFetched("version"));
- assertTrue(empTracker._persistence_isAttributeFetched("firstName"));
- assertTrue(empTracker._persistence_isAttributeFetched("lastName"));
- assertTrue(empTracker._persistence_isAttributeFetched("gender"));
- assertTrue(empTracker._persistence_isAttributeFetched("salary"));
- assertTrue(empTracker._persistence_isAttributeFetched("address"));
- assertTrue(empTracker._persistence_isAttributeFetched("phoneNumbers"));
- assertFalse(empTracker._persistence_isAttributeFetched("startTime"));
- assertFalse(empTracker._persistence_isAttributeFetched("endTime"));
- assertFalse(empTracker._persistence_isAttributeFetched("projects"));
- assertFalse(empTracker._persistence_isAttributeFetched("period"));
- assertNotNull(emp.getAddress());
- emp.getPhoneNumbers().size();
- }
- assertEquals(1 + (emps.size() * 2), getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void employeesFetchAddressAndPhones_optimized() {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = this.examples.employeesFetchAddressAndPhones_optimized(em);
-
- assertNotNull(emps);
- assertTrue(emps.size() > 0);
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertTrue(emp instanceof FetchGroupTracker);
- FetchGroupTracker empTracker = (FetchGroupTracker) emp;
- assertNotNull(empTracker._persistence_getFetchGroup());
-
- assertTrue(empTracker._persistence_isAttributeFetched("id"));
- assertTrue(empTracker._persistence_isAttributeFetched("version"));
- assertTrue(empTracker._persistence_isAttributeFetched("firstName"));
- assertTrue(empTracker._persistence_isAttributeFetched("lastName"));
- assertTrue(empTracker._persistence_isAttributeFetched("gender"));
- assertTrue(empTracker._persistence_isAttributeFetched("salary"));
- assertTrue(empTracker._persistence_isAttributeFetched("address"));
- assertTrue(empTracker._persistence_isAttributeFetched("phoneNumbers"));
- assertFalse(empTracker._persistence_isAttributeFetched("startDate"));
- assertFalse(empTracker._persistence_isAttributeFetched("endDate"));
- assertFalse(empTracker._persistence_isAttributeFetched("projects"));
- assertFalse(empTracker._persistence_isAttributeFetched("period"));
- assertNotNull(emp.getAddress());
- emp.getPhoneNumbers().size();
- }
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void employeesFetchAddressAndPhonesBatchAndUsingRedirector() {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = this.examples.employeesFetchAddressAndPhonesBatchAndUsingRedirector(em);
-
- assertNotNull(emps);
- assertTrue(emps.size() > 0);
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertTrue(emp instanceof FetchGroupTracker);
- FetchGroupTracker empTracker = (FetchGroupTracker) emp;
- assertNotNull(empTracker._persistence_getFetchGroup());
-
- assertTrue(empTracker._persistence_isAttributeFetched("id"));
- assertTrue(empTracker._persistence_isAttributeFetched("version"));
- assertTrue(empTracker._persistence_isAttributeFetched("firstName"));
- assertTrue(empTracker._persistence_isAttributeFetched("lastName"));
- assertTrue(empTracker._persistence_isAttributeFetched("gender"));
- assertTrue(empTracker._persistence_isAttributeFetched("salary"));
- assertTrue(empTracker._persistence_isAttributeFetched("address"));
- assertTrue(empTracker._persistence_isAttributeFetched("phoneNumbers"));
- assertFalse(empTracker._persistence_isAttributeFetched("startDate"));
- assertFalse(empTracker._persistence_isAttributeFetched("endDate"));
- assertFalse(empTracker._persistence_isAttributeFetched("projects"));
- assertFalse(empTracker._persistence_isAttributeFetched("period"));
- assertNotNull(emp.getAddress());
- emp.getPhoneNumbers().size();
- }
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void maleEmployeeCopyNames() {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = examples.maleEmployeeCopyNames(em);
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertNotNull(emp);
- assertNotNull(emp.getFirstName());
- assertNotNull(emp.getLastName());
- assertTrue(emp.getId() > 0);
- assertTrue(emp.getVersion() > 0);
- assertEquals(0.0, emp.getSalary(), 0.0);
- assertNull(emp.getGender());
- assertNull(emp.getStartTime());
- assertNull(emp.getEndTime());
- assertNull(emp.getPeriod());
- assertNull(emp.getAddress());
- assertNull(emp.getPhoneNumbers());
- assertNull(emp.getProjects());
- }
- }
-
- @Test
- public void employeeCopyNamesWithFetchGroup() {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = examples.employeeCopyNamesWithFetchGroup(em);
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertNotNull(emp);
- assertNotNull(emp.getFirstName());
- assertNotNull(emp.getLastName());
- assertTrue(emp.getId() > 0);
- assertTrue(emp.getVersion() > 0);
- assertEquals(0.0, emp.getSalary(), 0.0);
- assertNull(emp.getGender());
- assertNull(emp.getStartTime());
- assertNull(emp.getEndTime());
- assertNull(emp.getPeriod());
- assertNull(emp.getAddress());
- assertNull(emp.getPhoneNumbers());
- assertNull(emp.getProjects());
-
- // Check in EM to ensure FetchGroup was used
- // use getReference as find will load the entire entity
- Employee managedEmp = em.getReference(Employee.class, emp.getId());
- assertNotNull(managedEmp);
- assertEquals(emp.getId(), managedEmp.getId());
- assertNotSame(emp, managedEmp);
-
- assertTrue(((FetchGroupTracker) managedEmp)._persistence_isAttributeFetched("id"));
- assertTrue(((FetchGroupTracker) managedEmp)._persistence_isAttributeFetched("version"));
- assertTrue(((FetchGroupTracker) managedEmp)._persistence_isAttributeFetched("firstName"));
- assertTrue(((FetchGroupTracker) managedEmp)._persistence_isAttributeFetched("lastName"));
- assertFalse(((FetchGroupTracker) managedEmp)._persistence_isAttributeFetched("gender"));
- assertFalse(((FetchGroupTracker) managedEmp)._persistence_isAttributeFetched("salary"));
- assertFalse(((FetchGroupTracker) managedEmp)._persistence_isAttributeFetched("address"));
- assertFalse(((FetchGroupTracker) managedEmp)._persistence_isAttributeFetched("phoneNumbers"));
- assertFalse(((FetchGroupTracker) managedEmp)._persistence_isAttributeFetched("startDate"));
- assertFalse(((FetchGroupTracker) managedEmp)._persistence_isAttributeFetched("endDate"));
- assertFalse(((FetchGroupTracker) managedEmp)._persistence_isAttributeFetched("projects"));
- assertFalse(((FetchGroupTracker) managedEmp)._persistence_isAttributeFetched("period"));
- }
- }
-
- @Test
- public void employeeCopyWithNamesAddressAndPhones() {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = this.examples.employeeCopyWithNamesAddressAndPhones(em);
-
- assertTrue(emps.size() > 0);
- assertEquals(1 + (2 * emps.size()), getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertNotNull(emp);
- assertNotNull(emp.getFirstName());
- assertNotNull(emp.getLastName());
- assertTrue(emp.getId() > 0);
- assertTrue(emp.getVersion() > 0);
- // assertEquals(0.0, emp.getSalary(), 0.0);
- assertNull(emp.getGender());
- assertNull(emp.getStartTime());
- assertNull(emp.getEndTime());
- assertNull(emp.getPeriod());
- assertNotNull(emp.getAddress());
- assertNotNull(emp.getPhoneNumbers());
- assertNull(emp.getProjects());
- }
- assertEquals(1 + (2 * emps.size()), getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void employeeCopyWithNamesAddressAndPhonesWithBatching() {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = this.examples.employeeCopyWithNamesAddressAndPhonesWithBatching(em);
-
- assertTrue(emps.size() > 0);
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- assertNotNull(emp);
- assertNotNull(emp.getFirstName());
- assertNotNull(emp.getLastName());
- assertTrue(emp.getId() > 0);
- assertTrue(emp.getVersion() > 0);
- // assertEquals(0.0, emp.getSalary(), 0.0);
- assertNull(emp.getGender());
- assertNull(emp.getStartTime());
- assertNull(emp.getEndTime());
- assertNull(emp.getPeriod());
- assertNotNull(emp.getAddress());
- assertNotNull(emp.getPhoneNumbers());
- assertNull(emp.getProjects());
- }
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void copyEagerAttributesOnly() throws Exception {
- EntityManager em = getEntityManager();
-
- List<Employee> results = this.examples.copyEagerAttributesOnly(em);
-
- assertNotNull("Results should not be null", results);
-
- for (Employee emp : results) {
- assertTrue(emp.getId() > 0);
- assertTrue(emp.getVersion() > 0l);
- assertNotNull(emp.getFirstName());
- assertNotNull(emp.getLastName());
- assertNotNull(emp.getGender());
- // assertNull(emp.getPeriod());
- assertNull(emp.getAddress());
- assertNull(emp.getPhoneNumbers());
- assertNull(emp.getProjects());
- }
- }
-
- @Test
- public void managerManagerManagerFetchWithNames() throws Exception {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = this.examples.managerManagerManagerFetchWithNames(em);
-
- assertTrue(emps.size() > 0);
- int selectsRun = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- // Calculate unique managers to figure out expected SQL
- HashSet<Employee> managers = new HashSet<Employee>();
- for (Employee emp : emps) {
- managers.add(emp);
- managers.add(emp.getManager());
- managers.add(emp.getManager().getManager());
- }
- managers.removeAll(emps);
-
- assertEquals(1 + managers.size(), getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertEquals(selectsRun, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void employeeAddress_ReturnBoth() throws Exception {
- EntityManager em = getEntityManager();
-
- List<Object[]> results = this.examples.employeeAddress_ReturnBoth(em);
-
- assertEquals(1 + results.size(), getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void copyMergeExample_Clear() throws Exception {
- EntityManager em = getEntityManager();
-
- em.getTransaction().begin();
- this.examples.copyMergeExample(em, true);
-
- assertEquals(6, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLINSERTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLDELETECalls());
-
- try {
- em.flush();
-
- assertEquals(6, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLINSERTCalls());
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLDELETECalls());
- } finally {
- em.getTransaction().rollback();
- }
- }
-
- @Test
- public void copyMergeExample_NoClear() throws Exception {
- EntityManager em = getEntityManager();
-
- em.getTransaction().begin();
- this.examples.copyMergeExample(em, false);
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLINSERTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLDELETECalls());
-
- try {
- em.flush();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLINSERTCalls());
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLDELETECalls());
- } finally {
- em.getTransaction().rollback();
- }
- }
-
- @Test
- public void fetchCopyMergeExample() throws Exception {
- EntityManager em = getEntityManager();
-
- em.getTransaction().begin();
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("firstName");
- fetchPlan.addAttribute("lastName");
- fetchPlan.addAttribute("address");
- // fetchPlan.addAttribute("phoneNumbers");
-
- int minId = ((Number) em.createQuery("SELECT MIN(e.id) FROM Employee e").getSingleResult()).intValue();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = " + minId);
- query.setHint(QueryHints.FETCH_GROUP, fetchPlan.createFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- JpaFetchPlanHelper.fetch(em, fetchPlan, emp);
-
- assertFalse(emp.getFirstName().equals(emp.getLastName()));
-
- Employee copy = JpaFetchPlanHelper.copy(em, fetchPlan, emp);
-
- Assert.assertNotSame(emp, copy);
-
- copy.setSalary(Integer.MAX_VALUE);
- copy.setFirstName(emp.getLastName());
- copy.setLastName(emp.getFirstName());
-
- assertFalse(copy.getFirstName().equals(copy.getLastName()));
-
- JpaFetchPlanHelper.merge(em, fetchPlan, copy);
-
- // assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
-
- em.flush();
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
-
- em.getTransaction().rollback();
- }
-
- @Test
- public void createFetchPlanFromDefaultFetchGroup() {
- EntityManager em = getEntityManager();
-
- FetchGroup defaultFG = new FetchGroup();
- defaultFG.addAttribute("firstName");
- defaultFG.addAttribute("lastName");
- getDescriptor("Employee").getFetchGroupManager().setDefaultFetchGroup(defaultFG);
-
- List<Employee> emps = this.examples.createFetchPlanFromDefaultFetchGroup(em);
-
- assertFalse(emps.isEmpty());
- }
-
- @After
- public void clearCache() {
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- @Override
- protected void verifyConfig(EntityManager em) {
- super.verifyConfig(em);
- FetchPlanAssert.verifyEmployeeConfig(getEMF());
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanMergeTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanMergeTests.java
deleted file mode 100644
index 0218297..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/FetchPlanMergeTests.java
+++ /dev/null
@@ -1,656 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: Extensions Incubator - FetchPlan
- ******************************************************************************/
-package test.fetchplan;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-
-import model.Address;
-import model.Employee;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.extension.fetchplan.FetchPlan;
-import org.eclipse.persistence.extension.fetchplan.JpaFetchPlanHelper;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.After;
-import org.junit.Test;
-
-import testing.EclipseLinkJPATest;
-import example.Queries;
-
-/**
- * Set of tests that verify the
- * {@link FetchPlan#copy(Object, org.eclipse.persistence.internal.sessions.AbstractSession)}
- * operation.
- *
- * @author dclarke
- * @since EclispeLink 1.2
- */
-@PersistenceContext(unitName = "employee")
-public class FetchPlanMergeTests extends EclipseLinkJPATest {
-
- @Test
- public void incrementSalary() throws Exception {
- EntityManager em = getEntityManager();
-
- Employee emp = Queries.minEmployeeWithAddressAndPhones(em);
-
- assertNotNull(emp);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFalse(emp.getFirstName().equals("-"));
-
- FetchPlan plan = new FetchPlan(Employee.class);
- plan.addAttribute("salary");
-
- Employee minimalEmp = new Employee();
- minimalEmp.setId(emp.getId());
- minimalEmp.setVersion(emp.getVersion());
- minimalEmp.setSalary(Integer.MAX_VALUE);
- minimalEmp.setFirstName("-");
- minimalEmp.setAddress(null);
-
- em.getTransaction().begin();
- Employee empWC = JpaFetchPlanHelper.merge(em, plan, minimalEmp);
- em.flush();
-
- assertSame(emp, empWC);
- assertFalse(empWC.getFirstName().equals("-"));
- assertNotNull(empWC.getAddress());
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
-
- em.getTransaction().rollback();
- }
-
- /**
- * Test doing a merge on an entity not read in.
- */
- @Test
- public void incrementSalary_NotInContext() throws Exception {
- EntityManager em = getEntityManager();
-
- int minId = Queries.minEmployeeIdWithAddressAndPhones(em);
- long version = ((Number) em.createQuery("SELECT e.version FROM Employee e WHERE e.id = " + minId).getSingleResult()).longValue();
-
- FetchPlan plan = new FetchPlan(Employee.class);
- plan.addAttribute("id");
- plan.addAttribute("salary");
-
- Employee minimalEmp = new Employee();
- minimalEmp.setId(minId);
- minimalEmp.setVersion(version);
- minimalEmp.setSalary(Integer.MAX_VALUE);
- minimalEmp.setFirstName("-");
- minimalEmp.setAddress(null);
-
- em.getTransaction().begin();
- Employee empWC = JpaFetchPlanHelper.merge(em, plan, minimalEmp);
- em.flush();
-
- assertFalse(empWC.getFirstName().equals("-"));
- assertNotNull(empWC.getAddress());
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
-
- em.getTransaction().rollback();
- }
-
- @Test
- public void updateCity() throws Exception {
- EntityManager em = getEntityManager();
-
- Employee emp = Queries.minEmployeeWithAddressAndPhones(em);
- String country = emp.getAddress().getCountry();
-
- assertNotNull(emp);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- FetchPlan plan = new FetchPlan(Employee.class);
- plan.addAttribute("address.city");
-
- Employee minimalEmp = new Employee();
- minimalEmp.setId(emp.getId());
- minimalEmp.setVersion(emp.getVersion());
- Address minimalAddress = new Address();
- minimalEmp.setAddress(minimalAddress);
- minimalAddress.setId(emp.getAddress().getId());
- minimalAddress.setCity("-");
- minimalAddress.setCountry("-");
- minimalAddress.setStreet("-");
-
- em.getTransaction().begin();
- Employee empWC = JpaFetchPlanHelper.merge(em, plan, minimalEmp);
- em.flush();
-
- assertSame(emp, empWC);
- assertNotNull(empWC.getAddress());
- assertEquals("-", empWC.getAddress().getCity());
- assertEquals(country, empWC.getAddress().getCountry());
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLDELETECalls());
-
- em.getTransaction().rollback();
- }
-
- /**
- * Delete the employee's address by setting it to null in the copy being
- * merged and the FetchPlan's merge combined with the mapping's
- * private-owned configuration will cause it to be deleted.
- */
- @Test
- public void deleteAddress() throws Exception {
- EntityManager em = getEntityManager();
-
- Employee emp = Queries.minEmployeeWithAddressAndPhones(em);
-
- assertNotNull(emp);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- FetchPlan plan = new FetchPlan(Employee.class);
- plan.addAttribute("address");
-
- Employee minimalEmp = new Employee();
- minimalEmp.setId(emp.getId());
- minimalEmp.setVersion(emp.getVersion());
- minimalEmp.setAddress(null);
-
- em.getTransaction().begin();
- Employee empWC = JpaFetchPlanHelper.merge(em, plan, minimalEmp);
- em.flush();
-
- assertSame(emp, empWC);
- assertNull(empWC.getAddress());
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLDELETECalls());
-
- em.getTransaction().rollback();
- }
-
- /**
- * Delete the employee's address by setting it to null in the copy being
- * merged and the FetchPlan's merge combined with the mapping's
- * private-owned configuration will cause it to be deleted.
- */
- @Test
- public void removeAllPhones() throws Exception {
- EntityManager em = getEntityManager();
-
- Employee emp = Queries.minEmployeeWithAddressAndPhones(em);
-
- assertNotNull(emp);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- FetchPlan plan = new FetchPlan(Employee.class);
- plan.addAttribute("phoneNumbers");
-
- Employee minimalEmp = new Employee();
- minimalEmp.setId(emp.getId());
- minimalEmp.setVersion(emp.getVersion());
- minimalEmp.setPhoneNumbers(new ArrayList<PhoneNumber>());
-
- em.getTransaction().begin();
- Employee empWC = JpaFetchPlanHelper.merge(em, plan, minimalEmp);
- em.flush();
-
- assertSame(emp, empWC);
- assertTrue(empWC.getPhoneNumbers().isEmpty());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLDELETECalls());
-
- em.getTransaction().rollback();
- }
-
- /**
- * Delete the employee's address by setting it to null in the copy being
- * merged and the FetchPlan's merge combined with the mapping's
- * private-owned configuration will cause it to be deleted. For this to work
- * the PhoneNumber.owner relationship needs to be fetch=EAGER so that is is
- * loaded using the default mappings fetch. Without this the owner is null
- * and PK is incomplete in the partial entity.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void removeOnePhone() throws Exception {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e WHERE SIZE(e.phoneNumbers) > 1").setMaxResults(1).getResultList();
- Employee emp = emps.get(0);
- int numPhones = emp.getPhoneNumbers().size();
-
- assertNotNull(emp);
- assertTrue(numPhones > 1);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- FetchPlan plan = new FetchPlan(Employee.class);
- plan.addAttribute("phoneNumbers");
-
- Employee minimalEmp = JpaFetchPlanHelper.copy(em, plan, emp);
-
- assertNotNull(minimalEmp.getPhoneNumbers());
- assertEquals(emp.getPhoneNumbers().size(), minimalEmp.getPhoneNumbers().size());
- for (PhoneNumber phone : minimalEmp.getPhoneNumbers()) {
- assertSame(minimalEmp, phone.getOwner());
- }
-
- minimalEmp.getPhoneNumbers().remove(0);
-
- em.getTransaction().begin();
- Employee empWC = JpaFetchPlanHelper.merge(em, plan, minimalEmp);
- em.flush();
-
- assertSame(emp, empWC);
- assertEquals(numPhones - 1, empWC.getPhoneNumbers().size());
- assertEquals(minimalEmp.getPhoneNumbers().size(), empWC.getPhoneNumbers().size());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLDELETECalls());
-
- em.getTransaction().rollback();
- }
-
- /**
- * Create a partial entity graph using
- * {@link JpaFetchPlanHelper#copy(EntityManager, FetchPlan, Object)}
- */
- @Test
- public void copyMerge_updateBasics() {
- EntityManager em = getEntityManager();
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("firstName");
- fetchPlan.addAttribute("lastName");
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- Employee emp = Queries.minEmployeeWithAddressAndPhones(em);
-
- assertNotNull(emp.getFirstName());
- assertNotNull(emp.getLastName());
-
- Employee partialEmp = JpaFetchPlanHelper.copy(em, fetchPlan, emp);
-
- // Verify state of partial entity
- assertEquals(emp.getId(), partialEmp.getId());
- assertEquals(emp.getVersion(), partialEmp.getVersion());
- assertNotNull(partialEmp.getFirstName());
- assertNotNull(partialEmp.getLastName());
- assertNull(partialEmp.getPeriod());
- assertNull(partialEmp.getProjects());
- assertNull(partialEmp.getGender());
- assertNull(partialEmp.getManager());
- assertNull(partialEmp.getManagedEmployees());
- assertNotNull(partialEmp.getAddress());
- assertNotNull(partialEmp.getPhoneNumbers());
- for (PhoneNumber phone : partialEmp.getPhoneNumbers()) {
- assertNotNull(phone.getNumber());
- assertNotNull(phone.getType());
- assertNotNull(phone.getAreaCode());
- assertNotNull(phone.getOwner());
- }
-
- double originalSalary = emp.getSalary();
- partialEmp.setSalary(emp.getSalary() + 1);
- partialEmp.setFirstName(null);
- partialEmp.setLastName(null);
-
- em.getTransaction().begin();
- Employee managedEmp = JpaFetchPlanHelper.merge(em, fetchPlan, partialEmp);
-
- assertSame(emp, managedEmp);
- assertNull(emp.getFirstName());
- assertNull(emp.getLastName());
- assertEquals(originalSalary, emp.getSalary());
-
- em.flush();
-
- // Verify that only 1 update was issued for the EMPLOYEE table. The
- // salary will not be updated
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
-
- em.getTransaction().rollback();
- }
-
- /**
- * Create a partial entity graph using
- * {@link JpaFetchPlanHelper#copy(EntityManager, FetchPlan, Object)}
- */
- @Test
- public void copyMerge_removingPrivateOwnedOneToMany() {
- EntityManager em = getEntityManager();
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("firstName");
- fetchPlan.addAttribute("lastName");
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- Employee emp = Queries.minEmployeeWithAddressAndPhones(em);
-
- assertNotNull(emp.getFirstName());
- assertNotNull(emp.getLastName());
-
- Employee partialEmp = JpaFetchPlanHelper.copy(em, fetchPlan, emp);
-
- // Verify state of partial entity
- assertEquals(emp.getId(), partialEmp.getId());
- assertEquals(emp.getVersion(), partialEmp.getVersion());
- assertNotNull(partialEmp.getFirstName());
- assertNotNull(partialEmp.getLastName());
- assertNull(partialEmp.getPeriod());
- assertNull(partialEmp.getProjects());
- assertNull(partialEmp.getGender());
- assertNull(partialEmp.getManager());
- assertNull(partialEmp.getManagedEmployees());
- assertNotNull(partialEmp.getAddress());
- assertNotNull(partialEmp.getPhoneNumbers());
- int numPhones = partialEmp.getPhoneNumbers().size();
- for (PhoneNumber phone : partialEmp.getPhoneNumbers()) {
- assertNotNull(phone.getNumber());
- assertNotNull(phone.getType());
- assertNotNull(phone.getAreaCode());
- assertNotNull(phone.getOwner());
- }
-
- partialEmp.getPhoneNumbers().remove(0);
-
- em.getTransaction().begin();
- Employee managedEmp = JpaFetchPlanHelper.merge(em, fetchPlan, partialEmp);
-
- assertSame(emp, managedEmp);
- assertEquals(numPhones - 1, emp.getPhoneNumbers().size());
-
- em.flush();
-
- // Verify that only 1 delete
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLDELETECalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
-
- em.getTransaction().rollback();
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testDetachMerge_clearEM() throws Exception {
- EntityManager em = getEntityManager();
- em.getTransaction().begin();
-
- Query q = em.createQuery("SELECT e FROM Employee e WHERE SIZE(e.managedEmployees) > 0");
- q.setMaxResults(1);
- List<Employee> ems = q.getResultList();
-
- // Verify that at this point only the Employee SELECT occurred
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- FetchPlan fp = new FetchPlan(Employee.class);
- fp.addAttribute("managedEmployees");
-
- // Ensure FetchPlan's requested attributes are loaded from database
- JpaFetchPlanHelper.fetch(em, fp, ems);
-
- // Primary SELECT plus 1 for each employee
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- Employee emp = ems.get(0);
- System.out.println("emp.id: " + emp.getId());
- System.out.println("emp.address: " + emp.getAddress().toString());
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- System.out.println("emp.managedEmployees: " + emp.getManagedEmployees().toArray().toString());
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // detach the emp
- emp = JpaFetchPlanHelper.copy(em, fp, emp);
- // after copy we see about 50 SQLs which we cant associate with this
- // detach action
- System.out.println("deserializedEmployee: " + emp.toString());
- em.getTransaction().commit();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLINSERTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLDELETECalls());
-
- // Clear EntityManager
- em.clear();
-
- Employee newEmp = new Employee();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- em.persist(newEmp);
- // Additional SELECT to get new sequence value
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // add the new to Collection
- emp.addManagedEmployee(newEmp);
-
- em.getTransaction().begin();
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- Employee mergedEmployee = JpaFetchPlanHelper.merge(em, fp, emp);
-
- // No SELECT during merge since entities in shared cache
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- mergedEmployee.getAddress(); // null is okay
-
- // No SELECT for address as it was already read in previous transaction
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- em.flush();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- // INSERT for each of EMPLOYEE AND SALARY table
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLINSERTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLDELETECalls());
-
- em.getTransaction().rollback();
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testDetachMerge_initializeCache() throws Exception {
- EntityManager em = getEntityManager();
- em.getTransaction().begin();
-
- Query q = em.createQuery("SELECT e FROM Employee e WHERE SIZE(e.managedEmployees) > 0");
- q.setMaxResults(1);
- List<Employee> ems = q.getResultList();
-
- // Verify that at this point only the Employee SELECT occurred
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- FetchPlan fp = new FetchPlan(Employee.class);
- fp.addAttribute("managedEmployees");
-
- // Ensure FetchPlan's requested attributes are loaded from database
- JpaFetchPlanHelper.fetch(em, fp, ems);
-
- // Primary SELECT plus 1 for each employee
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- Employee emp = ems.get(0);
- System.out.println("emp.id: " + emp.getId());
- System.out.println("emp.address: " + emp.getAddress().toString());
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- System.out.println("emp.managedEmployees: " + emp.getManagedEmployees().toArray().toString());
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // detach the emp
- emp = JpaFetchPlanHelper.copy(em, fp, emp);
- // after copy we see about 50 SQLs which we cant associate with this
- // detach action
- System.out.println("deserializedEmployee: " + emp.toString());
- em.getTransaction().commit();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLINSERTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLDELETECalls());
-
- // Initialize shared cache
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
-
- Employee newEmp = new Employee();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- em.persist(newEmp);
- // Additional SELECT to get new sequence value
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // add the new to Collection
- emp.addManagedEmployee(newEmp);
-
- em.getTransaction().begin();
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- Employee mergedEmployee = JpaFetchPlanHelper.merge(em, fp, emp);
-
- // No SELECT during merge since entities in shared cache
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- mergedEmployee.getAddress(); // null is okay
-
- // No SELECT for address as it was already read in previous transaction
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- em.flush();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- // INSERT for each of EMPLOYEE AND SALARY table
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLINSERTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLDELETECalls());
-
- em.getTransaction().rollback();
- }
-
- /**
- * Read 1 Employee who has managedEmployees and fetch and copy the entity
- * graph with just its managedEmployees. Then the Employee is modified to
- * have a new managed Employee and merged back into a clear EntityManager
- * with an empty shared cache.
- * <p>
- * The expected result is that the minimal SQL is used to load the graph and
- * when merged additional SQL SELECTS are used to load the Employee and its
- * managedEmployees during the merge.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testDetachMerge_clearEMAndInitializeCache() throws Exception {
- EntityManager em = getEntityManager();
- em.getTransaction().begin();
-
- Query q = em.createQuery("SELECT e FROM Employee e WHERE SIZE(e.managedEmployees) > 0");
- q.setMaxResults(1);
- List<Employee> ems = q.getResultList();
-
- // Verify that at this point only the Employee SELECT occurred
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- FetchPlan fp = new FetchPlan(Employee.class);
- fp.addAttribute("managedEmployees");
-
- // Ensure FetchPlan's requested attributes are loaded from database
- JpaFetchPlanHelper.fetch(em, fp, ems);
-
- // Primary SELECT plus 1 for each employee
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- Employee emp = ems.get(0);
- System.out.println("emp.id: " + emp.getId());
- System.out.println("emp.address: " + emp.getAddress().toString());
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- System.out.println("emp.managedEmployees: " + emp.getManagedEmployees().toArray().toString());
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // detach the emp
- emp = JpaFetchPlanHelper.copy(em, fp, emp);
- // after copy we see about 50 SQLs which we cant associate with this
- // detach action
- System.out.println("deserializedEmployee: " + emp.toString());
- em.getTransaction().commit();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLINSERTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLDELETECalls());
-
- // Clear EntityManager and initialize shared cache
- em.clear();
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
-
- Employee newEmp = new Employee();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- em.persist(newEmp);
- // Additional SELECT to get new sequence value
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // add the new to Collection
- emp.addManagedEmployee(newEmp);
-
- em.getTransaction().begin();
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- Employee mergedEmployee = JpaFetchPlanHelper.merge(em, fp, emp);
-
- // 2 SELECT for Employee and managed Employees to do merge
- assertEquals(6, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- mergedEmployee.getAddress(); // null is okay
- // Additional select for ADDRESS
- assertEquals(7, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- em.flush();
-
- assertEquals(7, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- // INSERT for each of EMPLOYEE AND SALARY table
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLINSERTCalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLUPDATECalls());
- assertEquals(0, getQuerySQLTracker(em).getTotalSQLDELETECalls());
-
- em.getTransaction().rollback();
- }
-
- /**
- * Clear the shared cache and any sequences between test cases
- */
- @After
- public void clearState() {
- Server session = JpaHelper.getServerSession(getEMF());
-
- session.getIdentityMapAccessor().initializeAllIdentityMaps();
- session.getSequencingControl().initializePreallocated();
- }
-
- @Override
- protected void verifyConfig(EntityManager em) {
- super.verifyConfig(em);
- FetchPlanAssert.verifyEmployeeConfig(getEMF());
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/ReadObjectFetchPlanTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/ReadObjectFetchPlanTests.java
deleted file mode 100644
index 7b18f4b..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/ReadObjectFetchPlanTests.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288307: Extensions Incubator - FetchPlan
- ******************************************************************************/
-package test.fetchplan;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import model.Employee;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.extension.fetchplan.FetchPlan;
-import org.eclipse.persistence.extension.fetchplan.JpaFetchPlanHelper;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.junit.After;
-import org.junit.Test;
-
-import testing.EclipseLinkJPAAssert;
-import testing.EclipseLinkJPATest;
-import example.Queries;
-
-@PersistenceContext(unitName = "employee")
-public class ReadObjectFetchPlanTests extends EclipseLinkJPATest {
-
- @Test
- public void employeeId_Address() throws Exception {
- EntityManager em = getEntityManager();
-
- int empId = Queries.minEmployeeIdWithAddressAndPhones(em);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- ReadObjectQuery roq = new ReadObjectQuery(Employee.class);
- ExpressionBuilder eb = roq.getExpressionBuilder();
- roq.setSelectionCriteria(eb.get("id").equal(empId));
-
- Employee emp = (Employee) JpaHelper.createQuery(roq, em).getSingleResult();
-
- assertNotNull(emp);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
- JpaFetchPlanHelper.fetch(em, fetchPlan, emp);
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getAddress().getCity();
- emp.getPhoneNumbers().size();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLCalls());
- }
-
- @After
- public void clearCache() {
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- @Override
- protected void verifyConfig(EntityManager em) {
- super.verifyConfig(em);
- FetchPlanAssert.verifyEmployeeConfig(getEMF());
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/SerializedResultsTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/SerializedResultsTests.java
deleted file mode 100644
index 61d4049..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/SerializedResultsTests.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - FetchPlan Extension incubator
- ******************************************************************************/
-package test.fetchplan;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-
-import model.Employee;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.extension.fetchplan.FetchPlan;
-import org.eclipse.persistence.extension.fetchplan.JpaFetchPlanHelper;
-import org.eclipse.persistence.internal.helper.SerializationHelper;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.eclipse.persistence.queries.ReadAllQuery;
-import org.junit.After;
-import org.junit.Test;
-
-import testing.EclipseLinkJPAAssert;
-import testing.EclipseLinkJPATest;
-
-/**
- * Tests to verify that {@link FetchPlan} produced results can be serialized as
- * expected and later merged into other transactions in the same and different
- * {@link EntityManager} instances.
- *
- * @author dclarke
- * @since EclipseLink 2.0
- */
-@SuppressWarnings("unchecked")
-@PersistenceContext(unitName = "employee")
-public class SerializedResultsTests extends EclipseLinkJPATest {
-
- @Test
- public void employeeAddressPhones() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
- List<Employee> serializedEmps = serialize(emps);
- FetchPlanAssert.assertFetched(fetchPlan, serializedEmps);
- }
-
- @Test
- public void employeeAddressPhones_Batching() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- query.setHint(QueryHints.BATCH, "e.address");
- query.setHint(QueryHints.BATCH, "e.phoneNumbers");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
- List<Employee> serializedEmps = serialize(emps);
- FetchPlanAssert.assertFetched(fetchPlan, serializedEmps);
- }
-
- @Test
- public void employeeAddressPhones_Joining() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- query.setHint(QueryHints.FETCH, "e.address");
- query.setHint(QueryHints.FETCH, "e.phoneNumbers");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
- List<Employee> serializedEmps = serialize(emps);
- FetchPlanAssert.assertFetched(fetchPlan, serializedEmps);
- }
-
- @Test
- public void managerAddressPhones() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("manager.address");
- fetchPlan.addAttribute("manager.phoneNumbers");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
- List<Employee> serializedEmps = serialize(emps);
- FetchPlanAssert.assertFetched(fetchPlan, serializedEmps);
- }
-
- @Test
- public void responsibilities() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("responsibilities");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
- List<Employee> serializedEmps = serialize(emps);
- FetchPlanAssert.assertFetched(fetchPlan, serializedEmps);
- }
-
- @Test
- public void responsibilitiesBatch() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
- query.setHint(QueryHints.BATCH, "e.responsibilities");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("responsibilities");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
- List<Employee> serializedEmps = serialize(emps);
- FetchPlanAssert.assertFetched(fetchPlan, serializedEmps);
- }
-
- @Test
- public void employeeAddress_ReturnBoth() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e, e.address FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- List<Object[]> results = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, results);
-
- FetchPlanAssert.assertFetched(fetchPlan, results, 0);
- List<Object[]> serializedEmps = serialize(results);
- FetchPlanAssert.assertFetched(fetchPlan, serializedEmps, 0);
- }
-
- @Test
- public void managedEmployeesAddress() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("managedEmployees.address");
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
- List<Employee> serializedEmps = serialize(emps);
- FetchPlanAssert.assertFetched(fetchPlan, serializedEmps);
- }
-
- @Test
- public void readAllEmployee() throws Exception {
- EntityManager em = getEntityManager();
-
- ReadAllQuery raq = new ReadAllQuery(Employee.class);
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("address");
- fetchPlan.addAttribute("phoneNumbers");
-
- Query query = JpaHelper.createQuery(raq, em);
-
- List<Employee> emps = query.getResultList();
- JpaFetchPlanHelper.fetch(em, fetchPlan, emps);
-
- FetchPlanAssert.assertFetched(fetchPlan, emps);
- List<Employee> serializedEmps = serialize(emps);
- FetchPlanAssert.assertFetched(fetchPlan, serializedEmps);
- }
-
- @After
- public void clearCache() {
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- /*
- * clone using serialization
- */
- private List serialize(final List<?> results) throws Exception {
- List cloneList = new ArrayList(results.size());
-
- for (int i = 0; i < results.size(); i++) {
- cloneList.add(SerializationHelper.clone((Serializable) results.get(i)));
- }
-
- return cloneList;
- }
-
- @Override
- protected void verifyConfig(EntityManager em) {
- super.verifyConfig(em);
- FetchPlanAssert.verifyEmployeeConfig(getEMF());
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/TestOTTO.java b/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/TestOTTO.java
deleted file mode 100644
index 915a2c0..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan/test-src/test/fetchplan/TestOTTO.java
+++ /dev/null
@@ -1,340 +0,0 @@
-package test.fetchplan;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-
-import model.Employee;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.exceptions.ValidationException;
-import org.eclipse.persistence.extension.fetchplan.FetchPlan;
-import org.eclipse.persistence.extension.fetchplan.JpaFetchPlanHelper;
-import org.eclipse.persistence.internal.helper.SerializationHelper;
-import org.junit.Assert;
-import org.junit.Test;
-
-import testing.EclipseLinkJPATest;
-
-@PersistenceContext(unitName = "employee")
-public class TestOTTO extends EclipseLinkJPATest {
-
- /**
- * This test shows that in some cases (or always?) the copy method
- * instantiates empty collections (wrong) instead of setting them to null.
- * If I copy an entity with a list attribute, which is not in fetchplan and
- * not instantiated, the copied entity has a empty list. If I want to merge
- * this object later without any changes, all entries of the list attribute
- * will be deleted.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testShowEmptyCollections() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- query.setHint(QueryHints.BATCH, "e.address");
-
- FetchPlan fetchPlan = new FetchPlan(Employee.class);
- fetchPlan.addAttribute("address");
-
- List<Employee> emps = query.getResultList();
-
- List<Employee> detachedEmps = JpaFetchPlanHelper.copy(em, fetchPlan, emps);
-
- for (Employee detachedEmp : detachedEmps) {
- assertNull(detachedEmp.getPhoneNumbers());
- assertNull(detachedEmp.getProjects());
- assertNull(detachedEmp.getManagedEmployees());
- assertNull(detachedEmp.getManager());
- }
-
- em.getTransaction().begin();
-
- // Since the detached emps are partial based on a FetchPLan they must be
- // merged using JpaFetchPlanHelper
- Employee attEmp = JpaFetchPlanHelper.merge(em, fetchPlan, detachedEmps.get(0));
-
- em.flush();
-
- if (attEmp.getPhoneNumbers().isEmpty())
- em.getTransaction().rollback();
-
- }
-
- /**
- * This test throws an InstantiationException for a reason i want to
- * understand.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testThrowsInstantiationException() throws Exception {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e where e.managedEmployees is not empty").getResultList();
-
- FetchPlan fetchplan = new FetchPlan("f", Employee.class);
- fetchplan.addAttribute("managedEmployees");
-
- List<Employee> detachedEmps = JpaFetchPlanHelper.copy(em, fetchplan, emps);
-
- assertNotNull(detachedEmps);
- }
-
- /**
- * If testThrowsInstantiationException is fixed this test should show that
- * the to-many relations of managedEmployees are loaded though they are not
- * configured in the FetchPlan. If You do this with a big model, You run
- * into memory problems.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testShowOutOfMemoryInCopy() throws Exception {
- EntityManager em = getEntityManager();
-
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e where e.managedEmployees is not empty").getResultList();
-
- FetchPlan fetchplan = new FetchPlan(Employee.class);
- fetchplan.addAttribute("managedEmployees").setFetchPlan(new FetchPlan(Employee.class));
-
- List<Employee> detachedEmps = JpaFetchPlanHelper.copy(em, fetchplan, emps);
-
- for (Employee emp : detachedEmps) {
- //logMappedValues(emp, "");
- assertNull(emp.getAddress());
- assertNull(emp.getPhoneNumbers());
- assertNull(emp.getManager());
- assertNull(emp.getPeriod());
- assertNull(emp.getProjects());
- Assert.assertNotNull(emp.getManagedEmployees());
-
- //logMappedValues(emp, "");
-
- for (Employee managedEmp : emp.getManagedEmployees()) {
- assertNull(managedEmp.getAddress());
- assertNull(managedEmp.getPhoneNumbers());
- assertNull(managedEmp.getManager());
- assertNull(managedEmp.getPeriod());
- assertNull(managedEmp.getProjects());
-
- // If the managedEmp is part of the original result then it will
- // have a list of managed employees. Otherwise it will be null.
- if (detachedEmps.contains(managedEmp)) {
- assertNotNull(managedEmp.getManagedEmployees());
- } else {
- assertNull(managedEmp.getManagedEmployees());
- }
- }
-
- }
- }
-
- /**
- * What we do: - read Employee with Fetchplan NOT containing phoneNumbers =>
- * test fails because the detached instance contains attributes not included
- * in Fetchplan (=> should throw a "lazy" exception which would lead to
- * successful test).
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testAddOnRelationNotDetached() throws Exception {
- EntityManager em = getEntityManager();
- em.getTransaction().begin();
- // Find
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
- FetchPlan fetchplan = new FetchPlan(Employee.class);
- fetchplan.addAttribute("address");
-
- List<Employee> emps = query.getResultList();
-
- JpaFetchPlanHelper.fetch(em, fetchplan, emps);
-
- Employee empToDetach = emps.get(0);
- Employee detEmp = (Employee) JpaFetchPlanHelper.copy(em, fetchplan, empToDetach);
-
- // End of Transaction
- em.getTransaction().commit();
-
- // Client edits data
- try {
- detEmp.addPhoneNumber(new PhoneNumber("office", "+49", "1234567"));
- fail("phoneNumbers should be null");
- } catch (Exception ignore) {
- }
-
- }
-
- /**
- * same as before but here we - read Employee with Fetchplan containing
- * phoneNumbers - try to detach this Employee WITHOUT phoneNumbers but
- * unfortunately the detached Employee still contains phoneNumber => test
- * fails because the copy does not "unload" relations which are not
- * configured in Fetchplan but are loaded in the source of the copy.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testAddOnRelationNotDetached2() throws Exception {
- EntityManager em = getEntityManager();
- em.getTransaction().begin();
- // Find
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- query.setHint(QueryHints.BATCH, "e.address");
- query.setHint(QueryHints.BATCH, "e.phoneNumbers");
-
- List<Employee> emps = query.getResultList();
-
- FetchPlan fetchplan = new FetchPlan(Employee.class);
- fetchplan.addAttribute("address");
- fetchplan.addAttribute("phoneNumbers");
-
- JpaFetchPlanHelper.fetch(em, fetchplan, emps);
-
- Employee empToDetach = emps.get(0);
-
- // define smaller fetchplan
- FetchPlan fetchplan2 = new FetchPlan(Employee.class);
- fetchplan.addAttribute("address");
-
- // Detach with smaller Fetchplan
- Employee detEmp = (Employee) JpaFetchPlanHelper.copy(em, fetchplan2, empToDetach);
-
- // End of Transaction
- em.getTransaction().commit();
-
- // Client edits data
- try {
- detEmp.addPhoneNumber(new PhoneNumber("office", "+49", "1234567"));
- fail("phoneNumbers should be null");
- } catch (Exception ignore) {
- }
- }
-
- /**
- * This test shows that reading, detaching, changing and re-attaching
- * relations contained in Fetchplan works.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testFindDetachChangeAttachCompleteProcessWithBiggerFetchplan() throws Exception {
- int cntSQL = 0;
- EntityManager em = getEntityManager();
- em.getTransaction().begin();
- // Find
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- query.setHint(QueryHints.BATCH, "e.address");
- query.setHint(QueryHints.BATCH, "e.phoneNumbers");
-
- List<Employee> emps = query.getResultList();
-
- FetchPlan fetchplan = new FetchPlan(Employee.class);
- fetchplan.addAttribute("address");
- fetchplan.addAttribute("phoneNumbers");
-
- JpaFetchPlanHelper.fetch(em, fetchplan, emps);
-
- Employee empToDetach = emps.get(0);
- int cntPhones = empToDetach.getPhoneNumbers().size();
-
- // if fetched with large fetchplan, for fetchplan entries is no lazy
- // load recommended
- cntSQL = getQuerySQLTracker(em).getTotalSQLCalls();
- empToDetach.getPhoneNumbers().get(0).getNumber();
- assertEquals(cntSQL, getQuerySQLTracker(em).getTotalSQLCalls());
-
- // Detach with "bigger" FetchPlan containing FG
- FetchPlan fetchplan2 = new FetchPlan(Employee.class);
- fetchplan2.addAttribute("address");
- fetchplan2.addAttribute("phoneNumbers");
- fetchplan2.addAttribute("firstName");
- Employee detEmp = (Employee) JpaFetchPlanHelper.copy(em, fetchplan2, empToDetach);
-
- // End of Transaction
- em.getTransaction().commit();
-
- // Client edits data, is allowed to access on phonenumbers
- detEmp.addPhoneNumber(new PhoneNumber("office", "+49", "1234567"));
- detEmp.setFirstName(detEmp.getFirstName() + "-x");
-
- // Begin of second transaction
- em.getTransaction().begin();
-
- // Attach with larger fetchplan
- Employee attEmp = (Employee) JpaFetchPlanHelper.merge(em, fetchplan2, detEmp);
-
- // check, if new Phonenumber is added
- assertEquals(cntPhones + 1, attEmp.getPhoneNumbers().size());
- // check, if detached changes are merged
- assertTrue(attEmp.getFirstName().endsWith("-x"));
-
- em.flush();
- em.getTransaction().rollback();
- }
-
- /**
- * Even after serialization, entity object contains relations which should
- * not be loaded.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testFetchWithBiggerFetchplan() throws Exception {
- EntityManager em = getEntityManager();
- em.getTransaction().begin();
- // Find
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
-
- List<Employee> emps = query.getResultList();
-
- FetchPlan fetchplan = new FetchPlan(Employee.class);
- fetchplan.addAttribute("firstName");
- fetchplan.addAttribute("phoneNumbers");
-
- JpaFetchPlanHelper.fetch(em, fetchplan, emps);
-
- Employee empToDetach = emps.get(0);
- // just test the fetch, not the detach; serialize in order to avoid lazy
- // loading
- Employee detEmp = (Employee) SerializationHelper.clone(empToDetach);
- detEmp.getPhoneNumbers().size();
- // check address - not in Fetchplan
- try {
- detEmp.getAddress();
- fail("address should be null");
- } catch (Exception ignore) {
- }
-
- // Detach with "bigger" Fetchplan
- FetchPlan fetchplan2 = new FetchPlan(Employee.class);
- fetchplan.addAttribute("firstName");
- fetchplan2.addAttribute("address");
- fetchplan2.addAttribute("phoneNumbers");
- // just test the fetch, not the detach
- JpaFetchPlanHelper.fetch(em, fetchplan, emps);
- empToDetach = emps.get(0);
- // just test the fetch, not the detach; serialize in order to avoid lazy
- // loading
- detEmp = (Employee) SerializationHelper.clone(empToDetach);
-
- // now loaded
- try {
- detEmp.getAddress();
- } catch (ValidationException ve) {
- assertEquals("Expected ValidationException::" + ValidationException.INSTANTIATING_VALUEHOLDER_WITH_NULL_SESSION, ValidationException.INSTANTIATING_VALUEHOLDER_WITH_NULL_SESSION, ve.getErrorCode());
- return;
- } finally {
- em.getTransaction().rollback();
- }
- fail("serialize employee getAddress should thrown ValidationException");
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/.classpath b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/.classpath
deleted file mode 100644
index b5746ea..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry excluding="**/.svn/**" kind="src" path="src"/>
- <classpathentry excluding="**/.svn/**" kind="src" path="test-src"/>
- <classpathentry combineaccessrules="false" exported="true" kind="src" path="/org.eclipse.persistence.example.jpa.employee.xml"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_17 (eclipselink-agent trunk)"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/.project b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/.project
deleted file mode 100644
index 0498144..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.persistence.example.jpa.nested-fetchgroup</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/.settings/org.eclipse.jdt.core.prefs b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 886d90a..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,66 +0,0 @@
-#Wed Nov 04 07:31:15 EST 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/AllTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/AllTests.java
deleted file mode 100644
index 3f00301..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/AllTests.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 273057: NestedFetchGroup Example
- ******************************************************************************/
-package test;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { FetchGroupAPITests.class,
- FetchGroupValidateTests.class,
- SimpleDefaultFetchGroupTests.class,
- SimpleFetchGroupTests.class,
- SimpleNamedFetchGroupTests.class,
- NestedDefaultFetchGroupTests.class,
- NestedFetchGroupTests.class,
- NestedNamedFetchGroupTests.class,
- SimpleSerializeFetchGroupTests.class,
- FetchGroupTrackerWeavingTests.class})
-public class AllTests {
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/BaseFetchGroupTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/BaseFetchGroupTests.java
deleted file mode 100644
index 79e446f..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/BaseFetchGroupTests.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug TBD: Initial Implementation
- ******************************************************************************/
-package test;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
-import static test.FetchGroupAssert.assertFetchedAttribute;
-import static test.FetchGroupAssert.assertNotFetchedAttribute;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-
-import model.Employee;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.eclipse.persistence.queries.ObjectLevelReadQuery;
-
-import testing.EclipseLinkJPATest;
-import example.Queries;
-
-/**
- * Simple set of tests that verify the {@link FetchGroup} API. Need to verify
- * that the nesting and default behaves as expected.
- *
- * @author dclarke
- * @since EclipseLink 2.1
- */
-@PersistenceContext(unitName = "employee")
-public abstract class BaseFetchGroupTests extends EclipseLinkJPATest {
-
- public void managerFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- // Use q query since find will only use default fetch group
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
-
- FetchGroup managerFG = new FetchGroup();
- managerFG.addAttribute("manager");
- query.setHint(QueryHints.FETCH_GROUP, managerFG);
-
- assertNotNull(JpaHelper.getReadAllQuery(query).getFetchGroup());
- assertSame(managerFG, JpaHelper.getReadAllQuery(query).getFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertFetchedAttribute(getEMF(), emp, "id");
- assertNotFetchedAttribute(getEMF(), emp, "firstName");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertFetchedAttribute(getEMF(), emp, "manager");
- assertFetchedAttribute(getEMF(), emp, "address");
- assertFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertFetchedAttribute(getEMF(), emp, "projects");
-
- emp.getManager();
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getLastName();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- public void employeeNamesFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- int minId = Queries.minimumEmployeeId(em);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // Use q query since find will only use default fetch group
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", minId);
-
- FetchGroup namesFG = new FetchGroup();
- namesFG.addAttribute("firstName");
- namesFG.addAttribute("lastName");
- query.setHint(QueryHints.FETCH_GROUP, namesFG);
-
- assertNotNull(JpaHelper.getReadAllQuery(query).getFetchGroup());
- assertSame(namesFG, JpaHelper.getReadAllQuery(query).getFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "firstName");
- assertFetchedAttribute(getEMF(), emp, "lastName");
- assertFetchedAttribute(getEMF(), emp, "gender");
- assertFetchedAttribute(getEMF(), emp, "salary");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertFetchedAttribute(getEMF(), emp, "manager");
- assertFetchedAttribute(getEMF(), emp, "address");
- assertFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertFetchedAttribute(getEMF(), emp, "projects");
-
- emp.getId();
- emp.getFirstName();
- emp.getLastName();
- emp.getVersion();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getGender();
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetchedAttribute(getEMF(), emp, "gender");
- assertFetchedAttribute(getEMF(), emp, "salary");
-
- emp.getSalary();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getManager();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetchedAttribute(getEMF(), emp, "manager");
- }
-
- public void joinFetchEmployeeAddressWithDynamicFetchGroup() {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address");
-
- FetchGroup fetchGroup = new FetchGroup("names");
- fetchGroup.addAttribute("firstName");
- fetchGroup.addAttribute("lastName");
- query.setHint(QueryHints.FETCH_GROUP, fetchGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- }
-
- public void joinFetchEmployeeAddressPhoneWithDynamicFetchGroup() {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT p.id FROM PhoneNumber p)");
-
- FetchGroup fetchGroup = new FetchGroup("names");
- fetchGroup.addAttribute("firstName");
- fetchGroup.addAttribute("lastName");
- query.setHint(QueryHints.FETCH_GROUP, fetchGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- }
-
- protected Employee findMinimumEmployee(EntityManager em) {
- List<Employee> emps = em.createQuery("SELECT e FROM Employee e WHERE e.id in (SELECT MIN(ee.id) FROM Employee ee)").getResultList();
-
- assertNotNull("Null returned for min employee query", emps);
- assertEquals("No results returned for Mmin employee query", 1, emps.size());
-
- return emps.get(0);
- }
-
- public FetchGroup<?> assertHasFetchGroup(Object entity) {
- assertNotNull("Entity is null", entity);
- assertTrue("Entity does not implement FetchGroupTracker", entity instanceof FetchGroupTracker);
- assertNotNull("Entity does not have FetchGroup", ((FetchGroupTracker) entity)._persistence_getFetchGroup());
-
- return ((FetchGroupTracker) entity)._persistence_getFetchGroup();
- }
-
- protected FetchGroup getFetchGroup(Object object) {
- assertNotNull("Cannot get a FetchGroup from null", object);
-
- if (object instanceof Query) {
- return getFetchGroup((Query) object);
- }
- if (object instanceof ObjectLevelReadQuery) {
- return getFetchGroup((ObjectLevelReadQuery) object);
- }
- assertTrue("Entity " + object + " does not implement FetchGroupTracker", object instanceof FetchGroupTracker);
-
- FetchGroupTracker tracker = (FetchGroupTracker) object;
- return tracker._persistence_getFetchGroup();
- }
-
- protected FetchGroup getFetchGroup(Query query) {
- return getFetchGroup(JpaHelper.getReadAllQuery(query));
- }
-
- protected FetchGroup getFetchGroup(ObjectLevelReadQuery readQuery) {
- if (readQuery.hasFetchGroup()) {
- return readQuery.getFetchGroup();
- }
- if (readQuery.shouldUseDefaultFetchGroup() && !readQuery.isPrepared()) {
- ClassDescriptor desc = JpaHelper.getServerSession(getEMF()).getClassDescriptor(readQuery.getReferenceClass());
- if (desc.hasFetchGroupManager()) {
- return desc.getFetchGroupManager().getDefaultFetchGroup();
- }
- }
- return null;
- }
-
- public void assertConfig(EntityManagerFactory emf, String entityName, FetchGroup defaultFetchGroup, Integer numNamedFetchGroups) {
- ClassDescriptor descriptor = JpaHelper.getServerSession(emf).getClassDescriptorForAlias(entityName);
- assertNotNull("Not descriptor found for: " + entityName, descriptor);
-
- assertTrue("FetchGroupTracker not implemented by: " + entityName, FetchGroupTracker.class.isAssignableFrom(descriptor.getJavaClass()));
-
- if (defaultFetchGroup == null) {
- assertNull("Default FetchGroup not null: " + entityName, descriptor.getFetchGroupManager().getDefaultFetchGroup());
- } else {
- assertEquals("Default FetchGroup does not match", defaultFetchGroup, descriptor.getFetchGroupManager().getDefaultFetchGroup());
- if (descriptor.getDescriptorQueryManager().hasReadObjectQuery() && !descriptor.getDescriptorQueryManager().getReadObjectQuery().shouldUseDefaultFetchGroup()) {
- assertEquals("DescriptorQueryManager.readObjectQuery.fetchGroup does not match", defaultFetchGroup, descriptor.getDescriptorQueryManager().getReadObjectQuery().getFetchGroup());
- }
- if (descriptor.getDescriptorQueryManager().hasReadAllQuery() && !descriptor.getDescriptorQueryManager().getReadAllQuery().shouldUseDefaultFetchGroup()) {
- assertEquals("DescriptorQueryManager.readAllQuery.fetchGroup does not match", defaultFetchGroup, descriptor.getDescriptorQueryManager().getReadAllQuery().getFetchGroup());
- }
- }
-
- if (numNamedFetchGroups != null) {
- assertEquals("Incorrect number of Named FetchGroups: " + entityName, numNamedFetchGroups.intValue(), descriptor.getFetchGroupManager().getFetchGroups().size());
- }
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/FetchGroupAPITests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/FetchGroupAPITests.java
deleted file mode 100644
index 23cf3eb..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/FetchGroupAPITests.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 273057: NestedFetchGroup Example
- ******************************************************************************/
-package test;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
-
-import javax.persistence.PersistenceContext;
-
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.FetchGroup.FetchItem;
-import org.junit.Test;
-
-import testing.EclipseLinkJPATest;
-
-/**
- * Simple tests to verify the functionality of FetchGroup API
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-@PersistenceContext(unitName = "employee")
-public class FetchGroupAPITests extends EclipseLinkJPATest {
-
- @Test
- public void verifyDefaultConstructor() {
- FetchGroup fg = new FetchGroup();
-
- assertNull("default FetchGroup name not null", fg.getName());
- assertTrue(fg.getFetchItems().isEmpty());
- }
-
- @Test
- public void verifyNameConstructor() {
- FetchGroup fg = new FetchGroup("Test");
-
- assertEquals("Test name not set", "Test", fg.getName());
- assertTrue(fg.getFetchItems().isEmpty());
- fg.toString();
- }
-
- @Test
- public void verifyNameConstructor_Null() {
- FetchGroup fg = new FetchGroup(null);
-
- assertNull("Null name not set", fg.getName());
- assertTrue(fg.getFetchItems().isEmpty());
- fg.toString();
- }
-
- private void verifyInvalid(String arg) {
- FetchGroup fg = new FetchGroup();
-
- try {
- fg.addAttribute(arg);
- } catch (IllegalArgumentException iae) {
- return;
- }
- fail("IllegalArgumentException expected but not caught.");
- }
-
- @Test
- public void verifyInvalidAdd_null() {
- verifyInvalid(null);
- }
-
- @Test
- public void verifyInvalidAdd_empty() {
- verifyInvalid("");
- }
-
- @Test
- public void verifyInvalidAdd_dot() {
- verifyInvalid(".");
- verifyInvalid("..");
- verifyInvalid(". ");
- verifyInvalid(" .");
- verifyInvalid(" . ");
- verifyInvalid(". .");
- }
-
- @Test
- public void verifyInvalidAdd_startWithDot() {
- verifyInvalid(".name");
- }
-
- @Test
- public void verifyInvalidAdd_endWithDot() {
- verifyInvalid("name.");
- }
-
- @Test
- public void verifyInvalidAdd_space() {
- verifyInvalid(" ");
- verifyInvalid("\t");
- verifyInvalid("\n");
- verifyInvalid("\r");
- }
-
- /**
- * Verify that {@link FetchGroup#getFetchItem(String)} works properly on an
- * empty FetchGroup.
- */
- @Test
- public void verifygetFetchItem_EmptyFG() {
- FetchGroup fg = new FetchGroup();
-
- assertTrue(fg.getFetchItems().isEmpty());
-
- assertNull(fg.getFetchItem("test"));
- assertNull(fg.getFetchItem("a.b"));
-
- assertTrue(fg.getFetchItems().isEmpty());
- }
-
- @Test
- public void verifyAddAttribute() {
- FetchGroup fg = new FetchGroup();
-
- fg.addAttribute("test");
-
- assertEquals(1, fg.getFetchItems().size());
- assertTrue(fg.getFetchItems().containsKey("test"));
- assertNotNull(fg.getFetchItems().get("test"));
-
- FetchItem item = fg.getFetchItem("test");
- assertNotNull(item);
-
- assertEquals("test", item.getAttributeName());
- }
-
- @Test
- public void verifyAddAttribute_Nested() {
- FetchGroup fg = new FetchGroup();
-
- fg.addAttribute("test.test");
-
- assertEquals(1, fg.getFetchItems().size());
- assertTrue(fg.getFetchItems().containsKey("test"));
-
- FetchItem testFI = (FetchItem) fg.getFetchItems().get("test");
- assertNotNull(testFI);
- assertEquals("test", testFI.getAttributeName());
- assertNotNull(testFI.getFetchGroup());
- assertEquals("test", testFI.getFetchGroup().getName());
-
- testFI = fg.getFetchItem("test");
- assertNotNull(testFI);
- assertEquals("test", testFI.getAttributeName());
- assertEquals(1, testFI.getFetchGroup().getFetchItems().size());
- assertTrue(testFI.getFetchGroup().getFetchItems().containsKey("test"));
- assertNotNull(testFI.getFetchGroup().getFetchItem("test"));
- }
-
- @Test
- public void verifyAdd2AttributesNestedFG() {
- FetchGroup fg = new FetchGroup();
-
- fg.addAttribute("a.b");
- fg.addAttribute("a.c");
-
- assertEquals(1, fg.getFetchItems().size());
- assertTrue(fg.getFetchItems().containsKey("a"));
-
- FetchItem aItem = fg.getFetchItem("a");
- FetchGroup aFG = aItem.getFetchGroup();
-
- assertNotNull(aItem);
- assertNotNull(aFG);
- assertFalse(aItem.useDefaultFetchGroup());
- assertEquals(2, aFG.getFetchItems().size());
- assertEquals("a", aFG.getName());
-
- FetchItem bItem = aFG.getFetchItem("b");
- assertNotNull(bItem);
- assertEquals("b", bItem.getAttributeName());
- assertNull(bItem.getFetchGroup());
- assertTrue(bItem.useDefaultFetchGroup());
- assertSame(bItem, fg.getFetchItem("a.b"));
-
- FetchItem cItem = aFG.getFetchItem("c");
- assertNotNull(cItem);
- assertEquals("c", cItem.getAttributeName());
- assertNull(cItem.getFetchGroup());
- assertTrue(cItem.useDefaultFetchGroup());
- assertSame(cItem, fg.getFetchItem("a.c"));
- }
-
- @Test
- public void verifyAdd2AttributesNestedFG_parentFirst() {
- FetchGroup fg = new FetchGroup();
-
- fg.addAttribute("a");
- fg.addAttribute("a.b");
- fg.addAttribute("a.c");
-
- assertEquals(1, fg.getFetchItems().size());
- assertTrue(fg.getFetchItems().containsKey("a"));
-
- FetchItem aItem = fg.getFetchItem("a");
- FetchGroup aFG = aItem.getFetchGroup();
-
- assertNotNull(aItem);
- assertNotNull(aFG);
- assertFalse(aItem.useDefaultFetchGroup());
- assertEquals(2, aFG.getFetchItems().size());
- assertEquals("a", aFG.getName());
-
- FetchItem bItem = aFG.getFetchItem("b");
- assertNotNull(bItem);
- assertEquals("b", bItem.getAttributeName());
- assertNull(bItem.getFetchGroup());
- assertTrue(bItem.useDefaultFetchGroup());
- assertSame(bItem, fg.getFetchItem("a.b"));
-
- FetchItem cItem = aFG.getFetchItem("c");
- assertNotNull(cItem);
- assertEquals("c", cItem.getAttributeName());
- assertNull(cItem.getFetchGroup());
- assertTrue(cItem.useDefaultFetchGroup());
- assertSame(cItem, fg.getFetchItem("a.c"));
- }
-
- @Test
- public void verifyAddAttribute_Nested2() {
- FetchGroup fg = new FetchGroup();
-
- fg.addAttribute("test.test.test");
-
- assertEquals(1, fg.getFetchItems().size());
- assertTrue(fg.getFetchItems().containsKey("test"));
-
- FetchItem testFI = (FetchItem) fg.getFetchItems().get("test");
- assertNotNull(testFI);
- assertEquals("test", testFI.getAttributeName());
-
- testFI = fg.getFetchItem("test");
- assertNotNull(testFI);
- assertEquals("test", testFI.getAttributeName());
- assertNotNull(testFI.getFetchGroup());
-
- FetchItem testFI2 = (FetchItem) testFI.getFetchGroup().getFetchItems().get("test");
- assertNotNull(testFI2);
- assertEquals("test", testFI2.getAttributeName());
- assertNotNull(testFI2.getFetchGroup());
- assertEquals("test.test", testFI2.getFetchGroup().getName());
- assertFalse(testFI2.getFetchGroup().getFetchItems().isEmpty());
-
- testFI2 = testFI.getFetchGroup().getFetchItem("test");
- assertNotNull(testFI2);
- assertEquals("test", testFI2.getAttributeName());
- assertFalse(testFI2.getFetchGroup().getFetchItems().isEmpty());
- assertEquals(1, testFI2.getFetchGroup().getFetchItems().size());
- assertTrue(testFI2.getFetchGroup().getFetchItems().containsKey("test"));
- assertNotNull(testFI2.getFetchGroup().getFetchItems().get("test"));
-
- testFI2 = fg.getFetchItem("test.test");
- assertNotNull(testFI2);
- assertEquals("test.test", testFI2.getFetchGroup().getName());
- }
-
- @Test
- public void verifyAdd() {
- FetchGroup fg = new FetchGroup();
-
- fg.addAttribute("test");
-
- assertEquals(1, fg.getFetchItems().size());
- assertTrue(fg.getFetchItems().containsKey("test"));
- assertNotNull(fg.getFetchItems().get("test"));
- assertNotNull(fg.getFetchItem("test"));
- }
-
- @Test
- public void verifyAdd_Nested() {
- FetchGroup<?> fg = new FetchGroup();
- fg.addAttribute("test.test");
-
- assertEquals(1, fg.getFetchItems().size());
- assertTrue(fg.getFetchItems().containsKey("test"));
-
- FetchItem testFI = fg.getFetchItems().get("test");
- assertNotNull(testFI);
- assertEquals("test", testFI.getAttributeName());
-
- testFI = fg.getFetchItem("test");
- assertNotNull(testFI);
- assertEquals("test", testFI.getAttributeName());
- assertEquals(1, testFI.getFetchGroup().getFetchItems().size());
- assertTrue(testFI.getFetchGroup().getFetchItems().containsKey("test"));
- assertNotNull(testFI.getFetchGroup().getFetchItem("test"));
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/FetchGroupAssert.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/FetchGroupAssert.java
deleted file mode 100644
index 432da60..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/FetchGroupAssert.java
+++ /dev/null
@@ -1,263 +0,0 @@
-package test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Collection;
-import java.util.Map;
-
-import javax.persistence.EntityManagerFactory;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.descriptors.VersionLockingPolicy;
-import org.eclipse.persistence.exceptions.QueryException;
-import org.eclipse.persistence.indirection.IndirectContainer;
-import org.eclipse.persistence.indirection.ValueHolderInterface;
-import org.eclipse.persistence.internal.queries.ManagedFetchItem;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.mappings.ForeignReferenceMapping;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.eclipse.persistence.queries.FetchGroup.FetchItem;
-import org.eclipse.persistence.sessions.server.Server;
-
-/**
- * Test utility to verify the state of entities after they are loaded, copied,
- * or detached with respect to a defined FetchGroup.
- *
- * @author dclarke
- * @since EclipseLink 2.1.0
- */
-public class FetchGroupAssert {
-
- /**
- * Verify that a FetchGroup is valid with respect to the mappings of the
- * provided entity class.
- */
- public static boolean isValid(FetchGroup<?> fetchGroup, EntityManagerFactory emf, Class<?> entityClass) {
- assertNotNull(fetchGroup);
-
- try {
- for (Map.Entry<String, FetchItem> entry : fetchGroup.getFetchItems().entrySet()) {
- ManagedFetchItem itemImpl = (ManagedFetchItem) entry.getValue();
- DatabaseMapping mapping = itemImpl.getMapping(JpaHelper.getServerSession(emf), entityClass);
-
- if (mapping.isForeignReferenceMapping()) {
- if (itemImpl.getFetchGroup() != null) {
- if (!isValid(itemImpl.getFetchGroup(), emf, ((ForeignReferenceMapping) mapping).getReferenceClass())) {
- return false;
- }
- }
- } else {
- return false;
- }
- }
- } catch (QueryException qe) {
- return false;
- }
- return true;
- }
-
- /**
- * Verify that the attribute path specified is loaded in the provided entity
- */
- public static void assertFetchedAttribute(EntityManagerFactory emf, Object entity, String... attribute) {
- assertNotNull("EntityManagerFactory is null", emf);
- assertNotNull("Entity is null", entity);
- Server session = JpaHelper.getServerSession(emf);
- assertNotNull("No Server session found for: " + emf, session);
- ClassDescriptor desc = session.getClassDescriptor(entity);
- assertNotNull("No descriptor found for: " + entity, desc);
-
- Object value = entity;
- if (attribute.length > 1) {
- String attrName = attribute[1];
-
- if (desc.hasFetchGroupManager()) {
- assertTrue("Attribute: '" + attrName + "' not fetched on: " + value, desc.getFetchGroupManager().isAttributeFetched(session, value, attrName));
- }
- DatabaseMapping mapping = desc.getMappingForAttributeName(attrName);
- value = mapping.getAttributeValueFromObject(value);
-
- if (value instanceof IndirectContainer) {
- value = ((IndirectContainer) value).getValueHolder();
- }
- if (value instanceof ValueHolderInterface) {
- ValueHolderInterface vhi = (ValueHolderInterface) value;
- assertTrue("ValueHolder for: '" + attrName + "' not instantiated", vhi.isInstantiated());
- value = vhi.getValue();
- }
- String[] tail = new String[attribute.length - 1];
- System.arraycopy(attribute, 1, tail, 0, attribute.length - 1);
- if (value instanceof Collection<?>) {
- for (Object obj : ((Collection<?>) value)) {
- assertFetchedAttribute(emf, value, tail);
- }
- } else {
- assertFetchedAttribute(emf, value, tail);
- }
- } else {
- // This is where the actual end attribute in the path is validated.
- if (desc.hasFetchGroupManager()) {
- assertTrue(desc.getFetchGroupManager().isAttributeFetched(session, value, attribute[0]));
- }
- }
- }
-
- /**
- * Verify that the attribute path is loaded.
- */
- public static void assertNotFetchedAttribute(EntityManagerFactory emf, Object entity, String... attribute) {
- assertNotNull("EntityManagerFactory is null", emf);
- assertNotNull("Entity is null", entity);
- Server session = JpaHelper.getServerSession(emf);
- assertNotNull("No Server session found for: " + emf, session);
- ClassDescriptor desc = session.getClassDescriptor(entity);
- assertNotNull("No descriptor found for: " + entity, desc);
-
- Object value = entity;
- for (int index = 0; index < attribute.length - 1; index++) {
- String attrName = attribute[index];
-
- if (desc.hasFetchGroupManager()) {
- assertTrue("Attribute: '" + attrName + "' not fetched on: " + value, desc.getFetchGroupManager().isAttributeFetched(session, value, attrName));
- }
- DatabaseMapping mapping = desc.getMappingForAttributeName(attrName);
- value = mapping.getAttributeValueFromObject(value);
-
- if (value instanceof IndirectContainer) {
- value = ((IndirectContainer) value).getValueHolder();
- }
- if (value instanceof ValueHolderInterface) {
- ValueHolderInterface vhi = (ValueHolderInterface) value;
- assertTrue("ValueHolder for: '" + attrName + "' not instantiated", vhi.isInstantiated());
- value = vhi.getValue();
- }
- }
- }
-
- /**
- * Assert that the entity provided has the attributes defined in the
- * FetchGroup loaded.
- *
- * @param emf
- * @param entity
- * @param fetchGroup
- */
- public static void assertFetched(EntityManagerFactory emf, Object entity, FetchGroup fetchGroup) {
- assertNotNull("Null entity", entity);
- assertNotNull("No FetchGroup provided", fetchGroup);
- if (!(entity instanceof FetchGroupTracker)) {
- System.out.println();
- }
- assertTrue("Entity does not implement FetchGroupTracker: " + entity, entity instanceof FetchGroupTracker);
-
- FetchGroupTracker tracker = (FetchGroupTracker) entity;
- assertNotNull("FetchGroup on entity is null", tracker._persistence_getFetchGroup());
- // assertEquals("FetchGroup on entity does not equal provided",
- // fetchGroup, tracker._persistence_getFetchGroup());
-
- Server session = JpaHelper.getServerSession(emf);
- assertNotNull(session);
- ClassDescriptor descriptor = session.getClassDescriptor(entity);
- assertNotNull(descriptor);
- assertTrue("", descriptor.getJavaClass().isAssignableFrom(entity.getClass()));
-
- for (DatabaseMapping mapping : descriptor.getMappings()) {
- if (descriptor.getObjectBuilder().getPrimaryKeyMappings().contains(mapping)) {
- assertTrue("PrimaryKey mapping not fetched: " + entity, tracker._persistence_isAttributeFetched(mapping.getAttributeName()));
- } else if (descriptor.usesOptimisticLocking() && descriptor.getOptimisticLockingPolicy() instanceof VersionLockingPolicy && ((VersionLockingPolicy) descriptor.getOptimisticLockingPolicy()).getVersionMapping() == mapping) {
- assertTrue("Optimistic version mapping not fetched: " + entity, tracker._persistence_isAttributeFetched(mapping.getAttributeName()));
- } else if (tracker._persistence_getFetchGroup().containsAttribute(mapping.getAttributeName())) {
- assertTrue(tracker._persistence_isAttributeFetched(mapping.getAttributeName()));
- FetchItem attrFI = tracker._persistence_getFetchGroup().getFetchItem(mapping.getAttributeName());
- if (attrFI.getFetchGroup() != null) {
- Object value = mapping.getAttributeValueFromObject(entity);
- if (value instanceof IndirectContainer) {
- assertTrue(((IndirectContainer) value).isInstantiated());
- Collection<?> values = (Collection<?>) value;
- for (Object val : values) {
- assertFetched(emf, val, attrFI.getFetchGroup());
- }
- return;
- }
- if (value instanceof ValueHolderInterface) {
- assertTrue(((ValueHolderInterface) value).isInstantiated());
- value = ((ValueHolderInterface) value).getValue();
- }
- if (value != null) {
- assertFetched(emf, value, attrFI.getFetchGroup());
- }
- }
- } else { // Should not be fetched
- assertFalse(tracker._persistence_isAttributeFetched(mapping.getAttributeName()));
- }
- }
- }
-
- public static void assertDefaultFetched(EntityManagerFactory emf, Object entity) {
- assertNotNull("Null entity", entity);
-
- ClassDescriptor descriptor = JpaHelper.getServerSession(emf).getClassDescriptor(entity);
- assertNotNull("No descriptor found for: " + entity, descriptor);
-
- assertTrue("No FetchGroupManager on: " + descriptor, descriptor.hasFetchGroupManager());
-
- FetchGroup<?> defaultFG = descriptor.getFetchGroupManager().getDefaultFetchGroup();
-
- assertNotNull("No default FetchGroup on: " + descriptor, defaultFG);
-
- assertFetched(emf, entity, defaultFG);
- }
-
- public static void assertFetched(EntityManagerFactory emf, Object entity, String fetchGroupName) {
- assertNotNull("Null entity", entity);
-
- ClassDescriptor descriptor = JpaHelper.getServerSession(emf).getClassDescriptor(entity);
- assertNotNull("No descriptor found for: " + entity, descriptor);
-
- assertTrue("No FetchGroupManager on: " + descriptor, descriptor.hasFetchGroupManager());
-
- FetchGroup<?> fg = descriptor.getFetchGroupManager().getFetchGroup(fetchGroupName);
-
- assertNotNull("No FetchGroup named: " + fetchGroupName, fg);
-
- assertFetched(emf, entity, fg);
- }
-
- /**
- * Verify that the provided entity does not have a FetchGroup configured on
- * it.
- */
- public static void assertNoFetchGroup(EntityManagerFactory emf, Object entity) {
- if (entity instanceof FetchGroupTracker) {
- FetchGroupTracker tracker = (FetchGroupTracker) entity;
-
- assertNull("Entity: " + entity + " has: " + tracker._persistence_getFetchGroup(), tracker._persistence_getFetchGroup());
- }
- }
-
- public static void assertConfig(EntityManagerFactory emf, String entityName, FetchGroup defaultFetchGroup) throws Exception {
- assertConfig(emf, entityName, defaultFetchGroup, 0);
- }
-
- public static void assertConfig(EntityManagerFactory emf, String entityName, FetchGroup defaultFetchGroup, int numNamedFetchGroups) throws Exception {
- ClassDescriptor descriptor = JpaHelper.getServerSession(emf).getClassDescriptorForAlias(entityName);
- assertNotNull("Not descriptor found for: " + entityName, descriptor);
-
- assertTrue("FetchGroupTracker not implemented by: " + entityName, FetchGroupTracker.class.isAssignableFrom(descriptor.getJavaClass()));
-
- if (defaultFetchGroup == null) {
- assertNull("Default FetchGroup not null: " + entityName, descriptor.getFetchGroupManager().getDefaultFetchGroup());
- } else {
- assertEquals("Default FetchGroup does not match", defaultFetchGroup, descriptor.getFetchGroupManager().getDefaultFetchGroup());
- }
-
- assertEquals("Incorrect number of Named FetchGroups: " + entityName, numNamedFetchGroups, descriptor.getFetchGroupManager().getFetchGroups().size());
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/FetchGroupTrackerWeavingTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/FetchGroupTrackerWeavingTests.java
deleted file mode 100644
index 777426d..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/FetchGroupTrackerWeavingTests.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 244124: Nested FetchGroup Enhancement
- ******************************************************************************/
-package test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.PersistenceContext;
-
-import model.Address;
-import model.Employee;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.internal.jpa.weaving.ClassWeaver;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.junit.Test;
-
-import testing.EclipseLinkJPATest;
-
-/**
- * Test to verify changes made to {@link FetchGroupTracker} and
- * {@link ClassWeaver} are working as expected.
- *
- * @author dclarke
- * @since EclipseLink 2.1
- */
-@PersistenceContext(unitName = "employee")
-public class FetchGroupTrackerWeavingTests extends EclipseLinkJPATest {
-
- String checkAttribute = null;
- String checkForSetAttribute = null;
-
- @Test
- public void verifyCheckFetchedForSetWithFetchGroup() {
- Employee emp = new Employee();
- TestFetchGroup fg = new TestFetchGroup();
- fg.setOnEntity((FetchGroupTracker) emp);
-
- assertNull(this.checkAttribute);
- assertNull(this.checkForSetAttribute);
-
- emp.setFirstName("John");
-
- assertNull(this.checkAttribute);
- assertNotNull(this.checkForSetAttribute);
- assertEquals("firstName", this.checkForSetAttribute);
- }
-
- @Test
- public void verifyCheckFetchedWithFetchGroup() {
- Employee emp = new Employee();
- TestFetchGroup fg = new TestFetchGroup();
- fg.setOnEntity((FetchGroupTracker) emp);
-
- assertNull(this.checkAttribute);
- assertNull(this.checkForSetAttribute);
-
- emp.getFirstName();
-
- assertNull(this.checkForSetAttribute);
- assertNotNull(this.checkAttribute);
- assertEquals("firstName", this.checkAttribute);
- }
-
- @Test
- public void verifyCheckFetchedForSetWithFetchGroup_OneToOne() {
- Employee emp = new Employee();
- TestFetchGroup fg = new TestFetchGroup();
- fg.setOnEntity((FetchGroupTracker) emp);
-
- assertNull(this.checkAttribute);
- assertNull(this.checkForSetAttribute);
-
- emp.setAddress(new Address());
-
- assertNull(this.checkAttribute);
- assertNotNull(this.checkForSetAttribute);
- assertEquals("address", this.checkForSetAttribute);
- }
-
- @Test
- public void verifyCheckFetchedWithFetchGroup_OneToOne() {
- Employee emp = new Employee();
- TestFetchGroup fg = new TestFetchGroup();
- fg.setOnEntity((FetchGroupTracker) emp);
-
- assertNull(this.checkAttribute);
- assertNull(this.checkForSetAttribute);
-
- Address addr = emp.getAddress();
-
- assertNull(addr);
- assertNull(this.checkForSetAttribute);
- assertNotNull(this.checkAttribute);
- assertEquals("address", this.checkAttribute);
- }
-
- @Test
- public void verifyCheckFetchedForSetWithFetchGroup_OneToMany() {
- Employee emp = new Employee();
- TestFetchGroup fg = new TestFetchGroup();
- fg.setOnEntity((FetchGroupTracker) emp);
-
- assertNull(this.checkAttribute);
- assertNull(this.checkForSetAttribute);
-
- emp.setPhoneNumbers(new ArrayList<PhoneNumber>());
-
- assertNull(this.checkAttribute);
- assertNotNull(this.checkForSetAttribute);
- assertEquals("phoneNumbers", this.checkForSetAttribute);
- }
-
- @Test
- public void verifyCheckFetchedWithFetchGroup_OneToMany() {
- Employee emp = new Employee();
- TestFetchGroup fg = new TestFetchGroup();
- fg.setOnEntity((FetchGroupTracker) emp);
-
- assertNull(this.checkAttribute);
- assertNull(this.checkForSetAttribute);
-
- List<PhoneNumber> phones = emp.getPhoneNumbers();
-
- assertNotNull(phones);
- assertTrue(phones instanceof ArrayList);
- assertTrue(phones.isEmpty());
-
- assertNull(this.checkForSetAttribute);
- assertNotNull(this.checkAttribute);
- assertEquals("phoneNumbers", this.checkAttribute);
- }
-
- class TestFetchGroup extends FetchGroup<Employee> {
-
- @Override
- public void checkFetched(FetchGroupTracker entity, String attributeName) {
- checkAttribute = attributeName;
- }
-
- @Override
- public void checkFetchedForSet(FetchGroupTracker entity, String attributeName) {
- checkForSetAttribute = attributeName;
- }
-
- // Bypass EntityFetchGroup wrapping done in FetchGroup
- @Override
- public void setOnEntity(FetchGroupTracker entity) {
- entity._persistence_setFetchGroup(this);
- }
-
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/FetchGroupValidateTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/FetchGroupValidateTests.java
deleted file mode 100644
index c21915a..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/FetchGroupValidateTests.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 273057: NestedFetchGroup Example
- ******************************************************************************/
-package test;
-
-import static test.FetchGroupAssert.isValid;
-import static org.junit.Assert.*;
-import javax.persistence.PersistenceContext;
-
-import model.Address;
-import model.Employee;
-
-import org.eclipse.persistence.queries.FetchGroup;
-import org.junit.Test;
-
-import testing.EclipseLinkJPATest;
-
-/**
- * Simple tests to verify the functionality of single level FetchGroup usage
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-@PersistenceContext(unitName = "employee")
-public class FetchGroupValidateTests extends EclipseLinkJPATest {
-
- @Test
- public void testVerify_EmptyFetchGroup() {
- FetchGroup<Employee> fg = new FetchGroup<Employee>();
-
- assertTrue(isValid(fg, getEMF(), Employee.class));
- assertTrue(isValid(fg, getEMF(), Address.class));
- }
-
- @Test
- public void testInvalidBasic() {
- FetchGroup<Employee> fg = new FetchGroup<Employee>();
- fg.addAttribute("invalid");
-
- assertFalse(isValid(fg, getEMF(), Employee.class));
- }
-
- @Test
- public void testInvalidRelationship() {
- FetchGroup<Employee> fg = new FetchGroup<Employee>();
- fg.addAttribute("invalid", new FetchGroup<Address>());
-
- assertFalse(isValid(fg, getEMF(), Employee.class));
- }
-
- @Test
- public void testInvalidNestedRelationship() {
- FetchGroup<Employee> fg = new FetchGroup<Employee>();
- fg.addAttribute("manager.invalid", new FetchGroup<Address>());
-
- assertFalse(isValid(fg, getEMF(), Employee.class));
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/JoinFetchTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/JoinFetchTests.java
deleted file mode 100644
index 763f519..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/JoinFetchTests.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package test;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.TypedQuery;
-
-import model.Employee;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.ReadAllQuery;
-import org.eclipse.persistence.sessions.DatabaseRecord;
-import org.junit.Test;
-
-import testing.EclipseLinkJPATest;
-
-@PersistenceContext(unitName="employee")
-public class JoinFetchTests extends EclipseLinkJPATest {
-
- @Test
- public void employeeFetchJoinAddress() {
- EntityManager em = getEntityManager();
-
- TypedQuery<Employee> q = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address", Employee.class);
-
- FetchGroup<Employee> fg = new FetchGroup<Employee>();
- fg.addAttribute("id");
- fg.addAttribute("version");
-
- q.setHint(QueryHints.FETCH_GROUP, fg);
-
- ReadAllQuery raq = JpaHelper.getReadAllQuery(q);
- raq.prepareCall(JpaHelper.getServerSession(getEMF()), new DatabaseRecord());
-
- List<Employee> emps = q.getResultList();
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/NestedDefaultFetchGroupTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/NestedDefaultFetchGroupTests.java
deleted file mode 100644
index 06fcd1e..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/NestedDefaultFetchGroupTests.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 273057: NestedFetchGroup Example
- ******************************************************************************/
-package test;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static test.FetchGroupAssert.*;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-
-import model.Address;
-import model.Employee;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.config.DescriptorCustomizer;
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.junit.Before;
-import org.junit.Test;
-
-import example.Queries;
-
-/**
- * Test named nested FetchGroup usage.
- *
- * @author dclarke
- * @since EclipseLink 2.1
- */
-public class NestedDefaultFetchGroupTests extends BaseFetchGroupTests {
-
- @Test
- public void findMinEmployee() {
- EntityManager em = getEntityManager();
- int minId = Queries.minEmployeeIdWithAddressAndPhones(em);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- Employee emp = em.find(Employee.class, minId);
-
- assertNotNull(emp);
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getAddress();
- emp.getPhoneNumbers().size();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, defaultEmployeeFG);
- assertFetchedAttribute(getEMF(), emp, "address");
- assertFetchedAttribute(getEMF(), emp, "phoneNumbers");
-
- // Check Address
- FetchGroup<Address> nestedAddressFG = defaultEmployeeFG.getFetchItem("address").getFetchGroup();
- assertFetched(getEMF(), emp.getAddress(), nestedAddressFG);
-
- // Check phones
- FetchGroup<PhoneNumber> nestedPhoneFG = defaultEmployeeFG.getFetchItem("phoneNumbers").getFetchGroup();
- for (PhoneNumber phone: emp.getPhoneNumbers()) {
- assertFetched(getEMF(), phone, nestedPhoneFG);
- }
- }
-
- @Test
- public void allAddress() {
- EntityManager em = getEntityManager();
-
-
- List<Address> allAddresses = em.createQuery("SELECT a FROM Address a", Address.class).getResultList();
-
- for (Address address: allAddresses) {
- assertNoFetchGroup(getEMF(), address);
- }
- }
-
- @Test
- public void allPhone() {
- EntityManager em = getEntityManager();
-
-
- List<PhoneNumber> allPhones = em.createQuery("SELECT p FROM PhoneNumber p", PhoneNumber.class).getResultList();
-
- for (PhoneNumber phone: allPhones) {
- assertFetched(getEMF(), phone, defaultPhoneFG);
- }
- }
-
- @Test
- public void singleResultMinEmployeeFetchJoinAddress() {
- EntityManager em = getEntityManager();
-
- TypedQuery<Employee> query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT MIN(p.id) FROM PhoneNumber p)", Employee.class);
- Employee emp = query.getSingleResult();
-
- assertNotNull(emp);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Override
- public EntityManager getEntityManager() {
- EntityManager em = super.getEntityManager();
-
- assertNotNull("Default Employee FetchGroup not available in test case", defaultEmployeeFG);
- assertNotNull("Default PhoneNumber FetchGroup not available in test case", defaultPhoneFG);
-
- assertConfig(getEMF(), "Employee", defaultEmployeeFG, 0);
- assertConfig(getEMF(), "Address", null, 0);
- assertConfig(getEMF(), "PhoneNumber", defaultPhoneFG, 0);
-
-
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
-
- return em;
- }
-
- @Override
- protected Map getEMFProperties() {
- Map properties = super.getEMFProperties();
- properties.put(PersistenceUnitProperties.DESCRIPTOR_CUSTOMIZER_ + "Employee", EmployeeCustomizer.class.getName());
- properties.put(PersistenceUnitProperties.DESCRIPTOR_CUSTOMIZER_ + "PhoneNumber", PhoneCustomizer.class.getName());
- return properties;
- }
-
- public static FetchGroup<Employee> defaultEmployeeFG;
-
- public static class EmployeeCustomizer implements DescriptorCustomizer {
-
- public void customize(ClassDescriptor descriptor) throws Exception {
- defaultEmployeeFG = new FetchGroup<Employee>("Employee.default");
- defaultEmployeeFG.addAttribute("firstName");
- defaultEmployeeFG.addAttribute("lastName");
- defaultEmployeeFG.addAttribute("address.country");
- defaultEmployeeFG.addAttribute("phoneNumbers.areaCode");
-
- descriptor.getFetchGroupManager().setDefaultFetchGroup(defaultEmployeeFG);
- }
-
- }
-
- private static FetchGroup<PhoneNumber> defaultPhoneFG;
-
- public static class PhoneCustomizer implements DescriptorCustomizer {
-
- public void customize(ClassDescriptor descriptor) throws Exception {
- defaultPhoneFG = new FetchGroup<PhoneNumber>("PhoneNumber.default");
- defaultPhoneFG.addAttribute("number");
- descriptor.getFetchGroupManager().setDefaultFetchGroup(defaultPhoneFG);
- }
-
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/NestedFetchGroupTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/NestedFetchGroupTests.java
deleted file mode 100644
index eb0e5d4..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/NestedFetchGroupTests.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 273057: FetchGroup Example
- ******************************************************************************/
-package test;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
-import static test.FetchGroupAssert.assertFetched;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import model.Address;
-import model.Employee;
-import model.Gender;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.Before;
-import org.junit.Test;
-
-
-public class NestedFetchGroupTests extends BaseFetchGroupTests {
-
- @Test
- public void dynamicFetchGroup_EmployeeAddress() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- query.setParameter("GENDER", Gender.Male);
-
- // Define the fields to be fetched on Employee
- FetchGroup fg = new FetchGroup();
- fg.addAttribute("id");
- fg.addAttribute("version");
- fg.addAttribute("firstName");
- fg.addAttribute("lastName");
- fg.addAttribute("address.city");
- fg.addAttribute("address.postalCode");
-
- // Configure the dynamic FetchGroup
- query.setHint(QueryHints.FETCH_GROUP, fg);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- for (Employee emp : emps) {
- FetchGroupTracker tracker = (FetchGroupTracker) emp;
-
- assertNotNull(tracker._persistence_getFetchGroup());
-
- // Verify specified fields plus mandatory ones are loaded
- assertTrue(tracker._persistence_isAttributeFetched("firstName"));
- assertTrue(tracker._persistence_isAttributeFetched("lastName"));
- assertTrue(tracker._persistence_isAttributeFetched("address"));
- FetchGroupTracker addrTracker = (FetchGroupTracker) emp.getAddress();
- assertTrue(addrTracker._persistence_isAttributeFetched("city"));
- assertTrue(addrTracker._persistence_isAttributeFetched("postalCode"));
- assertFalse(addrTracker._persistence_isAttributeFetched("street"));
-
- // Verify the other fields are not loaded
- assertFalse(tracker._persistence_isAttributeFetched("salary"));
- assertFalse(tracker._persistence_isAttributeFetched("startTime"));
- assertFalse(tracker._persistence_isAttributeFetched("endTime"));
-
- // Force the loading of lazy fields and verify
- emp.getSalary();
-
- assertTrue(tracker._persistence_isAttributeFetched("firstName"));
- assertTrue(tracker._persistence_isAttributeFetched("lastName"));
- assertTrue(tracker._persistence_isAttributeFetched("address"));
- assertTrue(tracker._persistence_isAttributeFetched("salary"));
- assertTrue(tracker._persistence_isAttributeFetched("startTime"));
- assertTrue(tracker._persistence_isAttributeFetched("endTime"));
-
- // Now we'll check the address uses the provided dynamic fetch-group
- addrTracker = (FetchGroupTracker) emp.getAddress();
- assertNotNull("Address does not have a FetchGroup", addrTracker._persistence_getFetchGroup());
- assertTrue(addrTracker._persistence_isAttributeFetched("city"));
- assertTrue(addrTracker._persistence_isAttributeFetched("postalCode"));
- assertFalse(addrTracker._persistence_isAttributeFetched("street"));
- assertFalse(addrTracker._persistence_isAttributeFetched("country"));
-
- // Now we'll check the phoneNumbers use of the default fetch group
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- FetchGroupTracker phoneTracker = (FetchGroupTracker) phone;
- assertNotNull("PhoneNumber does not have a FetchGroup", phoneTracker._persistence_getFetchGroup());
- assertTrue(phoneTracker._persistence_isAttributeFetched("number"));
- assertFalse(phoneTracker._persistence_isAttributeFetched("areaCode"));
- }
- }
- }
-
- @Test
- public void dynamicFetchGroup_Employee_NullAddress() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- query.setParameter("GENDER", Gender.Male);
-
- // Define the fields to be fetched on Employee
- FetchGroup empGroup = new FetchGroup();
- empGroup.addAttribute("firstName");
- empGroup.addAttribute("lastName");
- empGroup.addAttribute("address");
-
- // Define the fields to be fetched on Address
- FetchGroup addressGroup = new FetchGroup();
- addressGroup.addAttribute("city");
- addressGroup.addAttribute("postalCode");
-
- empGroup.addAttribute("address", null);
-
- // Configure the dynamic FetchGroup
- query.setHint(QueryHints.FETCH_GROUP, empGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- for (Employee emp : emps) {
- FetchGroupTracker tracker = (FetchGroupTracker) emp;
-
- assertNotNull(tracker._persistence_getFetchGroup());
-
- // Verify specified fields plus mandatory ones are loaded
- assertTrue(tracker._persistence_isAttributeFetched("id"));
- assertTrue(tracker._persistence_isAttributeFetched("firstName"));
- assertTrue(tracker._persistence_isAttributeFetched("lastName"));
- assertTrue(tracker._persistence_isAttributeFetched("version"));
-
- // Verify the other fields are not loaded
- assertFalse(tracker._persistence_isAttributeFetched("salary"));
- assertFalse(tracker._persistence_isAttributeFetched("startTime"));
- assertFalse(tracker._persistence_isAttributeFetched("endTime"));
-
- // Force the loading of lazy fields and verify
- emp.getSalary();
-
- assertTrue(tracker._persistence_isAttributeFetched("salary"));
- assertTrue(tracker._persistence_isAttributeFetched("startTime"));
- assertTrue(tracker._persistence_isAttributeFetched("endTime"));
-
- // Now we'll check the address uses the provided dynamic fetch-group
- FetchGroupTracker addrTracker = (FetchGroupTracker) emp.getAddress();
- assertNull("Address has an unexpected FetchGroup", addrTracker._persistence_getFetchGroup());
-
- // Now we'll check the phoneNumbers use of the default fetch group
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- FetchGroupTracker phoneTracker = (FetchGroupTracker) phone;
- assertNotNull("PhoneNumber does not have a FetchGroup", phoneTracker._persistence_getFetchGroup());
- assertTrue(phoneTracker._persistence_isAttributeFetched("number"));
- assertFalse(phoneTracker._persistence_isAttributeFetched("areaCode"));
- }
- }
- }
-
- @Test
- public void dynamicFetchGroup_EmployeeAddressNullPhone() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- query.setParameter("GENDER", Gender.Male);
-
- // Define the fields to be fetched on Employee
- FetchGroup empGroup = new FetchGroup();
- empGroup.addAttribute("firstName");
- empGroup.addAttribute("lastName");
- empGroup.addAttribute("address");
- empGroup.addAttribute("address.city");
- empGroup.addAttribute("address.postalCode");
- empGroup.addAttribute("phoneNumbers").setUseDefaultFetchGroup(false);
-
- // Configure the dynamic FetchGroup
- query.setHint(QueryHints.FETCH_GROUP, empGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- for (Employee emp : emps) {
- FetchGroupTracker tracker = (FetchGroupTracker) emp;
-
- assertNotNull(tracker._persistence_getFetchGroup());
-
- // Verify specified fields plus mandatory ones are loaded
- assertTrue(tracker._persistence_isAttributeFetched("id"));
- assertTrue(tracker._persistence_isAttributeFetched("firstName"));
- assertTrue(tracker._persistence_isAttributeFetched("lastName"));
- assertTrue(tracker._persistence_isAttributeFetched("version"));
-
- // Verify the other fields are not loaded
- assertFalse(tracker._persistence_isAttributeFetched("salary"));
- assertFalse(tracker._persistence_isAttributeFetched("startTime"));
- assertFalse(tracker._persistence_isAttributeFetched("endTime"));
-
- // Force the loading of lazy fields and verify
- emp.getSalary();
-
- assertTrue(tracker._persistence_isAttributeFetched("salary"));
- assertTrue(tracker._persistence_isAttributeFetched("startTime"));
- assertTrue(tracker._persistence_isAttributeFetched("endTime"));
-
- // Now we'll check the address uses the provided dynamic fetch-group
- FetchGroupTracker addrTracker = (FetchGroupTracker) emp.getAddress();
- assertNotNull("Address does not have a FetchGroup", addrTracker._persistence_getFetchGroup());
- assertTrue(addrTracker._persistence_isAttributeFetched("city"));
- assertTrue(addrTracker._persistence_isAttributeFetched("postalCode"));
- assertFalse(addrTracker._persistence_isAttributeFetched("street"));
- assertFalse(addrTracker._persistence_isAttributeFetched("country"));
-
- // Now we'll check the phoneNumbers use of the default fetch group
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- FetchGroupTracker phoneTracker = (FetchGroupTracker) phone;
- assertNull("PhoneNumber has a FetchGroup", phoneTracker._persistence_getFetchGroup());
- }
- }
- }
-
- @Test
- public void dynamicFetchGroup_EmployeeAddressEmptyPhone() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- query.setParameter("GENDER", Gender.Male);
-
- // Define the fields to be fetched on Employee
- FetchGroup fg = new FetchGroup();
- fg.addAttribute("firstName");
- fg.addAttribute("lastName");
- fg.addAttribute("address.city");
- fg.addAttribute("address.postalCode");
- fg.addAttribute("phoneNumbers", new FetchGroup());
-
- // Configure the dynamic FetchGroup
- query.setHint(QueryHints.FETCH_GROUP, fg);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- assertEquals(1 + (emps.size() * 2), getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (Employee emp : emps) {
- FetchGroupTracker tracker = (FetchGroupTracker) emp;
-
- assertNotNull(tracker._persistence_getFetchGroup());
-
- // Verify specified fields plus mandatory ones are loaded
- assertTrue(tracker._persistence_isAttributeFetched("id"));
- assertTrue(tracker._persistence_isAttributeFetched("firstName"));
- assertTrue(tracker._persistence_isAttributeFetched("lastName"));
- assertTrue(tracker._persistence_isAttributeFetched("version"));
-
- // Verify the other fields are not loaded
- assertFalse(tracker._persistence_isAttributeFetched("salary"));
- assertFalse(tracker._persistence_isAttributeFetched("startTime"));
- assertFalse(tracker._persistence_isAttributeFetched("endTime"));
-
- // Force the loading of lazy fields and verify
- emp.getSalary();
-
- assertTrue(tracker._persistence_isAttributeFetched("salary"));
- assertTrue(tracker._persistence_isAttributeFetched("startTime"));
- assertTrue(tracker._persistence_isAttributeFetched("endTime"));
-
- // Now we'll check the address uses the provided dynamic fetch-group
- FetchGroupTracker addrTracker = (FetchGroupTracker) emp.getAddress();
- assertNotNull("Address does not have a FetchGroup", addrTracker._persistence_getFetchGroup());
- assertTrue(addrTracker._persistence_isAttributeFetched("city"));
- assertTrue(addrTracker._persistence_isAttributeFetched("postalCode"));
- assertFalse(addrTracker._persistence_isAttributeFetched("street"));
- assertFalse(addrTracker._persistence_isAttributeFetched("country"));
-
- // Now we'll check the phoneNumbers use of the default fetch group
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- FetchGroupTracker phoneTracker = (FetchGroupTracker) phone;
- assertNotNull("PhoneNumber does not have a FetchGroup", phoneTracker._persistence_getFetchGroup());
- assertFalse(phoneTracker._persistence_isAttributeFetched("number"));
- assertFalse(phoneTracker._persistence_isAttributeFetched("areaCode"));
-
- phone.getNumber();
-
- assertTrue(phoneTracker._persistence_isAttributeFetched("number"));
- assertTrue(phoneTracker._persistence_isAttributeFetched("areaCode"));
- }
- }
- }
-
- @Test
- public void dynamicHierarchicalFetchGroup() throws Exception {
-
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.lastName LIKE :LNAME AND e.manager.lastName <> e.lastName");
- query.setParameter("LNAME", "%");
-
- // Define the fields to be fetched on Employee
- FetchGroup<Employee> fg = new FetchGroup<Employee>();
- fg.addAttribute("firstName");
- fg.addAttribute("lastName");
- fg.addAttribute("manager.firstName");
- fg.addAttribute("manager.salary");
- fg.addAttribute("manager.manager.gender");
- query.setHint(QueryHints.FETCH_GROUP, fg);
-
- List<Employee> emps = query.getResultList();
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- for (Employee emp : emps) {
- assertFetched(getEMF(), emp, fg);
- }
- assertEquals(numSelect, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void dynamicHierarchicalFetchGroup_JOIN_FETCH() throws Exception {
-
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.manager WHERE e.lastName LIKE :LNAME AND e.manager.lastName <> e.lastName");
- query.setParameter("LNAME", "%");
-
- // Define the fields to be fetched on Employee
- FetchGroup<Employee> fg = new FetchGroup<Employee>();
- fg.addAttribute("firstName");
- fg.addAttribute("lastName");
- fg.addAttribute("manager.firstName");
- fg.addAttribute("manager.salary");
- fg.addAttribute("manager.manager.gender");
- query.setHint(QueryHints.FETCH_GROUP, fg);
-
- List<Employee> emps = query.getResultList();
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- for (Employee emp : emps) {
- assertFetched(getEMF(), emp, fg);
- }
- assertEquals(numSelect, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Before
- public void initialize() {
- Server session = JpaHelper.getServerSession(getEMF());
- session.getIdentityMapAccessor().initializeAllIdentityMaps();
-
- assertTrue("Employee not FetchGroup enabled", FetchGroupTracker.class.isAssignableFrom(Employee.class));
- assertTrue("Address not FetchGroup enabled", FetchGroupTracker.class.isAssignableFrom(Address.class));
- assertTrue("PhoneNumber not FetchGroup enabled", FetchGroupTracker.class.isAssignableFrom(PhoneNumber.class));
-
- ClassDescriptor descriptor = session.getClassDescriptor(Employee.class);
- descriptor.getFetchGroupManager().setDefaultFetchGroup(null);
- descriptor.getFetchGroupManager().getFetchGroups().clear();
-
- assertNull(descriptor.getDefaultFetchGroup());
- assertTrue(descriptor.getFetchGroupManager().getFetchGroups().isEmpty());
-
- descriptor = session.getClassDescriptor(PhoneNumber.class);
- FetchGroup phoneFG = new FetchGroup();
- phoneFG.addAttribute("number");
- descriptor.getFetchGroupManager().setDefaultFetchGroup(phoneFG);
- descriptor.getDescriptorQueryManager().getReadObjectQuery().setFetchGroup(phoneFG);
-
- // We'll put a default FetchGroup on Phone
- assertNotNull(descriptor.getDefaultFetchGroup());
- assertNotNull(descriptor.getDescriptorQueryManager().getReadObjectQuery().getFetchGroup());
- assertTrue(descriptor.getFetchGroupManager().getFetchGroups().isEmpty());
-
- descriptor = session.getClassDescriptor(Address.class);
- assertNull(descriptor.getDefaultFetchGroup());
- assertTrue(descriptor.getFetchGroupManager().getFetchGroups().isEmpty());
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/NestedNamedFetchGroupTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/NestedNamedFetchGroupTests.java
deleted file mode 100644
index 246f6bd..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/NestedNamedFetchGroupTests.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 273057: FetchGroup Example
- ******************************************************************************/
-package test;
-
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
-import static test.FetchGroupAssert.assertFetched;
-import static test.FetchGroupAssert.assertNotFetchedAttribute;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import model.Address;
-import model.Employee;
-import model.Gender;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.descriptors.FetchGroupManager;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.eclipse.persistence.queries.FetchGroup.FetchItem;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.Before;
-import org.junit.Test;
-
-public class NestedNamedFetchGroupTests extends BaseFetchGroupTests {
-
- @Test
- public void dynamicFetchGroup_EmployeeAddress() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- query.setParameter("GENDER", Gender.Male);
-
- // Define the fields to be fetched on Employee
- FetchGroup fg = new FetchGroup();
- fg.addAttribute("firstName");
- fg.addAttribute("lastName");
- fg.addAttribute("address");
- fg.addAttribute("address.city");
- fg.addAttribute("address.postalCode");
-
- // Configure the dynamic FetchGroup
- query.setHint(QueryHints.FETCH_GROUP, fg);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- for (Employee emp : emps) {
- FetchGroupTracker tracker = (FetchGroupTracker) emp;
-
- assertNotNull(tracker._persistence_getFetchGroup());
-
- // Verify specified fields plus mandatory ones are loaded
- assertTrue(tracker._persistence_isAttributeFetched("id"));
- assertTrue(tracker._persistence_isAttributeFetched("firstName"));
- assertTrue(tracker._persistence_isAttributeFetched("lastName"));
- assertTrue(tracker._persistence_isAttributeFetched("version"));
-
- // Verify the other fields are not loaded
- assertFalse(tracker._persistence_isAttributeFetched("salary"));
- assertFalse(tracker._persistence_isAttributeFetched("startTime"));
- assertFalse(tracker._persistence_isAttributeFetched("endTime"));
-
- // Force the loading of lazy fields and verify
- emp.getSalary();
-
- assertTrue(tracker._persistence_isAttributeFetched("salary"));
- assertTrue(tracker._persistence_isAttributeFetched("startTime"));
- assertTrue(tracker._persistence_isAttributeFetched("endTime"));
-
- // Now we'll check the address uses the provided dynamic fetch-group
- FetchGroupTracker addrTracker = (FetchGroupTracker) emp.getAddress();
- assertNotNull("Address does not have a FetchGroup", addrTracker._persistence_getFetchGroup());
- assertTrue(addrTracker._persistence_isAttributeFetched("city"));
- assertTrue(addrTracker._persistence_isAttributeFetched("postalCode"));
- assertFalse(addrTracker._persistence_isAttributeFetched("street"));
- assertFalse(addrTracker._persistence_isAttributeFetched("country"));
-
- // Now we'll check the phoneNumbers use of the default fetch group
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- FetchGroupTracker phoneTracker = (FetchGroupTracker) phone;
- assertNotNull("PhoneNumber does not have a FetchGroup", phoneTracker._persistence_getFetchGroup());
- assertTrue(phoneTracker._persistence_isAttributeFetched("number"));
- assertFalse(phoneTracker._persistence_isAttributeFetched("areaCode"));
- }
- }
- }
-
- @Test
- public void dynamicFetchGroup_Employee_NullAddress() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- query.setParameter("GENDER", Gender.Male);
-
- // Define the fields to be fetched on Employee
- FetchGroup empGroup = new FetchGroup();
- empGroup.addAttribute("firstName");
- empGroup.addAttribute("lastName");
- empGroup.addAttribute("address");
-
- // Define the fields to be fetched on Address
- FetchGroup addressGroup = new FetchGroup();
- addressGroup.addAttribute("city");
- addressGroup.addAttribute("postalCode");
-
- empGroup.addAttribute("address", null);
-
- // Configure the dynamic FetchGroup
- query.setHint(QueryHints.FETCH_GROUP, empGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- for (Employee emp : emps) {
- FetchGroupTracker tracker = (FetchGroupTracker) emp;
-
- assertNotNull(tracker._persistence_getFetchGroup());
-
- // Verify specified fields plus mandatory ones are loaded
- assertTrue(tracker._persistence_isAttributeFetched("id"));
- assertTrue(tracker._persistence_isAttributeFetched("firstName"));
- assertTrue(tracker._persistence_isAttributeFetched("lastName"));
- assertTrue(tracker._persistence_isAttributeFetched("version"));
-
- // Verify the other fields are not loaded
- assertFalse(tracker._persistence_isAttributeFetched("salary"));
- assertFalse(tracker._persistence_isAttributeFetched("startTime"));
- assertFalse(tracker._persistence_isAttributeFetched("endTime"));
-
- // Force the loading of lazy fields and verify
- emp.getSalary();
-
- assertTrue(tracker._persistence_isAttributeFetched("salary"));
- assertTrue(tracker._persistence_isAttributeFetched("startTime"));
- assertTrue(tracker._persistence_isAttributeFetched("endTime"));
-
- // Now we'll check the address uses the provided dynamic fetch-group
- FetchGroupTracker addrTracker = (FetchGroupTracker) emp.getAddress();
- assertNull("Address has an unexpected FetchGroup", addrTracker._persistence_getFetchGroup());
-
- // Now we'll check the phoneNumbers use of the default fetch group
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- FetchGroupTracker phoneTracker = (FetchGroupTracker) phone;
- assertNotNull("PhoneNumber does not have a FetchGroup", phoneTracker._persistence_getFetchGroup());
- assertTrue(phoneTracker._persistence_isAttributeFetched("number"));
- assertFalse(phoneTracker._persistence_isAttributeFetched("areaCode"));
- }
- }
- }
-
- @Test
- public void dynamicFetchGroup_EmployeeAddressNullPhone() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- query.setParameter("GENDER", Gender.Male);
-
- // Define the fields to be fetched on Employee
- FetchGroup empGroup = new FetchGroup();
- empGroup.addAttribute("firstName");
- empGroup.addAttribute("lastName");
- empGroup.addAttribute("address");
-
- // Define the fields to be fetched on Address
- FetchGroup addressGroup = new FetchGroup();
- addressGroup.addAttribute("city");
- addressGroup.addAttribute("postalCode");
-
- empGroup.addAttribute("address", addressGroup);
- empGroup.addAttribute("phoneNumbers").setUseDefaultFetchGroup(false);
-
- // Configure the dynamic FetchGroup
- query.setHint(QueryHints.FETCH_GROUP, empGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- for (Employee emp : emps) {
- FetchGroupTracker tracker = (FetchGroupTracker) emp;
-
- assertNotNull(tracker._persistence_getFetchGroup());
-
- // Verify specified fields plus mandatory ones are loaded
- assertTrue(tracker._persistence_isAttributeFetched("id"));
- assertTrue(tracker._persistence_isAttributeFetched("firstName"));
- assertTrue(tracker._persistence_isAttributeFetched("lastName"));
- assertTrue(tracker._persistence_isAttributeFetched("version"));
-
- // Verify the other fields are not loaded
- assertFalse(tracker._persistence_isAttributeFetched("salary"));
- assertFalse(tracker._persistence_isAttributeFetched("startTime"));
- assertFalse(tracker._persistence_isAttributeFetched("endTime"));
-
- // Force the loading of lazy fields and verify
- emp.getSalary();
-
- assertTrue(tracker._persistence_isAttributeFetched("salary"));
- assertTrue(tracker._persistence_isAttributeFetched("startTime"));
- assertTrue(tracker._persistence_isAttributeFetched("endTime"));
-
- // Now we'll check the address uses the provided dynamic fetch-group
- FetchGroupTracker addrTracker = (FetchGroupTracker) emp.getAddress();
- assertNotNull("Address does not have a FetchGroup", addrTracker._persistence_getFetchGroup());
- assertTrue(addrTracker._persistence_isAttributeFetched("city"));
- assertTrue(addrTracker._persistence_isAttributeFetched("postalCode"));
- assertFalse(addrTracker._persistence_isAttributeFetched("street"));
- assertFalse(addrTracker._persistence_isAttributeFetched("country"));
-
- // Now we'll check the phoneNumbers use of the default fetch group
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- FetchGroupTracker phoneTracker = (FetchGroupTracker) phone;
- assertNull("PhoneNumber has a FetchGroup", phoneTracker._persistence_getFetchGroup());
- }
- }
- }
-
- @Test
- public void dynamicFetchGroup_EmployeeAddressEmptyPhone() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- query.setParameter("GENDER", Gender.Male);
-
- // Define the fields to be fetched on Employee
- FetchGroup empGroup = new FetchGroup();
- empGroup.addAttribute("firstName");
- empGroup.addAttribute("lastName");
- empGroup.addAttribute("address");
-
- // Define the fields to be fetched on Address
- FetchGroup addressGroup = new FetchGroup();
- addressGroup.addAttribute("city");
- addressGroup.addAttribute("postalCode");
-
- empGroup.addAttribute("address", addressGroup);
- empGroup.addAttribute("phoneNumbers", new FetchGroup());
-
- // Configure the dynamic FetchGroup
- query.setHint(QueryHints.FETCH_GROUP, empGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- for (Employee emp : emps) {
- FetchGroupTracker tracker = (FetchGroupTracker) emp;
-
- assertNotNull(tracker._persistence_getFetchGroup());
-
- // Verify specified fields plus mandatory ones are loaded
- assertTrue(tracker._persistence_isAttributeFetched("id"));
- assertTrue(tracker._persistence_isAttributeFetched("firstName"));
- assertTrue(tracker._persistence_isAttributeFetched("lastName"));
- assertTrue(tracker._persistence_isAttributeFetched("version"));
-
- // Verify the other fields are not loaded
- assertFalse(tracker._persistence_isAttributeFetched("salary"));
- assertFalse(tracker._persistence_isAttributeFetched("startTime"));
- assertFalse(tracker._persistence_isAttributeFetched("endTime"));
-
- // Force the loading of lazy fields and verify
- emp.getSalary();
-
- assertTrue(tracker._persistence_isAttributeFetched("salary"));
- assertTrue(tracker._persistence_isAttributeFetched("startTime"));
- assertTrue(tracker._persistence_isAttributeFetched("endTime"));
-
- // Now we'll check the address uses the provided dynamic fetch-group
- FetchGroupTracker addrTracker = (FetchGroupTracker) emp.getAddress();
- assertNotNull("Address does not have a FetchGroup", addrTracker._persistence_getFetchGroup());
- assertTrue(addrTracker._persistence_isAttributeFetched("city"));
- assertTrue(addrTracker._persistence_isAttributeFetched("postalCode"));
- assertFalse(addrTracker._persistence_isAttributeFetched("street"));
- assertFalse(addrTracker._persistence_isAttributeFetched("country"));
-
- // Now we'll check the phoneNumbers use of the default fetch group
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- FetchGroupTracker phoneTracker = (FetchGroupTracker) phone;
- assertNotNull("PhoneNumber does not have a FetchGroup", phoneTracker._persistence_getFetchGroup());
- assertFalse(phoneTracker._persistence_isAttributeFetched("number"));
- assertFalse(phoneTracker._persistence_isAttributeFetched("areaCode"));
-
- phone.getNumber();
-
- assertTrue(phoneTracker._persistence_isAttributeFetched("number"));
- assertTrue(phoneTracker._persistence_isAttributeFetched("areaCode"));
- }
- }
- }
-
- @Test
- public void dynamicHierarchicalFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER");
- query.setParameter("GENDER", Gender.Male);
-
- // Define the fields to be fetched on Employee
- FetchGroup fg = new FetchGroup();
- fg.addAttribute("firstName");
- fg.addAttribute("lastName");
- fg.addAttribute("manager.firstName");
- fg.addAttribute("manager.salary");
- fg.addAttribute("manager.manager.gender");
-
- FetchItem mgrItem = fg.getFetchItem("manager");
- assertNotNull(mgrItem);
- assertNotNull(mgrItem.getFetchGroup());
- FetchItem mgrMgrItem = fg.getFetchItem("manager.manager");
- assertNotNull(mgrMgrItem);
- assertNotNull(mgrMgrItem.getFetchGroup());
-
- query.setHint(QueryHints.FETCH_GROUP, fg);
-
- List<Employee> emps = query.getResultList();
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- List<Employee> loadedEmps = new ArrayList<Employee>();
- loadedEmps.addAll(emps);
-
- for (Employee emp : emps) {
- if (!loadedEmps.contains(emp)) {
- assertFetched(getEMF(), emp, fg);
- }
-
- assertNotFetchedAttribute(getEMF(), emp, "startDate");
- loadedEmps.add(emp);
- }
- // TODO assertEquals(1 + loadedEmps.size() - emps.size(), numSelect);
- }
-
- @Before
- public void initialize() {
- Server session = JpaHelper.getServerSession(getEMF());
- session.getIdentityMapAccessor().initializeAllIdentityMaps();
-
- assertTrue("Employee not FetchGroup enabled", FetchGroupTracker.class.isAssignableFrom(Employee.class));
- assertTrue("Address not FetchGroup enabled", FetchGroupTracker.class.isAssignableFrom(Address.class));
- assertTrue("PhoneNumber not FetchGroup enabled", FetchGroupTracker.class.isAssignableFrom(PhoneNumber.class));
-
- ClassDescriptor descriptor = session.getClassDescriptor(Employee.class);
- descriptor.getFetchGroupManager().setDefaultFetchGroup(null);
- descriptor.getFetchGroupManager().getFetchGroups().clear();
-
- assertNull(descriptor.getDefaultFetchGroup());
- assertTrue(descriptor.getFetchGroupManager().getFetchGroups().isEmpty());
-
- // We'll put a default FetchGroup on Phone
- FetchGroup phoneFG = new FetchGroup();
- phoneFG.addAttribute("number");
- ClassDescriptor phoneDescriptor = session.getClassDescriptor(PhoneNumber.class);
- phoneDescriptor.getFetchGroupManager().setDefaultFetchGroup(phoneFG);
-
- descriptor = session.getClassDescriptor(PhoneNumber.class);
- assertNotNull(descriptor.getDefaultFetchGroup());
- assertTrue(descriptor.getFetchGroupManager().getFetchGroups().isEmpty());
-
- descriptor = session.getClassDescriptor(Address.class);
- assertNull(descriptor.getDefaultFetchGroup());
- assertTrue(descriptor.getFetchGroupManager().getFetchGroups().isEmpty());
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/SimpleDefaultFetchGroupTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/SimpleDefaultFetchGroupTests.java
deleted file mode 100644
index 46740d4..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/SimpleDefaultFetchGroupTests.java
+++ /dev/null
@@ -1,530 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 273057: NestedFetchGroup Example
- ******************************************************************************/
-package test;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
-import static test.FetchGroupAssert.assertDefaultFetched;
-import static test.FetchGroupAssert.assertFetched;
-import static test.FetchGroupAssert.assertFetchedAttribute;
-import static test.FetchGroupAssert.assertNoFetchGroup;
-import static test.FetchGroupAssert.assertNotFetchedAttribute;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import model.Employee;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.config.DescriptorCustomizer;
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.descriptors.FetchGroupManager;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.EntityFetchGroup;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.junit.Before;
-import org.junit.Test;
-
-import example.Queries;
-
-/**
- * Simple tests to verify the functionality of single level FetchGroup usage
- *
- * @author dclarke
- * @since EclipseLink 2.1
- */
-public class SimpleDefaultFetchGroupTests extends BaseFetchGroupTests {
-
- @Test
- public void findDefaultFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Employee emp = Queries.minimumEmployee(em);
-
- assertNotNull(emp);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertDefaultFetched(getEMF(), emp);
-
- assertNotFetchedAttribute(getEMF(), emp, "salary");
- emp.getSalary();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetchedAttribute(getEMF(), emp, "salary");
-
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertDefaultFetched(getEMF(), phone);
- }
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- if (emp.getManager() != null) {
- assertDefaultFetched(getEMF(), emp.getManager());
- }
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void singleResultDefaultFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertNotNull(emp);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertDefaultFetched(getEMF(), emp);
-
- emp.getSalary();
-
- assertFetchedAttribute(getEMF(), emp, "salary");
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertDefaultFetched(getEMF(), phone);
- }
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- if (emp.getManager() != null) {
- assertDefaultFetched(getEMF(), emp.getManager());
- }
-
- assertEquals(6, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void resultListDefaultFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- assertEquals(1, emps.size());
-
- Employee emp = emps.get(0);
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertDefaultFetched(getEMF(), emp);
-
- emp.getSalary();
-
- assertNoFetchGroup(getEMF(), emp);
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertDefaultFetched(getEMF(), phone);
- }
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- if (emp.getManager() != null) {
- assertDefaultFetched(getEMF(), emp.getManager());
- }
-
- assertEquals(6, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void resultListWithJoinFetchAddress() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- assertEquals(1, emps.size());
-
- Employee emp = emps.get(0);
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertDefaultFetched(getEMF(), emp);
-
- emp.getSalary();
-
- assertNoFetchGroup(getEMF(), emp);
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertDefaultFetched(getEMF(), phone);
- }
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- if (emp.getManager() != null) {
- assertDefaultFetched(getEMF(), emp.getManager());
- }
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void singleResultNoFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
-
- assertNull(JpaHelper.getReadAllQuery(query).getFetchGroup());
- assertNotNull(getDescriptor("Employee").getFetchGroupManager().getFetchGroup(null, true));
-
- query.setHint(QueryHints.FETCH_GROUP, null);
- assertNull(JpaHelper.getReadAllQuery(query).getFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertNotNull(emp);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertDefaultFetched(getEMF(), phone);
- }
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void resultListNoFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- query.setHint(QueryHints.FETCH_GROUP, null);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- assertEquals(1, emps.size());
-
- Employee emp = emps.get(0);
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertNoFetchGroup(getEMF(), emp);
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertDefaultFetched(getEMF(), phone);
- }
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void emptyFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- // Use q query since find will only use default fetch group
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- FetchGroup emptyFG = new FetchGroup("empty@" + System.currentTimeMillis());
- query.setHint(QueryHints.FETCH_GROUP, emptyFG);
-
- assertEquals(emptyFG, JpaHelper.getReadAllQuery(query).getFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertFetched(getEMF(), emp, emptyFG);
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertDefaultFetched(getEMF(), phone);
- phone.getAreaCode();
- assertNoFetchGroup(getEMF(), phone);
- }
- }
-
- @Test
- public void managerFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- // Use q query since find will only use default fetch group
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- FetchGroup managerFG = new FetchGroup();
- managerFG.addAttribute("manager");
-
- query.setHint(QueryHints.FETCH_GROUP, managerFG);
- query.setHint(QueryHints.LEFT_FETCH, "e.manager");
-
- assertEquals(managerFG, JpaHelper.getReadAllQuery(query).getFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertFetched(getEMF(), emp, managerFG);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getManager();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, managerFG);
-
- emp.getLastName();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertDefaultFetched(getEMF(), phone);
-
- phone.getAreaCode();
-
- assertNoFetchGroup(getEMF(), phone);
- }
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void employeeNamesFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- int minId = Queries.minimumEmployeeId(em);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // Use q query since find will only use default fetch group
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", minId);
-
- FetchGroup namesFG = new FetchGroup();
- namesFG.addAttribute("firstName");
- namesFG.addAttribute("lastName");
- query.setHint(QueryHints.FETCH_GROUP, namesFG);
-
- assertNotNull(JpaHelper.getReadAllQuery(query).getFetchGroup());
- assertSame(namesFG, JpaHelper.getReadAllQuery(query).getFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, namesFG);
-
- emp.getId();
- emp.getFirstName();
- emp.getLastName();
- emp.getVersion();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, namesFG);
-
- emp.getGender();
- emp.getSalary();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertDefaultFetched(getEMF(), phone);
-
- phone.getAreaCode();
-
- assertNoFetchGroup(getEMF(), phone);
- }
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getManager();
-
- assertEquals(6, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertDefaultFetched(getEMF(), emp.getManager());
- }
-
- @Test
- public void namedEmptyFetchGroupUsingGetSingleResult() throws Exception {
- ClassDescriptor descriptor = JpaHelper.getServerSession(getEMF()).getClassDescriptor(Employee.class);
-
- FetchGroup fetchGroup = new FetchGroup("test");
- descriptor.getFetchGroupManager().addFetchGroup(fetchGroup);
- assertTrue(fetchGroup.getFetchItems().isEmpty());
- assertEquals(1, descriptor.getFetchGroupManager().getFetchGroups().size());
-
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- query.setHint(QueryHints.FETCH_GROUP_NAME, "test");
-
- Employee emp = (Employee) query.getSingleResult();
- assertNotNull(emp);
- assertFetched(getEMF(), emp, "test");
- }
-
- @Test
- public void namedNamesFetchGroupUsingGetSingleResult() throws Exception {
- ClassDescriptor descriptor = getDescriptor("Employee");
-
- FetchGroup fetchGroup = new FetchGroup("names");
- fetchGroup.addAttribute("firstName");
- fetchGroup.addAttribute("lastName");
-
- descriptor.getFetchGroupManager().addFetchGroup(fetchGroup);
- assertEquals(2, fetchGroup.getFetchItems().size());
-
- assertEquals(1, descriptor.getFetchGroupManager().getFetchGroups().size());
-
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- query.setHint(QueryHints.FETCH_GROUP_NAME, "names");
-
- Employee emp = (Employee) query.getSingleResult();
- assertNotNull(emp);
-
- FetchGroupTracker tracker = (FetchGroupTracker) emp;
- assertNotNull(tracker);
-
- FetchGroup usedFG = tracker._persistence_getFetchGroup();
-
- assertNotNull("No FetchGroup found on read Employee", fetchGroup);
- assertEquals(fetchGroup.getName(), usedFG.getName());
- assertSame(fetchGroup, ((EntityFetchGroup<?>)usedFG).getParent());
- assertEquals(4, fetchGroup.getFetchItems().size());
- assertTrue(tracker._persistence_isAttributeFetched("id"));
- assertTrue(tracker._persistence_isAttributeFetched("version"));
- assertFalse(tracker._persistence_isAttributeFetched("salary"));
- assertTrue(tracker._persistence_isAttributeFetched("firstName"));
- assertTrue(tracker._persistence_isAttributeFetched("lastName"));
- }
-
- @Test
- public void joinFetchEmployeeAddressWithDynamicFetchGroup() {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address");
-
- FetchGroup fetchGroup = new FetchGroup("names");
- fetchGroup.addAttribute("firstName");
- fetchGroup.addAttribute("lastName");
- query.setHint(QueryHints.FETCH_GROUP, fetchGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- }
-
- @Test
- public void joinFetchEmployeeAddressPhoneWithDynamicFetchGroup() {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT p.id FROM PhoneNumber p)");
-
- FetchGroup fetchGroup = new FetchGroup("names");
- fetchGroup.addAttribute("firstName");
- fetchGroup.addAttribute("lastName");
- query.setHint(QueryHints.FETCH_GROUP, fetchGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNotNull(emps);
- for (Employee emp : emps) {
- assertFetched(getEMF(), emp, fetchGroup);
- }
- }
-
- private FetchGroup<Employee> defaultEmpFG = null;
- FetchGroup<PhoneNumber> defaultPhoneFG = null;
-
- /**
- * Verify the configuration made in the customizers and clear the cache. Any
- * FetchGroups setup in test cases will be removed.
- *
- * @see EmployeeCustomizer
- * @see PhoneCustomizer
- */
- @Before
- public void config() throws Exception {
- getDescriptor("Employee").getFetchGroupManager().getFetchGroups().clear();
- getDescriptor("PhoneNumber").getFetchGroupManager().getFetchGroups().clear();
-
- defaultEmpFG = getDescriptor("Employee").getDefaultFetchGroup();
- defaultPhoneFG = getDescriptor("PhoneNumber").getDefaultFetchGroup();
-
- assertConfig(getEMF(), "Employee", defaultEmpFG, 0);
- assertConfig(getEMF(), "Address", null, 0);
- assertConfig(getEMF(), "PhoneNumber", defaultPhoneFG, 0);
-
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- @Override
- protected Map getEMFProperties() {
- Map properties = super.getEMFProperties();
- properties.put(PersistenceUnitProperties.DESCRIPTOR_CUSTOMIZER_ + "Employee", EmployeeCustomizer.class.getName());
- properties.put(PersistenceUnitProperties.DESCRIPTOR_CUSTOMIZER_ + "PhoneNumber", PhoneCustomizer.class.getName());
- return properties;
- }
-
- public static class EmployeeCustomizer implements DescriptorCustomizer {
-
- public void customize(ClassDescriptor descriptor) throws Exception {
- FetchGroup fg = new FetchGroup("Employee-default");
- fg.addAttribute("firstName");
- fg.addAttribute("lastName");
- if (!descriptor.hasFetchGroupManager()) {
- descriptor.setFetchGroupManager(new FetchGroupManager());
- }
- descriptor.getFetchGroupManager().setDefaultFetchGroup(fg);
- }
-
- }
-
- public static class PhoneCustomizer implements DescriptorCustomizer {
-
- public void customize(ClassDescriptor descriptor) throws Exception {
- FetchGroup fg = new FetchGroup("Phone-default");
- fg.addAttribute("number");
- if (!descriptor.hasFetchGroupManager()) {
- descriptor.setFetchGroupManager(new FetchGroupManager());
- }
- descriptor.getFetchGroupManager().setDefaultFetchGroup(fg);
- }
-
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/SimpleFetchGroupTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/SimpleFetchGroupTests.java
deleted file mode 100644
index bd1537b..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/SimpleFetchGroupTests.java
+++ /dev/null
@@ -1,683 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 273057: NestedFetchGroup Example
- ******************************************************************************/
-package test;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
-import static test.FetchGroupAssert.assertFetched;
-import static test.FetchGroupAssert.assertFetchedAttribute;
-import static test.FetchGroupAssert.assertNoFetchGroup;
-import static test.FetchGroupAssert.assertNotFetchedAttribute;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import javax.persistence.TypedQuery;
-
-import model.Employee;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.indirection.IndirectList;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.junit.Before;
-import org.junit.Test;
-
-import example.Queries;
-
-/**
- * Simple tests to verify the functionality of single level FetchGroup usage
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-public class SimpleFetchGroupTests extends BaseFetchGroupTests {
-
- @Test
- public void findNoFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
- int minId = Queries.minimumEmployeeId(em);
-
- Employee emp = em.find(Employee.class, minId);
-
- assertNotNull(emp);
-
- // Check Basics
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertFetchedAttribute(getEMF(), emp, "firstName");
- assertFetchedAttribute(getEMF(), emp, "lastName");
- assertFetchedAttribute(getEMF(), emp, "gender");
- assertFetchedAttribute(getEMF(), emp, "salary");
- assertFetchedAttribute(getEMF(), emp, "startTime");
- assertFetchedAttribute(getEMF(), emp, "endTime");
- if (emp.getPeriod() != null) {
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "startDate");
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "endDate");
- }
-
- // Check Relationships
- assertNotFetchedAttribute(getEMF(), emp, "address");
- assertNotFetchedAttribute(getEMF(), emp, "manager");
- assertNotFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), emp, "projects");
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void singleResultNoFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertNotNull(emp);
-
- // Check Basics
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertFetchedAttribute(getEMF(), emp, "firstName");
- assertFetchedAttribute(getEMF(), emp, "lastName");
- assertFetchedAttribute(getEMF(), emp, "gender");
- assertFetchedAttribute(getEMF(), emp, "salary");
- assertFetchedAttribute(getEMF(), emp, "startTime");
- assertFetchedAttribute(getEMF(), emp, "endTime");
- if (emp.getPeriod() != null) {
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "startDate");
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "endDate");
- }
-
- // Check Relationships
- assertNotFetchedAttribute(getEMF(), emp, "address");
- assertNotFetchedAttribute(getEMF(), emp, "manager");
- assertNotFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), emp, "projects");
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- public void resultListNoFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- assertEquals(1, emps.size());
-
- Employee emp = emps.get(0);
-
- // Check Basics
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertFetchedAttribute(getEMF(), emp, "firstName");
- assertFetchedAttribute(getEMF(), emp, "lastName");
- assertFetchedAttribute(getEMF(), emp, "gender");
- assertFetchedAttribute(getEMF(), emp, "salary");
- assertFetchedAttribute(getEMF(), emp, "startTime");
- assertFetchedAttribute(getEMF(), emp, "endTime");
- if (emp.getPeriod() != null) {
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "startDate");
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "endDate");
- }
-
- // Check Relationships
- assertNotFetchedAttribute(getEMF(), emp, "address");
- assertNotFetchedAttribute(getEMF(), emp, "manager");
- assertNotFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), emp, "projects");
- }
-
- @Test
- public void findEmptyFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
- int minId = Queries.minimumEmployeeId(em);
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- Map<String, Object> properties = new HashMap<String, Object>();
- FetchGroup emptyFG = new FetchGroup();
- properties.put(QueryHints.FETCH_GROUP, emptyFG);
-
- Employee emp = em.find(Employee.class, minId, properties);
-
- assertNotNull(emp);
- assertFetched(getEMF(), emp, emptyFG);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // Check Basics
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertNotFetchedAttribute(getEMF(), emp, "firstName");
- assertNotFetchedAttribute(getEMF(), emp, "lastName");
- assertNotFetchedAttribute(getEMF(), emp, "gender");
- assertNotFetchedAttribute(getEMF(), emp, "salary");
- assertNotFetchedAttribute(getEMF(), emp, "startTime");
- assertNotFetchedAttribute(getEMF(), emp, "endTime");
- if (emp.getPeriod() != null) {
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "startDate");
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "endDate");
- }
-
- // Check Relationships
- assertNotFetchedAttribute(getEMF(), emp, "address");
- assertNotFetchedAttribute(getEMF(), emp, "manager");
- assertNotFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), emp, "projects");
-
- emp.getSalary();
-
- assertFetchedAttribute(getEMF(), emp, "salary");
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- emp.getAddress();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- emp.getPhoneNumbers().size();
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
-
- emp.getManager();
-
- assertEquals(6, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-}
-
- @Test
- public void findEmptyFetchGroup_setUnfetchedSalary() throws Exception {
- EntityManager em = getEntityManager();
- int minId = Queries.minimumEmployeeId(em);
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- Map<String, Object> properties = new HashMap<String, Object>();
- FetchGroup emptyFG = new FetchGroup();
- properties.put(QueryHints.FETCH_GROUP, emptyFG);
-
- Employee emp = em.find(Employee.class, minId, properties);
-
- assertNotNull(emp);
- assertFetched(getEMF(), emp, emptyFG);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // Check Basics
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertNotFetchedAttribute(getEMF(), emp, "firstName");
- assertNotFetchedAttribute(getEMF(), emp, "lastName");
- assertNotFetchedAttribute(getEMF(), emp, "gender");
- assertNotFetchedAttribute(getEMF(), emp, "salary");
- assertNotFetchedAttribute(getEMF(), emp, "startTime");
- assertNotFetchedAttribute(getEMF(), emp, "endTime");
- if (emp.getPeriod() != null) {
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "startDate");
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "endDate");
- }
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // Check Relationships
- assertNotFetchedAttribute(getEMF(), emp, "address");
- assertNotFetchedAttribute(getEMF(), emp, "manager");
- assertNotFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), emp, "projects");
-
- emp.setSalary(1);
-
- assertFetchedAttribute(getEMF(), emp, "salary");
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- emp.getAddress();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- emp.getPhoneNumbers().size();
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
- }
-
- @Test
- public void singleResultEmptyFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- FetchGroup emptyFG = new FetchGroup();
- query.setHint(QueryHints.FETCH_GROUP, emptyFG);
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertNotNull(emp);
- assertFetched(getEMF(), emp, emptyFG);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // Check Basics
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertNotFetchedAttribute(getEMF(), emp, "firstName");
- assertNotFetchedAttribute(getEMF(), emp, "lastName");
- assertNotFetchedAttribute(getEMF(), emp, "gender");
- assertNotFetchedAttribute(getEMF(), emp, "salary");
- assertNotFetchedAttribute(getEMF(), emp, "startTime");
- assertNotFetchedAttribute(getEMF(), emp, "endTime");
- if (emp.getPeriod() != null) {
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "startDate");
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "endDate");
- }
-
- // Check Relationships
- assertNotFetchedAttribute(getEMF(), emp, "address");
- assertNotFetchedAttribute(getEMF(), emp, "manager");
- assertNotFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), emp, "projects");
-
- emp.getSalary();
-
- assertFetchedAttribute(getEMF(), emp, "salary");
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- emp.getAddress();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- emp.getPhoneNumbers().size();
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
- }
-
- /**
- *
- */
- @Test
- public void resultListEmptyFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- FetchGroup emptyFG = new FetchGroup();
- query.setHint(QueryHints.FETCH_GROUP, emptyFG);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- assertEquals(1, emps.size());
-
- Employee emp = emps.get(0);
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, emptyFG);
-
- // Check Basics
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertNotFetchedAttribute(getEMF(), emp, "firstName");
- assertNotFetchedAttribute(getEMF(), emp, "lastName");
- assertNotFetchedAttribute(getEMF(), emp, "gender");
- assertNotFetchedAttribute(getEMF(), emp, "salary");
- assertNotFetchedAttribute(getEMF(), emp, "startTime");
- assertNotFetchedAttribute(getEMF(), emp, "endTime");
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- if (emp.getPeriod() != null) {
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "startDate");
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "endDate");
- }
-
- // Check Relationships
- assertNotFetchedAttribute(getEMF(), emp, "address");
- assertNotFetchedAttribute(getEMF(), emp, "manager");
- assertNotFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), emp, "projects");
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getSalary();
-
- assertFetchedAttribute(getEMF(), emp, "salary");
- assertNoFetchGroup(getEMF(), emp);
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- /**
- *
- */
- @Test
- public void resultListPeriodFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- FetchGroup fg = new FetchGroup();
- fg.addAttribute("period");
- query.setHint(QueryHints.FETCH_GROUP, fg);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- assertEquals(1, emps.size());
-
- Employee emp = emps.get(0);
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, fg);
-
- // Check Basics
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertNotFetchedAttribute(getEMF(), emp, "firstName");
- assertNotFetchedAttribute(getEMF(), emp, "lastName");
- assertNotFetchedAttribute(getEMF(), emp, "gender");
- assertNotFetchedAttribute(getEMF(), emp, "salary");
- assertNotFetchedAttribute(getEMF(), emp, "startTime");
- assertNotFetchedAttribute(getEMF(), emp, "endTime");
- if (emp.getPeriod() != null) {
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "startDate");
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "endDate");
- }
-
- // Check Relationships
- assertNotFetchedAttribute(getEMF(), emp, "address");
- assertNotFetchedAttribute(getEMF(), emp, "manager");
- assertNotFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), emp, "projects");
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getSalary();
-
- assertFetchedAttribute(getEMF(), emp, "salary");
- assertNoFetchGroup(getEMF(), emp);
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void managerFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- // Use q query since find will only use default fetch group
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- FetchGroup managerFG = new FetchGroup();
- managerFG.addAttribute("manager");
-
- query.setHint(QueryHints.FETCH_GROUP, managerFG);
-
- assertNotNull(JpaHelper.getReadAllQuery(query).getFetchGroup());
- assertSame(managerFG, JpaHelper.getReadAllQuery(query).getFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertFetched(getEMF(), emp, managerFG);
- assertFetchedAttribute(getEMF(), emp, "manager");
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getManager();
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- if (emp.getManager() != null) {
- assertFetchedAttribute(getEMF(), emp, "manager");
- }
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getLastName();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- phone.getAreaCode();
- }
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void managerFetchGroupWithJoinFetch() throws Exception {
- EntityManager em = getEntityManager();
-
- int minId = Queries.minimumEmployeeId(em);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // Use q query since find will only use default fetch group
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", minId);
- FetchGroup managerFG = new FetchGroup();
- managerFG.addAttribute("manager");
-
- query.setHint(QueryHints.FETCH_GROUP, managerFG);
- query.setHint(QueryHints.LEFT_FETCH, "e.manager");
-
- assertNotNull(JpaHelper.getReadAllQuery(query).getFetchGroup());
- assertSame(managerFG, JpaHelper.getReadAllQuery(query).getFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, managerFG);
- assertFetchedAttribute(getEMF(), emp, "manager");
-
- emp.getManager();
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getLastName();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- phone.getAreaCode();
- }
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void employeeNamesFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- int minId = Queries.minimumEmployeeId(em);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // Use q query since find will only use default fetch group
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", minId);
- FetchGroup namesFG = new FetchGroup();
- namesFG.addAttribute("firstName");
- namesFG.addAttribute("lastName");
-
- query.setHint(QueryHints.FETCH_GROUP, namesFG);
-
- assertNotNull(JpaHelper.getReadAllQuery(query).getFetchGroup());
- assertSame(namesFG, JpaHelper.getReadAllQuery(query).getFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, namesFG);
-
- emp.getId();
- emp.getFirstName();
- emp.getLastName();
- emp.getVersion();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, namesFG);
-
- emp.getGender();
- emp.getSalary();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- phone.getAreaCode();
- }
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getManager();
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp.getManager());
- }
-
- @Test
- public void joinFetchEmployeeAddressWithDynamicFetchGroup() {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address");
-
- FetchGroup fetchGroup = new FetchGroup("names");
- fetchGroup.addAttribute("firstName");
- fetchGroup.addAttribute("lastName");
- query.setHint(QueryHints.FETCH_GROUP, fetchGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- }
-
- @Test
- public void joinFetchEmployeeAddressPhoneWithDynamicFetchGroup() {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT p.id FROM PhoneNumber p)");
-
- FetchGroup fetchGroup = new FetchGroup("names");
- fetchGroup.addAttribute("firstName");
- fetchGroup.addAttribute("lastName");
- query.setHint(QueryHints.FETCH_GROUP, fetchGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- }
-
- @Test
- public void verifyUnfetchedAttributes() throws Exception {
- EntityManager em = getEntityManager();
-
- TypedQuery<Employee> q = em.createQuery("SELECT e FROM Employee e WHERE e.id IN (SELECT MIN(p.id) FROM PhoneNumber p)", Employee.class);
- FetchGroup<Employee> fg = new FetchGroup<Employee>("Employee.empty");
- q.setHint(QueryHints.FETCH_GROUP, fg);
- Employee emp = q.getSingleResult();
-
- assertNotNull(emp);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // This check using the mapping returns a default (empty) IndirectList
- OneToManyMapping phoneMapping = (OneToManyMapping) getDescriptor(emp).getMappingForAttributeName("phoneNumbers");
- IndirectList phones = (IndirectList) phoneMapping.getAttributeValueFromObject(emp);
- assertNotNull(phones);
- assertTrue(phones.isInstantiated());
- assertEquals(0, phones.size());
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- IndirectList phonesIL = (IndirectList) emp.getPhoneNumbers();
- assertFalse(phonesIL.isInstantiated());
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertTrue(emp.getPhoneNumbers().size() > 0);
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void verifyFetchedRelationshipAttributes() throws Exception {
- EntityManager em = getEntityManager();
-
- FetchGroup<Employee> fg = new FetchGroup<Employee>("Employee.relationships");
- fg.addAttribute("address");
- fg.addAttribute("phoneNumbers");
- fg.addAttribute("manager");
- fg.addAttribute("projects");
-
- Map<String, Object> hints = new HashMap<String, Object>();
- hints.put(QueryHints.FETCH_GROUP, fg);
-
- Employee emp = Queries.minimumEmployee(em, hints);
-
- assertNotNull(emp);
-
- }
-
- /**
- * Verify the state of all descriptors where no FetchGroup have been
- * configured.
- */
- @Override
- protected EntityManager getEntityManager() {
- assertConfig(getEMF(), "Employee", null, 0);
- assertConfig(getEMF(), "Address", null, 0);
- assertConfig(getEMF(), "PhoneNumber", null, 0);
- assertConfig(getEMF(), "Project", null, 0);
- assertConfig(getEMF(), "SmallProject", null, 0);
- assertConfig(getEMF(), "LargeProject", null, 0);
-
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- return super.getEntityManager();
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/SimpleNamedFetchGroupTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/SimpleNamedFetchGroupTests.java
deleted file mode 100644
index 9f62ee3..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/SimpleNamedFetchGroupTests.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 273057: FetchGroup Example
- ******************************************************************************/
-package test;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
-import static test.FetchGroupAssert.assertFetched;
-import static test.FetchGroupAssert.assertNoFetchGroup;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import model.Address;
-import model.Employee;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.EntityFetchGroup;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import example.Queries;
-
-/**
- * Simple tests to verify the functionality of single level FetchGroup usage
- *
- * @author dclarke
- * @since EclipseLink 1.1
- */
-public class SimpleNamedFetchGroupTests extends BaseFetchGroupTests {
-
- @Test
- public void findDefaultFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Employee emp = Queries.minimumEmployee(em);
-
- assertNotNull(emp);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- emp.getSalary();
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertNoFetchGroup(getEMF(), emp.getAddress());
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- if (emp.getManager() != null) {
- assertNoFetchGroup(getEMF(), emp.getManager());
- }
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void singleResultDefaultFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertNotNull(emp);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- emp.getSalary();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertNoFetchGroup(getEMF(), emp.getAddress());
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- if (emp.getManager() != null) {
- assertNoFetchGroup(getEMF(), emp.getManager());
- }
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void resultListDefaultFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- assertEquals(1, emps.size());
-
- Employee emp = emps.get(0);
-
- assertNotNull(emp);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- emp.getSalary();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertNoFetchGroup(getEMF(), emp.getAddress());
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- if (emp.getManager() != null) {
- assertNoFetchGroup(getEMF(), emp.getManager());
- }
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void singleResultNoFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- query.setHint(QueryHints.FETCH_GROUP, null);
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertNotNull(emp);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- emp.getSalary();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertNoFetchGroup(getEMF(), emp.getAddress());
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- if (emp.getManager() != null) {
- assertNoFetchGroup(getEMF(), emp.getManager());
- }
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void resultListNoFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- query.setHint(QueryHints.FETCH_GROUP, null);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- assertEquals(1, emps.size());
-
- Employee emp = emps.get(0);
-
- assertNotNull(emp);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- emp.getSalary();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertNoFetchGroup(getEMF(), emp.getAddress());
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- if (emp.getManager() != null) {
- assertNoFetchGroup(getEMF(), emp.getManager());
- }
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void managerFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- // Use q query since find will only use default fetch group
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- FetchGroup managerFG = new FetchGroup();
- managerFG.addAttribute("manager");
-
- query.setHint(QueryHints.FETCH_GROUP, managerFG);
-
- assertNotNull(JpaHelper.getReadAllQuery(query).getFetchGroup());
- assertSame(managerFG, JpaHelper.getReadAllQuery(query).getFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, managerFG);
-
- emp.getManager();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, managerFG);
-
- emp.getLastName();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void namedEmptyFetchGroupUsingGetSingleResult() throws Exception {
- ClassDescriptor descriptor = JpaHelper.getServerSession(getEMF()).getClassDescriptor(Employee.class);
-
- FetchGroup fetchGroup = new FetchGroup("test");
- descriptor.getFetchGroupManager().addFetchGroup(fetchGroup);
- assertTrue(fetchGroup.getFetchItems().isEmpty());
-
- assertEquals(2, descriptor.getFetchGroupManager().getFetchGroups().size());
-
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- query.setHint(QueryHints.FETCH_GROUP_NAME, "test");
-
- Employee emp = (Employee) query.getSingleResult();
- assertNotNull(emp);
-
- FetchGroupTracker tracker = (FetchGroupTracker) emp;
- assertNotNull(tracker);
-
- FetchGroup usedFG = tracker._persistence_getFetchGroup();
-
- assertNotNull("No FetchGroup found on read Employee", usedFG);
- assertEquals(fetchGroup.getName(), usedFG.getName());
- assertSame(fetchGroup, ((EntityFetchGroup<?>) usedFG).getParent());
- assertEquals(2, fetchGroup.getFetchItems().size());
- assertTrue(tracker._persistence_isAttributeFetched("id"));
- assertTrue(tracker._persistence_isAttributeFetched("version"));
- assertFalse(tracker._persistence_isAttributeFetched("salary"));
- assertFalse(tracker._persistence_isAttributeFetched("firstName"));
- assertFalse(tracker._persistence_isAttributeFetched("lastName"));
- }
-
- @Test
- public void namedNamesFetchGroupUsingGetSingleResult() throws Exception {
- ClassDescriptor descriptor = getDescriptor("Employee");
-
- FetchGroup fetchGroup = new FetchGroup("names");
- fetchGroup.addAttribute("firstName");
- fetchGroup.addAttribute("lastName");
-
- descriptor.getFetchGroupManager().addFetchGroup(fetchGroup);
- assertEquals(2, fetchGroup.getFetchItems().size());
-
- assertEquals(2, descriptor.getFetchGroupManager().getFetchGroups().size());
-
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- query.setHint(QueryHints.FETCH_GROUP_NAME, "names");
-
- Employee emp = (Employee) query.getSingleResult();
- assertNotNull(emp);
-
- FetchGroupTracker tracker = (FetchGroupTracker) emp;
- assertNotNull(tracker);
-
- FetchGroup usedFG = tracker._persistence_getFetchGroup();
-
- assertNotNull("No FetcGroup found on read Employee", fetchGroup);
- assertSame(fetchGroup, ((EntityFetchGroup<?>) usedFG).getParent());
- assertEquals(4, fetchGroup.getFetchItems().size());
- assertTrue(tracker._persistence_isAttributeFetched("id"));
- assertTrue(tracker._persistence_isAttributeFetched("version"));
- assertFalse(tracker._persistence_isAttributeFetched("salary"));
- assertTrue(tracker._persistence_isAttributeFetched("firstName"));
- assertTrue(tracker._persistence_isAttributeFetched("lastName"));
- }
-
- @Test
- public void joinFetchEmployeeAddressWithDynamicFetchGroup() {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address");
-
- FetchGroup fetchGroup = new FetchGroup("names");
- fetchGroup.addAttribute("firstName");
- fetchGroup.addAttribute("lastName");
- query.setHint(QueryHints.FETCH_GROUP, fetchGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- }
-
- @Test
- public void joinFetchEmployeeAddressPhoneWithDynamicFetchGroup() {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT p.id FROM PhoneNumber p)");
-
- FetchGroup fetchGroup = new FetchGroup("names");
- fetchGroup.addAttribute("firstName");
- fetchGroup.addAttribute("lastName");
- query.setHint(QueryHints.FETCH_GROUP, fetchGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- }
-
- /**
- *
- */
- @Before
- public void config() throws Exception {
- assertConfig(getEMF(), "Employee", null, 0);
- assertConfig(getEMF(), "Address", null, 0);
- assertConfig(getEMF(), "PhoneNumber", null, 0);
-
- FetchGroup<Employee> namedEmpFG = new FetchGroup<Employee>("Employee.test");
- namedEmpFG.addAttribute("firstName");
- namedEmpFG.addAttribute("lastName");
- getDescriptor("Employee").getFetchGroupManager().addFetchGroup(namedEmpFG);
-
- FetchGroup<PhoneNumber> namedPhoneFG = new FetchGroup<PhoneNumber>("Phone.test");
- namedPhoneFG.addAttribute("number");
- getDescriptor("PhoneNumber").getFetchGroupManager().addFetchGroup(namedPhoneFG);
-
- FetchGroup<Address> namedAddressFG = new FetchGroup<Address>("Address.test");
- namedAddressFG.addAttribute("city");
- getDescriptor("Address").getFetchGroupManager().addFetchGroup(namedAddressFG);
-
- assertConfig(getEMF(), "Employee", null, 1);
- assertConfig(getEMF(), "Address", null, 1);
- assertConfig(getEMF(), "PhoneNumber", null, 1);
-
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- }
-
- @After
- public void resetFetchGroups() throws Exception {
- ClassDescriptor descriptor = getDescriptor("Employee");
- if (descriptor.getFetchGroupManager() != null) {
- descriptor.getFetchGroupManager().setDefaultFetchGroup(null);
- descriptor.getFetchGroupManager().getFetchGroups().clear();
- }
-
- descriptor = getDescriptor("Address");
- if (descriptor.getFetchGroupManager() != null) {
- descriptor.getFetchGroupManager().setDefaultFetchGroup(null);
- descriptor.getFetchGroupManager().getFetchGroups().clear();
- }
- descriptor = getDescriptor("PhoneNumber");
- if (descriptor.getFetchGroupManager() != null) {
- descriptor.getFetchGroupManager().setDefaultFetchGroup(null);
- descriptor.getFetchGroupManager().getFetchGroups().clear();
- }
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/SimpleSerializeFetchGroupTests.java b/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/SimpleSerializeFetchGroupTests.java
deleted file mode 100644
index b7ac1a4..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.nested-fetchgroup/test-src/test/SimpleSerializeFetchGroupTests.java
+++ /dev/null
@@ -1,671 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 273057: NestedFetchGroup Example
- ******************************************************************************/
-package test;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
-import static test.FetchGroupAssert.assertFetched;
-import static test.FetchGroupAssert.assertFetchedAttribute;
-import static test.FetchGroupAssert.assertNoFetchGroup;
-import static test.FetchGroupAssert.assertNotFetchedAttribute;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import javax.persistence.TypedQuery;
-
-import model.Employee;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.indirection.IndirectList;
-import org.eclipse.persistence.internal.helper.SerializationHelper;
-import org.eclipse.persistence.internal.queries.DetachedFetchItem;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.OneToManyMapping;
-import org.eclipse.persistence.queries.EntityFetchGroup;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.FetchGroup.FetchItem;
-import org.junit.Test;
-
-import example.Queries;
-
-/**
- * Simple tests to verify the functionality of {@link FetchGroup} when the
- * entities are detached through serialization.
- *
- * @author dclarke
- * @since EclipseLink 2.1
- */
-public class SimpleSerializeFetchGroupTests extends BaseFetchGroupTests {
-
- @Test
- public void verifyWriteReplaceOnFetchGroup() throws Exception {
- FetchGroup<?> fg = new FetchGroup();
- fg.addAttribute("basic");
- fg.addAttribute("a.b");
-
- assertTrue(fg.getClass() == FetchGroup.class);
-
- FetchGroup<?> serFG = serialize(fg);
-
- assertNotNull(serFG);
- assertTrue(serFG.getClass() == EntityFetchGroup.class);
- assertTrue(serFG.hasFetchItems());
-
- FetchItem basicFI = serFG.getFetchItem("basic");
-
- assertNotNull(basicFI);
- assertTrue(basicFI instanceof DetachedFetchItem);
-
- FetchItem aFI = serFG.getFetchItem("a");
-
- assertNotNull(aFI);
- assertTrue(aFI instanceof DetachedFetchItem);
- assertNotNull(aFI.getFetchGroup());
- assertTrue(aFI.getFetchGroup() instanceof EntityFetchGroup<?>);
- EntityFetchGroup<?> aEFG = (EntityFetchGroup<?>) aFI.getFetchGroup();
- assertNull(aEFG.getParent());
- assertTrue(aEFG.hasFetchItems());
-
- FetchItem bFI = aEFG.getFetchItem("b");
-
- assertNotNull(bFI);
- assertTrue(bFI instanceof DetachedFetchItem);
- assertNull(bFI.getFetchGroup());
- }
-
- @Test
- public void findMinimalFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
- int minId = Queries.minimumEmployeeId(em);
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- Map<String, Object> properties = new HashMap<String, Object>();
-
- FetchGroup fg = new FetchGroup();
- fg.addAttribute("id");
- fg.addAttribute("version");
-
- properties.put(QueryHints.FETCH_GROUP, fg);
-
- Employee emp = em.find(Employee.class, minId, properties);
-
- assertNotNull(emp);
- assertFetched(getEMF(), emp, fg);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertNotFetchedAttribute(getEMF(), emp, "firstName");
- assertNotFetchedAttribute(getEMF(), emp, "lastName");
- assertNotFetchedAttribute(getEMF(), emp, "gender");
- assertNotFetchedAttribute(getEMF(), emp, "salary");
- assertNotFetchedAttribute(getEMF(), emp, "startTime");
- assertNotFetchedAttribute(getEMF(), emp, "endTime");
- assertNotFetchedAttribute(getEMF(), emp, "period");
- assertNotFetchedAttribute(getEMF(), emp, "address");
- assertNotFetchedAttribute(getEMF(), emp, "manager");
- assertNotFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), emp, "projects");
-
- assertTrue(getFetchGroup(emp).getClass() == EntityFetchGroup.class);
- Employee serEmp = serialize(emp);
-
- assertNotNull(serEmp);
- assertFetchedAttribute(getEMF(), serEmp, "id");
- assertFetchedAttribute(getEMF(), serEmp, "version");
- assertNotFetchedAttribute(getEMF(), serEmp, "firstName");
- assertNotFetchedAttribute(getEMF(), serEmp, "lastName");
- assertNotFetchedAttribute(getEMF(), serEmp, "gender");
- assertNotFetchedAttribute(getEMF(), serEmp, "salary");
- assertNotFetchedAttribute(getEMF(), serEmp, "startTime");
- assertNotFetchedAttribute(getEMF(), serEmp, "endTime");
- assertNotFetchedAttribute(getEMF(), serEmp, "period");
- assertNotFetchedAttribute(getEMF(), serEmp, "address");
- assertNotFetchedAttribute(getEMF(), serEmp, "manager");
- assertNotFetchedAttribute(getEMF(), serEmp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), serEmp, "projects");
-
- assertTrue(getFetchGroup(serEmp) instanceof EntityFetchGroup<?>);
-
- serEmp.setFirstName("Doug");
- assertFetchedAttribute(getEMF(), serEmp, "firstName");
- }
-
- @Test
- public void findEmptyFetchGroup_setUnfetchedSalary() throws Exception {
- EntityManager em = getEntityManager();
- int minId = Queries.minimumEmployeeId(em);
-
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- Map<String, Object> properties = new HashMap<String, Object>();
- FetchGroup emptyFG = new FetchGroup();
- properties.put(QueryHints.FETCH_GROUP, emptyFG);
-
- Employee emp = em.find(Employee.class, minId, properties);
-
- assertNotNull(emp);
- assertFetched(getEMF(), emp, emptyFG);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // Check Basics
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertNotFetchedAttribute(getEMF(), emp, "firstName");
- assertNotFetchedAttribute(getEMF(), emp, "lastName");
- assertNotFetchedAttribute(getEMF(), emp, "gender");
- assertNotFetchedAttribute(getEMF(), emp, "salary");
- assertNotFetchedAttribute(getEMF(), emp, "startTime");
- assertNotFetchedAttribute(getEMF(), emp, "endTime");
- if (emp.getPeriod() != null) {
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "startDate");
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "endDate");
- }
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // Check Relationships
- assertNotFetchedAttribute(getEMF(), emp, "address");
- assertNotFetchedAttribute(getEMF(), emp, "manager");
- assertNotFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), emp, "projects");
-
- emp.setSalary(1);
-
- assertFetchedAttribute(getEMF(), emp, "salary");
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- emp.getAddress();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- emp.getPhoneNumbers().size();
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
- }
-
- /**
- * Verify that attributes added to detached EntityFetchGroup are added using
- * DetachedFetchItem
- */
- @Test
- public void verifyAddAttributeInDetachedEntityFetchGroup() {
- EntityFetchGroup<Employee> detFG = new EntityFetchGroup<Employee>(null);
-
- detFG.addAttribute("basic");
- detFG.addAttribute("a.b");
-
- assertNull(detFG.getParent());
- assertEquals(2, detFG.getFetchItems().size());
-
- FetchItem basicItem = detFG.getFetchItem("basic");
- assertNotNull(basicItem);
- assertEquals("basic", basicItem.getAttributeName());
- assertTrue(basicItem instanceof DetachedFetchItem);
- assertNull(basicItem.getFetchGroup());
- assertSame(detFG, basicItem.getParentFetchGroup());
- assertFalse(basicItem.useDefaultFetchGroup());
-
- FetchItem aItem = detFG.getFetchItem("a");
- assertNotNull(aItem);
- assertEquals("a", aItem.getAttributeName());
- assertTrue(aItem instanceof DetachedFetchItem);
- assertNotNull(aItem.getFetchGroup());
- assertSame(detFG, aItem.getParentFetchGroup());
- assertFalse(aItem.useDefaultFetchGroup());
- assertTrue(aItem.getFetchGroup() instanceof EntityFetchGroup<?>);
-
- EntityFetchGroup<?> aFG = (EntityFetchGroup<?>) aItem.getFetchGroup();
-
- assertEquals(1, aFG.getFetchItems().size());
-
- FetchItem bItem = aFG.getFetchItem("b");
- assertNotNull(bItem);
- assertEquals("b", bItem.getAttributeName());
- assertTrue(bItem instanceof DetachedFetchItem);
- assertNull(bItem.getFetchGroup());
- assertSame(aFG, bItem.getParentFetchGroup());
- assertFalse(bItem.useDefaultFetchGroup());
- }
-
- @Test
- public void singleResultEmptyFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- FetchGroup emptyFG = new FetchGroup();
- query.setHint(QueryHints.FETCH_GROUP, emptyFG);
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertNotNull(emp);
- assertFetched(getEMF(), emp, emptyFG);
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // Check Basics
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertNotFetchedAttribute(getEMF(), emp, "firstName");
- assertNotFetchedAttribute(getEMF(), emp, "lastName");
- assertNotFetchedAttribute(getEMF(), emp, "gender");
- assertNotFetchedAttribute(getEMF(), emp, "salary");
- assertNotFetchedAttribute(getEMF(), emp, "startTime");
- assertNotFetchedAttribute(getEMF(), emp, "endTime");
- if (emp.getPeriod() != null) {
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "startDate");
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "endDate");
- }
-
- // Check Relationships
- assertNotFetchedAttribute(getEMF(), emp, "address");
- assertNotFetchedAttribute(getEMF(), emp, "manager");
- assertNotFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), emp, "projects");
-
- emp.getSalary();
-
- assertFetchedAttribute(getEMF(), emp, "salary");
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- emp.getAddress();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- emp.getPhoneNumbers().size();
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
- }
-
- /**
- *
- */
- @Test
- public void resultListEmptyFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- FetchGroup emptyFG = new FetchGroup();
- query.setHint(QueryHints.FETCH_GROUP, emptyFG);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- assertEquals(1, emps.size());
-
- Employee emp = emps.get(0);
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, emptyFG);
-
- // Check Basics
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertNotFetchedAttribute(getEMF(), emp, "firstName");
- assertNotFetchedAttribute(getEMF(), emp, "lastName");
- assertNotFetchedAttribute(getEMF(), emp, "gender");
- assertNotFetchedAttribute(getEMF(), emp, "salary");
- assertNotFetchedAttribute(getEMF(), emp, "startTime");
- assertNotFetchedAttribute(getEMF(), emp, "endTime");
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- if (emp.getPeriod() != null) {
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "startDate");
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "endDate");
- }
-
- // Check Relationships
- assertNotFetchedAttribute(getEMF(), emp, "address");
- assertNotFetchedAttribute(getEMF(), emp, "manager");
- assertNotFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), emp, "projects");
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getSalary();
-
- assertFetchedAttribute(getEMF(), emp, "salary");
- assertNoFetchGroup(getEMF(), emp);
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- /**
- *
- */
- @Test
- public void resultListPeriodFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- FetchGroup fg = new FetchGroup();
- fg.addAttribute("period");
- query.setHint(QueryHints.FETCH_GROUP, fg);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- assertEquals(1, emps.size());
-
- Employee emp = emps.get(0);
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, fg);
-
- // Check Basics
- assertFetchedAttribute(getEMF(), emp, "id");
- assertFetchedAttribute(getEMF(), emp, "version");
- assertNotFetchedAttribute(getEMF(), emp, "firstName");
- assertNotFetchedAttribute(getEMF(), emp, "lastName");
- assertNotFetchedAttribute(getEMF(), emp, "gender");
- assertNotFetchedAttribute(getEMF(), emp, "salary");
- assertNotFetchedAttribute(getEMF(), emp, "startTime");
- assertNotFetchedAttribute(getEMF(), emp, "endTime");
- if (emp.getPeriod() != null) {
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "startDate");
- assertFetchedAttribute(getEMF(), emp.getPeriod(), "endDate");
- }
-
- // Check Relationships
- assertNotFetchedAttribute(getEMF(), emp, "address");
- assertNotFetchedAttribute(getEMF(), emp, "manager");
- assertNotFetchedAttribute(getEMF(), emp, "phoneNumbers");
- assertNotFetchedAttribute(getEMF(), emp, "projects");
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getSalary();
-
- assertFetchedAttribute(getEMF(), emp, "salary");
- assertNoFetchGroup(getEMF(), emp);
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertNoFetchGroup(getEMF(), emp.getAddress());
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- }
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void managerFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- // Use q query since find will only use default fetch group
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", Queries.minimumEmployeeId(em));
- FetchGroup managerFG = new FetchGroup();
- managerFG.addAttribute("manager");
-
- query.setHint(QueryHints.FETCH_GROUP, managerFG);
-
- assertNotNull(JpaHelper.getReadAllQuery(query).getFetchGroup());
- assertSame(managerFG, JpaHelper.getReadAllQuery(query).getFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertFetched(getEMF(), emp, managerFG);
- assertFetchedAttribute(getEMF(), emp, "manager");
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getManager();
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- if (emp.getManager() != null) {
- assertFetchedAttribute(getEMF(), emp, "manager");
- }
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getLastName();
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- phone.getAreaCode();
- }
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void managerFetchGroupWithJoinFetch() throws Exception {
- EntityManager em = getEntityManager();
-
- int minId = Queries.minimumEmployeeId(em);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // Use q query since find will only use default fetch group
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", minId);
- FetchGroup managerFG = new FetchGroup();
- managerFG.addAttribute("manager");
-
- query.setHint(QueryHints.FETCH_GROUP, managerFG);
- query.setHint(QueryHints.LEFT_FETCH, "e.manager");
-
- assertNotNull(JpaHelper.getReadAllQuery(query).getFetchGroup());
- assertSame(managerFG, JpaHelper.getReadAllQuery(query).getFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, managerFG);
- assertFetchedAttribute(getEMF(), emp, "manager");
-
- emp.getManager();
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getLastName();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- phone.getAreaCode();
- }
-
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void employeeNamesFetchGroup() throws Exception {
- EntityManager em = getEntityManager();
-
- int minId = Queries.minimumEmployeeId(em);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // Use q query since find will only use default fetch group
- Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID");
- query.setParameter("ID", minId);
- FetchGroup namesFG = new FetchGroup();
- namesFG.addAttribute("firstName");
- namesFG.addAttribute("lastName");
-
- query.setHint(QueryHints.FETCH_GROUP, namesFG);
-
- assertNotNull(JpaHelper.getReadAllQuery(query).getFetchGroup());
- assertSame(namesFG, JpaHelper.getReadAllQuery(query).getFetchGroup());
-
- Employee emp = (Employee) query.getSingleResult();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, namesFG);
-
- emp.getId();
- emp.getFirstName();
- emp.getLastName();
- emp.getVersion();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertFetched(getEMF(), emp, namesFG);
-
- emp.getGender();
- emp.getSalary();
-
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp);
-
- for (PhoneNumber phone : emp.getPhoneNumbers()) {
- assertNoFetchGroup(getEMF(), phone);
- phone.getAreaCode();
- }
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- emp.getManager();
-
- assertEquals(5, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertNoFetchGroup(getEMF(), emp.getManager());
- }
-
- @Test
- public void joinFetchEmployeeAddressWithDynamicFetchGroup() {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address");
-
- FetchGroup fetchGroup = new FetchGroup("names");
- fetchGroup.addAttribute("firstName");
- fetchGroup.addAttribute("lastName");
- query.setHint(QueryHints.FETCH_GROUP, fetchGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- }
-
- @Test
- public void joinFetchEmployeeAddressPhoneWithDynamicFetchGroup() {
- EntityManager em = getEntityManager();
-
- Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT p.id FROM PhoneNumber p)");
-
- FetchGroup fetchGroup = new FetchGroup("names");
- fetchGroup.addAttribute("firstName");
- fetchGroup.addAttribute("lastName");
- query.setHint(QueryHints.FETCH_GROUP, fetchGroup);
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- }
-
- @Test
- public void verifyUnfetchedAttributes() throws Exception {
- EntityManager em = getEntityManager();
-
- TypedQuery<Employee> q = em.createQuery("SELECT e FROM Employee e WHERE e.id IN (SELECT MIN(p.id) FROM PhoneNumber p)", Employee.class);
- FetchGroup<Employee> fg = new FetchGroup<Employee>("Employee.empty");
- q.setHint(QueryHints.FETCH_GROUP, fg);
- Employee emp = q.getSingleResult();
-
- assertNotNull(emp);
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- // This check using the mapping returns a default (empty) IndirectList
- OneToManyMapping phoneMapping = (OneToManyMapping) getDescriptor(emp).getMappingForAttributeName("phoneNumbers");
- IndirectList phones = (IndirectList) phoneMapping.getAttributeValueFromObject(emp);
- assertNotNull(phones);
- assertTrue(phones.isInstantiated());
- assertEquals(0, phones.size());
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- IndirectList phonesIL = (IndirectList) emp.getPhoneNumbers();
- assertFalse(phonesIL.isInstantiated());
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertTrue(emp.getPhoneNumbers().size() > 0);
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void verifyFetchedRelationshipAttributes() throws Exception {
- EntityManager em = getEntityManager();
-
- FetchGroup<Employee> fg = new FetchGroup<Employee>("Employee.relationships");
- fg.addAttribute("address");
- fg.addAttribute("phoneNumbers");
- fg.addAttribute("manager");
- fg.addAttribute("projects");
-
- Map<String, Object> hints = new HashMap<String, Object>();
- hints.put(QueryHints.FETCH_GROUP, fg);
-
- Employee emp = Queries.minimumEmployee(em, hints);
-
- assertNotNull(emp);
-
- }
-
- private <T> T serialize(Serializable entity) throws IOException, ClassNotFoundException {
- byte[] bytes = SerializationHelper.serialize(entity);
- return (T) SerializationHelper.deserialize(bytes);
- }
-
- /**
- * Verify the state of all descriptors where no FetchGroup have been
- * configured.
- */
- @Override
- protected EntityManager getEntityManager() {
- assertConfig(getEMF(), "Employee", null, 0);
- assertConfig(getEMF(), "Address", null, 0);
- assertConfig(getEMF(), "PhoneNumber", null, 0);
- assertConfig(getEMF(), "Project", null, 0);
- assertConfig(getEMF(), "SmallProject", null, 0);
- assertConfig(getEMF(), "LargeProject", null, 0);
-
- JpaHelper.getServerSession(getEMF()).getIdentityMapAccessor().initializeAllIdentityMaps();
- return super.getEntityManager();
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/.classpath b/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/.classpath
deleted file mode 100644
index 7045ba6..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="test-src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.example.jpa.employee.xml"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/.project b/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/.project
deleted file mode 100644
index 7f9fdb9..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.persistence.example.jpa.serializeem</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/src/example/SerializeEM_Example.java b/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/src/example/SerializeEM_Example.java
deleted file mode 100644
index baf42c3..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/src/example/SerializeEM_Example.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package example;
-
-import java.sql.Time;
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.internal.helper.SerializationHelper;
-import org.eclipse.persistence.internal.jpa.EntityManagerHandle;
-
-import junit.framework.Assert;
-
-import model.Address;
-import model.Employee;
-import model.Gender;
-import model.PhoneNumber;
-
-public class SerializeEM_Example {
-
- /**
- * @param args
- */
- public static void main(String[] args) throws Exception {
- Map<String, String> properties = new HashMap<String, String>();
- properties.put(PersistenceUnitProperties.SESSION_NAME, "employee");
- EntityManagerFactory emf = Persistence.createEntityManagerFactory("employee", properties);
- EntityManager em = emf.createEntityManager();
-
- Employee emp = new Queries().minEmployeeWithAddressAndPhones(em);
- emp.setSalary(emp.getSalary() + 1);
- emp.setEndTime(new Time(System.currentTimeMillis()));
- emp.getPeriod().setEndDate(Calendar.getInstance());
- Employee newEmp = new Employee();
- newEmp.setId(666666666);
- newEmp.setFirstName("Doug");
- newEmp.setLastName("Clarke");
- newEmp.setGender(Gender.Male);
-
- em.persist(newEmp);
-
- Assert.assertNotNull(em.find(Employee.class, 666666666));
-
- EntityManagerHandle emHandle = new EntityManagerHandle(em);
-
- EntityManagerHandle emHandle2 = (EntityManagerHandle) SerializationHelper.deserialize(SerializationHelper.serialize(emHandle));
-
- Assert.assertNotSame(emHandle, emHandle2);
-
- EntityManager em2 = emHandle2.getEntityManager();
-
- Employee emp2 = em2.find(Employee.class, emp.getId());
-
- Assert.assertNotSame(emp, emp2);
- Assert.assertNotNull(em2.find(Employee.class, 666666666));
-
- em2.getTransaction().begin();
-
- emp2.getAddress().setPostalCode(emp2.getAddress().getPostalCode().equals("AAA111") ? "111AAA" : "AAA111");
- emp2.getPhoneNumbers().size();
-
- // Employee newEmp2 = em2.find(Employee.class, 666666666);
- // newEmp2.setSalary(123456);
-
- em2.flush();
- em2.getTransaction().rollback();
-
- em.close();
- em2.close();
- emf.close();
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/src/org/eclipse/persistence/internal/jpa/EntityManagerHandle.java b/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/src/org/eclipse/persistence/internal/jpa/EntityManagerHandle.java
deleted file mode 100644
index ab4cd6a..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/src/org/eclipse/persistence/internal/jpa/EntityManagerHandle.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Example utility to support serializing EntityManager for use in
- * HTTP session state replication
- ******************************************************************************/
-package org.eclipse.persistence.internal.jpa;
-
-import java.io.ObjectStreamException;
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.persistence.EntityManager;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.descriptors.changetracking.ChangeTracker;
-import org.eclipse.persistence.indirection.IndirectContainer;
-import org.eclipse.persistence.indirection.ValueHolderInterface;
-import org.eclipse.persistence.internal.descriptors.changetracking.AttributeChangeListener;
-import org.eclipse.persistence.internal.identitymaps.CacheKey;
-import org.eclipse.persistence.internal.indirection.BasicIndirectionPolicy;
-import org.eclipse.persistence.internal.indirection.UnitOfWorkQueryValueHolder;
-import org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder;
-import org.eclipse.persistence.internal.sessions.AggregateChangeRecord;
-import org.eclipse.persistence.internal.sessions.AggregateCollectionChangeRecord;
-import org.eclipse.persistence.internal.sessions.AggregateObjectChangeSet;
-import org.eclipse.persistence.internal.sessions.ChangeRecord;
-import org.eclipse.persistence.internal.sessions.ObjectChangeSet;
-import org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork;
-import org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.mappings.ForeignReferenceMapping;
-import org.eclipse.persistence.sessions.server.Server;
-
-/**
- * The EntityManagerHandle class provides a serializable wrapper for an
- * {@link EntityManager}. The intent is to allow an EntityManager to be
- * serialized between nodes and thus allow a persistence context to be continued
- * in a new application instance for fail-over situations.
- *
- * @author dclarke
- * @since EclipseLink 1.1.2
- */
-public class EntityManagerHandle implements Serializable {
-
- private static final long serialVersionUID = 1l;
-
- /**
- * The wrapped EntityManager
- */
- private EntityManagerImpl entityManager;
-
- /**
- * This map is the state cached of a {@link RepeatableWriteUnitOfWork} when
- * the handle is serialized. It is used to re-initialize a handle. This map
- * is only not null when the handle is not initialzied.
- */
- private Map<Object, Object> uowCloneMapping;
-
- /**
- * Map of clones to {@link ObjectChangeSet} captured from ...
- */
- private Map<Object, ObjectChangeSet> changeSets;
-
- private Map<Object, Object> newObjectsCloneToOriginal;
-
- public EntityManagerHandle(EntityManager em) {
- this.entityManager = (EntityManagerImpl) JpaHelper.getEntityManager(em);
- }
-
- protected EntityManagerHandle(EntityManager em, Map<Object, Object> cloneMapping, Map<Object, ObjectChangeSet> changetSets, Map<Object, Object> newObjectsCloneToOriginal) {
- this.entityManager = (EntityManagerImpl) JpaHelper.getEntityManager(em);
-
- this.uowCloneMapping = cloneMapping;
- this.newObjectsCloneToOriginal = newObjectsCloneToOriginal;
-
- this.changeSets = changetSets;
- }
-
- protected EntityManagerImpl getEntityManagerImpl() {
- return this.entityManager;
- }
-
- public boolean isInitialized() {
- return this.uowCloneMapping == null;
- }
-
- public EntityManager getEntityManager() {
- if (!isInitialized()) {
- initialize();
- }
- return this.entityManager;
- }
-
- public Map<?, ?> getUowCloneMapping() {
- return uowCloneMapping;
- }
-
- public Map<Object, ObjectChangeSet> getChangeSets() {
- return this.changeSets;
- }
-
- /**
- * The initialize operation will fix up the contained
- * {@link RepeatableWriteUnitOfWork} to ensure it and all of its contained
- * objects have their proper session state that is lost when serialized. It
- * is done lazily to ensure it is only done in receivers that require it to
- * continue functioning and not just storage in case of fail-over cases.
- */
- protected synchronized void initialize() {
- RepeatableWriteUnitOfWork uow = (RepeatableWriteUnitOfWork) getEntityManagerImpl().getUnitOfWork();
-
- if (getUowCloneMapping() != null) {
- for (Object clone : getUowCloneMapping().keySet()) {
- initialize(uow, clone, getUowCloneMapping().get(clone));
- }
-
- this.newObjectsCloneToOriginal = null;
- this.uowCloneMapping = null;
- this.changeSets = null;
- }
- }
-
- /**
- * Initialize a clone added to this {@link RepeatableWriteUnitOfWork}. The
- * clone was previously serialized and has thus lost any transient state.
- * This method handles populating this state to work with the new
- * {@link RepeatableWriteUnitOfWork}.
- *
- * @param uow
- * @param clone
- */
- @SuppressWarnings("unchecked")
- private void initialize(RepeatableWriteUnitOfWork uow, Object clone, Object backupClone) {
- Server session = getEntityManagerImpl().getServerSession();
- ClassDescriptor descriptor = session.getClassDescriptor(clone);
- // need to put clone in identityMap as well.
- if (getChangeSets().containsKey(clone)) {
- ObjectChangeSet ocs = getChangeSets().get(clone);
- if (!ocs.isNew()) {
- uow.getIdentityMapAccessor().putInIdentityMap(clone);
- uow.getCloneMapping().put(clone, backupClone);
- } else {
- uow.registerNewObject(clone);
- }
- } else {
- if (this.newObjectsCloneToOriginal.containsKey(clone)) {
- uow.registerNewObject(clone);
- } else {
- // has no changes.
- uow.getCloneMapping().put(clone, backupClone);
- uow.getIdentityMapAccessor().putInIdentityMap(clone);
- }
- }
-
- if (ChangeTracker.class.isAssignableFrom(clone.getClass())) {
- initializeChangeTracker((ChangeTracker) clone, uow, descriptor);
- }
-
- for (DatabaseMapping mapping : descriptor.getMappings()) {
- ValueHolderInterface vhi = getValueHolder(mapping, clone);
-
- if (vhi != null && !vhi.isInstantiated()) {
- UnitOfWorkValueHolder uowVH = (UnitOfWorkValueHolder) vhi;
- uowVH.setSession(uow);
- Object original = session.readObject(clone);
-
- ValueHolderInterface wrappedHolder = getValueHolder(mapping, original);
- uowVH = new UnitOfWorkQueryValueHolder(wrappedHolder, clone, (ForeignReferenceMapping) mapping, uowVH.getRow(), uow);
- setValueHolder((ForeignReferenceMapping) mapping, clone, uowVH);
-
- uowVH = new UnitOfWorkQueryValueHolder(wrappedHolder, backupClone, (ForeignReferenceMapping) mapping, uowVH.getRow(), uow);
- setValueHolder((ForeignReferenceMapping) mapping, backupClone, uowVH);
- }
- }
- }
-
- /**
- * Setup a change tracker.
- *
- * TODO: What about aggregates? TODO: Can existing infrastructure for
- * building working copies with change listeners be used?
- *
- * @param changeTracker
- * @param uow
- * @param descriptor
- */
- @SuppressWarnings("unchecked")
- private void initializeChangeTracker(ChangeTracker changeTracker, RepeatableWriteUnitOfWork uow, ClassDescriptor descriptor) {
- AttributeChangeListener listener = (AttributeChangeListener) changeTracker._persistence_getPropertyChangeListener();
-
- if (uow.getUnitOfWorkChangeSet() == null) {
- uow.setUnitOfWorkChangeSet(new UnitOfWorkChangeSet(uow));
- }
-
- if (listener != null) {
- listener.setUnitOfWork(uow);
- } else {
- listener = new AttributeChangeListener(descriptor, uow, changeTracker);
- changeTracker._persistence_setPropertyChangeListener(listener);
- }
-
- if (getChangeSets().containsKey(changeTracker)) {
- ObjectChangeSet ocs = getChangeSets().get(changeTracker);
- // must create and merge so that we can place the UOW clone in the
- // changeSet for later commit.
- ObjectChangeSet newOCS = new ObjectChangeSet(changeTracker, (UnitOfWorkChangeSet) uow.getUnitOfWorkChangeSet(), ocs.isNew());
- newOCS.setCacheKey(ocs.getCacheKey());
-
- ocs.getClassType(uow);
- ocs.setUOWChangeSet((UnitOfWorkChangeSet) new UnitOfWorkChangeSet());
- for (ChangeRecord entry : (Vector<ChangeRecord>) ocs.getChanges()) {
- // reset transient mappings in ChangeRecords.
- DatabaseMapping mapping = descriptor.getMappingForAttributeName(entry.getAttribute());
- if (mapping.isAggregateObjectMapping()) {
- Object aggregate = mapping.getRealAttributeValueFromObject(changeTracker, uow);
- AggregateObjectChangeSet aocs = new AggregateObjectChangeSet(new Vector(0), aggregate.getClass(), aggregate, (UnitOfWorkChangeSet) uow.getUnitOfWorkChangeSet(), true);
- ((UnitOfWorkChangeSet) uow.getUnitOfWorkChangeSet()).addObjectChangeSetForIdentity(aocs, aggregate);
- aocs.mergeObjectChanges((ObjectChangeSet) ((AggregateChangeRecord) entry).getChangedObject(), (UnitOfWorkChangeSet) uow.getUnitOfWorkChangeSet(), (UnitOfWorkChangeSet) ocs.getUOWChangeSet());
- ((AggregateChangeRecord) entry).setChangedObject(aocs);
- for (ChangeRecord record : (Vector<ChangeRecord>) aocs.getChanges()) {
- record.setMapping(mapping.getReferenceDescriptor().getMappingForAttributeName(record.getAttribute()));
- }
-
- } else if (mapping.isAggregateCollectionMapping()) {
- Object attributeValue = mapping.getRealAttributeValueFromObject(changeTracker, uow);
- Vector<ObjectChangeSet> changes = (Vector<ObjectChangeSet>) ((AggregateCollectionChangeRecord) entry).getChangedValues();
- Object iterator = mapping.getContainerPolicy().iteratorFor(attributeValue);
-
- while (mapping.getContainerPolicy().hasNext(iterator)) {
- Object aggregate = mapping.getContainerPolicy().next(iterator, uow);
- CacheKey cacheKey = new CacheKey(mapping.getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(aggregate, uow));
- int index = changes.indexOf(cacheKey);
- if (index >= 0) {
- ObjectChangeSet aggChangeSet = changes.get(index);
- ObjectChangeSet newAggChangeSet = new ObjectChangeSet(aggregate, (UnitOfWorkChangeSet) uow.getUnitOfWorkChangeSet(), true);
- ((UnitOfWorkChangeSet) uow.getUnitOfWorkChangeSet()).addObjectChangeSetForIdentity(newAggChangeSet, aggregate);
- newAggChangeSet.mergeObjectChanges(aggChangeSet, (UnitOfWorkChangeSet) uow.getUnitOfWorkChangeSet(), (UnitOfWorkChangeSet) ocs.getUOWChangeSet());
- for (ChangeRecord record : (Vector<ChangeRecord>) newAggChangeSet.getChanges()) {
- record.setMapping(mapping.getReferenceDescriptor().getMappingForAttributeName(record.getAttribute()));
- }
-
- }
- }
- }
- entry.setMapping(mapping);
- }
-
- listener.setObjectChangeSet(newOCS);
- ((UnitOfWorkChangeSet) uow.getUnitOfWorkChangeSet()).addObjectChangeSetForIdentity(newOCS, changeTracker);
- newOCS.mergeObjectChanges(ocs, (UnitOfWorkChangeSet) uow.getUnitOfWorkChangeSet(), (UnitOfWorkChangeSet) ocs.getUnitOfWorkClone());
- if (newOCS.hasChanges()) {
- // The listener's changes will not be recorded unless the
- // listener has received a change notification
- // this code skips the change calc step and forces the changes
- // into the current UOW changeset
- ((UnitOfWorkChangeSet) uow.getUnitOfWorkChangeSet()).addObjectChangeSet(newOCS, uow, newOCS.isNew());
- uow.addToChangeTrackedHardList(changeTracker);
- }
- }
- }
-
- /*
- * Helper method to retrieve the underlying ValueHolderInterface for a
- * relationship. Handle IndirectContainer unwrapping.
- */
- private ValueHolderInterface getValueHolder(DatabaseMapping mapping, Object entity) {
- Object value = null;
-
- if (mapping.isForeignReferenceMapping() && mapping.isLazy()) {
- value = mapping.getAttributeValueFromObject(entity);
-
- if (value != null && IndirectContainer.class.isAssignableFrom(value.getClass())) {
- value = ((IndirectContainer) value).getValueHolder();
- }
- }
- if (value != null && !(value instanceof ValueHolderInterface)) {
- return null;
- }
- return (ValueHolderInterface) value;
- }
-
- /*
- * Helper method to populate a new ValueHolderInterface into an object's
- * mapped relationship.
- */
- private void setValueHolder(ForeignReferenceMapping mapping, Object entity, ValueHolderInterface valueHolder) {
- if (mapping.getIndirectionPolicy() instanceof BasicIndirectionPolicy) {
- mapping.setAttributeValueInObject(entity, valueHolder);
- } else {
- IndirectContainer container = (IndirectContainer) mapping.getAttributeValueFromObject(entity);
- container.setValueHolder(valueHolder);
- }
- }
-
- /**
- * Replace this object which holds an non-serializable EntityManager with a
- * replacement that contains the essential state of the EntityManager for
- * use in other nodes.
- *
- * @return
- * @throws ObjectStreamException
- */
- public Object writeReplace() throws ObjectStreamException {
- verifyIsSerializable();
-
- return new SerializedEntityManager(getEntityManagerImpl());
- }
-
- /**
- * Verify the EntityManager being wrapped is in a state that it can be
- * serialized. For now we'll only allow EntityManagers not in active
- * transactions.
- */
- /*
- * TODO: Later this may be increased to include active JPA transactions
- * where no physical database transaction has been started. In this case
- * we'll also need to ensure that commit cycle of the UnitOfWork has not
- * been started.
- */
- public void verifyIsSerializable() {
- if (getEntityManagerImpl() == null) {
- throw new IllegalStateException("EntityManagerHandle cannot be serialized as it does not have an EntityManager");
- }
-
- if (!getEntityManagerImpl().isOpen()) {
- throw new IllegalStateException("EntityManagerHandle cannot be serialized as its EntityManager is closed");
- }
-
- if (getEntityManagerImpl().checkForTransaction(false) != null) {
- throw new IllegalStateException("EntityManagerHandle cannot be serialized as its EntityManager is in an active RESOURCE_LOCAL transaction");
- }
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/src/org/eclipse/persistence/internal/jpa/SerializedEntityManager.java b/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/src/org/eclipse/persistence/internal/jpa/SerializedEntityManager.java
deleted file mode 100644
index cfa3312..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/src/org/eclipse/persistence/internal/jpa/SerializedEntityManager.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.eclipse.persistence.internal.jpa;
-
-import java.io.ObjectStreamException;
-import java.io.Serializable;
-import java.util.Map;
-
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.persistence.internal.sessions.ObjectChangeSet;
-import org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork;
-import org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet;
-
-/**
- *
- * @author dclarke
- * @since EclipseLink 1.1.2 Example
- */
-public class SerializedEntityManager implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private String sessionName;
-
- private Map<?, ?> properties;
-
- private Map<Object, Object> cloneMappings;
-
- private Map<Object, Object> newObjectsCloneToOriginal;
-
- private Map<Object, ObjectChangeSet> changeSets;
-
- @SuppressWarnings("unchecked")
- public SerializedEntityManager(EntityManagerImpl entityManager) {
- this.sessionName = entityManager.getServerSession().getName();
- this.properties = entityManager.properties;
-
- if (entityManager.extendedPersistenceContext != null) {
- RepeatableWriteUnitOfWork uow = (RepeatableWriteUnitOfWork) entityManager.getUnitOfWork();
- this.cloneMappings = uow.getCloneMapping();
- this.newObjectsCloneToOriginal = uow.getNewObjectsCloneToOriginal();
-
- UnitOfWorkChangeSet uowcs = (UnitOfWorkChangeSet) uow.getUnitOfWorkChangeSet();
- if (uowcs != null) {
- this.changeSets = uowcs.getCloneToObjectChangeSet();
- }
- }
- }
-
- public String getSessionName() {
- return this.sessionName;
- }
-
- public Map<?, ?> getProperties() {
- return properties;
- }
-
- public Map<Object, Object> getCloneMappings() {
- return cloneMappings;
- }
-
- public Map<Object, ObjectChangeSet> getChangeSets() {
- return this.changeSets;
- }
-
- public Map<Object, Object> getNewObjectsCloneToOriginal() {
- return this.newObjectsCloneToOriginal;
- }
-
- public Object readResolve() throws ObjectStreamException {
- EntityManagerFactory emf = Persistence.createEntityManagerFactory(getSessionName());
- EntityManagerImpl em = (EntityManagerImpl) emf.createEntityManager(this.properties);
-
- return new EntityManagerHandle(em, getCloneMappings(), getChangeSets(), getNewObjectsCloneToOriginal());
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/test-src/testing/util/EntityManagerAssert.java b/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/test-src/testing/util/EntityManagerAssert.java
deleted file mode 100644
index 5af64eb..0000000
--- a/extensions/trunk/org.eclipse.persistence.example.jpa.serializeem/test-src/testing/util/EntityManagerAssert.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package testing.util;
-
-import javax.persistence.EntityManager;
-
-import org.eclipse.persistence.internal.jpa.EntityManagerImpl;
-
-public class EntityManagerAssert {
-
- public static void assertEclipseLink(EntityManager em) {
-
- }
-
- public static void assertEquals(EntityManager expected, EntityManager actual) {
- }
-
- public static void assertEquals(EntityManagerImpl expected, EntityManagerImpl actual) {
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/.classpath b/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/.classpath
deleted file mode 100644
index a78d9d2..0000000
--- a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry excluding="**/.svn/**" kind="src" path="src"/>
- <classpathentry excluding="**/.svn/**" kind="src" path="test-src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.example.jpa.employee.xml"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/.project b/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/.project
deleted file mode 100644
index db81b46..0000000
--- a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.persistence.extension.invalidgraph</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/src/org/eclipse/persistence/extension/EntityCollector.java b/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/src/org/eclipse/persistence/extension/EntityCollector.java
deleted file mode 100644
index fcd4c35..0000000
--- a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/src/org/eclipse/persistence/extension/EntityCollector.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288363: Extensions Incubator - RefreshInvalidGraphListener
- * http://wiki.eclipse.org/EclipseLink/Development/Incubator/Extensions/RefreshInvalidGraphListener
- ******************************************************************************/
-package org.eclipse.persistence.extension;
-
-import java.util.*;
-
-import org.eclipse.persistence.indirection.IndirectContainer;
-import org.eclipse.persistence.indirection.ValueHolderInterface;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.sessions.Session;
-
-
-/**
- * An example EclipseLink utility that can walk a graph of persistent entities
- * using the provided mappings to collect the objects in the related graph that
- * match the provided criteria.
- *
- * @author dclarke
- * @since EclipseLink 1.1.2
- */
-public class EntityCollector {
-
- private Set<Object> visitedEntities = new HashSet<Object>();
-
- private Map<Class<?>, Collection<Object>> entities = new HashMap<Class<?>, Collection<Object>>();
-
- private MappingCollector mappings;
-
- /**
- *
- * @param session
- * @param mappings
- * @param criteria
- * @param root
- */
- public EntityCollector(Session session, MappingCollector mappings, Criteria criteria, Object root) {
- this.visitedEntities = new HashSet<Object>();
- this.mappings = mappings;
- this.entities = new HashMap<Class<?>, Collection<Object>>();
-
- collect(session, criteria, root, null);
- }
-
- public Set<Object> getVisitedEntities() {
- return visitedEntities;
- }
-
- public Map<Class<?>, Collection<Object>> getInvalidEntities() {
- return entities;
- }
-
- public MappingCollector getMappings() {
- return mappings;
- }
-
- private void collectEntity(Object entity) {
- Collection<Object> entities = getInvalidEntities().get(entity.getClass());
-
- if (entities == null) {
- entities = new ArrayList<Object>();
- getInvalidEntities().put(entity.getClass(), entities);
- }
- entities.add(entity);
- }
-
- private Collection<DatabaseMapping> getMappings(Session session, Object entity) {
- if (entity == null) {
- return null;
- }
- return getMappings().getMappings(session, entity.getClass());
- }
-
- /**
- *
- * @param session
- * @param results
- * @param mapping
- */
- @SuppressWarnings("unchecked")
- private void collect(Session session, Criteria criteria, Object results, DatabaseMapping mapping) {
- if (results instanceof Collection<?>) {
- for (Object entity : (Collection<Object>) results) {
- collect(session, criteria, entity, mapping);
- }
- return;
- }
-
- if (results instanceof Map<?,?>) {
- for (Object entity : ((Map<?,?>) results).values()) {
- collect(session, criteria, entity, mapping);
- }
- return;
- }
-
- Object entity = results;
-
- if (visitedEntities.contains(entity)) {
- return;
- }
- visitedEntities.add(entity);
-
- if (criteria.collect(session, mapping, entity)) {
- collectEntity(entity);
- }
-
- // Walk the mapped relationships
- Collection<DatabaseMapping> frms = getMappings(session, entity);
- if (frms != null) {
- for (DatabaseMapping relMapping : getMappings(session, entity)) {
- Object relatedEntity = relMapping.getAttributeValueFromObject(entity);
-
- if (relatedEntity instanceof ValueHolderInterface) {
- ValueHolderInterface vh = (ValueHolderInterface) relatedEntity;
- if (vh.isInstantiated() && vh.getValue() != null) {
- collect(session, criteria, vh.getValue(), relMapping);
- }
- } else if (relatedEntity instanceof IndirectContainer) {
- IndirectContainer ic = (IndirectContainer) relatedEntity;
- if (ic.isInstantiated()) {
- collect(session, criteria, ic.getValueHolder().getValue(), relMapping);
- }
- } else {
- collect(session, criteria, relatedEntity, relMapping);
- }
- }
- }
- }
-
- public interface Criteria {
-
- boolean collect(Session session, DatabaseMapping mapping, Object entity);
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/src/org/eclipse/persistence/extension/MappingCollector.java b/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/src/org/eclipse/persistence/extension/MappingCollector.java
deleted file mode 100644
index 394ccbc..0000000
--- a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/src/org/eclipse/persistence/extension/MappingCollector.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288363: Extensions Incubator - RefreshInvalidGraphListener
- * http://wiki.eclipse.org/EclipseLink/Development/Incubator/Extensions/RefreshInvalidGraphListener
- ******************************************************************************/
-package org.eclipse.persistence.extension;
-
-import java.util.*;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.sessions.Session;
-
-/**
- * A simple utility to collect mappings based on specified criteria into a cache
- * for more optimal use in other processing. Typically used in event processing.
- *
- * @author dclarke
- * @since EclipseLink Extensions Incubator using 1.1.2
- */
-public class MappingCollector {
-
- /**
- * Cache of relationship mappings by persistent type.
- */
- private HashMap<Class<?>, Collection<DatabaseMapping>> mappings;
-
- /**
- * Criteria provided. This is held in case lazy collecting is required for
- * descriptors added to the session after login.
- */
- private Criteria criteria;
-
- public MappingCollector(Session session, Criteria criteria) {
- this.mappings = new HashMap<Class<?>, Collection<DatabaseMapping>>();
- this.criteria = criteria;
- collectMappings(session);
- }
-
- public HashMap<Class<?>, Collection<DatabaseMapping>> getMappings() {
- return this.mappings;
- }
-
- public Criteria getCriteria() {
- return this.criteria;
- }
-
- /**
- * Lookup the relationship mappings for the provided entity. If there are
- * none in the cache lazily create the collection of mappings. The lazy
- * creation of the collection should only happen for descriptors that were
- * added to the session after login, which is not very typical but allowed
- * to support some advanced dynamic persistence scenarios.
- */
- public Collection<DatabaseMapping> getMappings(Session session, Class<?> entityClass) {
- Collection<DatabaseMapping> mappings = getMappings().get(entityClass);
-
- if (mappings == null) {
- ClassDescriptor descriptor = session.getClassDescriptor(entityClass);
-
- if (descriptor != null) {
- collectMappings(descriptor);
- }
- }
-
- return mappings;
- }
-
- /**
- *
- * @param session
- */
- private void collectMappings(Session session) {
- for (Iterator<?> i = session.getDescriptors().values().iterator(); i.hasNext();) {
- ClassDescriptor descriptor = (ClassDescriptor) i.next();
-
- if (getCriteria().collect(descriptor)) {
- collectMappings(descriptor);
- }
- }
- }
-
- /**
- * Collect mappings for the specified descriptor based on
- * {@link Criteria#collect(DatabaseMapping)}
- */
- private void collectMappings(ClassDescriptor descriptor) {
- Collection<DatabaseMapping> mappings = new ArrayList<DatabaseMapping>();
- for (DatabaseMapping mapping : descriptor.getMappings()) {
- if (getCriteria().collect(mapping)) {
- mappings.add(mapping);
- }
- }
- getMappings().put(descriptor.getJavaClass(), mappings);
- }
-
- /**
- *
- */
- public interface Criteria {
- /**
- * Determines if the provided descriptor should be traversed collection
- * mappings. If true then a collection of mappings is collected for the
- * descriptor. If false an empty collection is placed in the collected
- * map.
- */
- boolean collect(ClassDescriptor descriptor);
-
- /**
- * Determines if the provided mapping should be collected.
- */
- boolean collect(DatabaseMapping mapping);
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/src/org/eclipse/persistence/extension/listeners/RefreshInvalidGraphListener.java b/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/src/org/eclipse/persistence/extension/listeners/RefreshInvalidGraphListener.java
deleted file mode 100644
index e863840..0000000
--- a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/src/org/eclipse/persistence/extension/listeners/RefreshInvalidGraphListener.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - Bug 288363: Extensions Incubator - RefreshInvalidGraphListener
- * http://wiki.eclipse.org/EclipseLink/Development/Incubator/Extensions/RefreshInvalidGraphListener
- ******************************************************************************/
-package org.eclipse.persistence.extension.listeners;
-
-import java.lang.reflect.Modifier;
-import java.util.*;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.extension.EntityCollector;
-import org.eclipse.persistence.extension.MappingCollector;
-import org.eclipse.persistence.internal.sessions.AbstractSession;
-import org.eclipse.persistence.logging.SessionLog;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.queries.ReadAllQuery;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.sessions.*;
-
-/**
- * This session event listener provides a work-around for accessing persistent
- * object graphs from the EclipseLink cache where related objects may be invalid
- * in the cache. EclipseLink's cache invalidation will only refresh the invalid
- * objects if they are directly queried for. This can cause a problem if an
- * application queries for a related object that is valid and then navigates
- * through relationships to the invalid one. Using this event listener the
- * application will now post-process query results to ensure all invalid objects
- * in the graph are refreshed.
- *
- * @author dclarke
- * @since EclipseLink 1.1.2
- */
-public class RefreshInvalidGraphListener extends SessionEventAdapter {
-
- /**
- * Flag used on queries to indicate that this listener should not process
- * them verifying their resulting object graphs. This is used internally on
- * the {@link #refresh(Session, Object)} queries to ensure these internally
- * generated queries do not cause additional verification processing. This
- * flag can also be set on application queries that should not have their
- * results verified.
- */
- public static final String DO_NOT_VERIFY_PROPERTY = "VerifyRelatedObjects-DoNotVerify";
-
- /** Cache of relationship mappings by persistent type. */
- private MappingCollector mappingsFilter;
-
- /**
- * Shared session (database/server) this listener was assigned to.
- * Initialized in {@link #postLogin(SessionEvent)}
- */
- private AbstractSession sharedSession;
-
- public MappingCollector getMappingsFilter() {
- return this.mappingsFilter;
- }
-
- public AbstractSession getSharedSession() {
- return this.sharedSession;
- }
-
- /**
- * This event is called after the execution of all queries. It will verify
- * the related entities for all object queries (ReadObjectQuery and
- * ReadAllQuery) which do not have the {@link #DO_NOT_VERIFY_PROPERTY}
- * property set.
- */
- @Override
- public void postExecuteQuery(SessionEvent event) {
- if (!event.getQuery().isObjectLevelReadQuery() || event.getQuery().getProperties().containsKey(DO_NOT_VERIFY_PROPERTY)) {
- return;
- }
-
- getSharedSession().getSessionLog().log(SessionLog.FINEST, "VerifyRelatedObjects.postExecuteQuery::" + event.getQuery());
- EntityCollector collector = new EntityCollector(getSharedSession(), getMappingsFilter(), new InvalidCacheCriteria(), event.getResult());
- refresh(collector.getInvalidEntities());
- }
-
- /**
- * Perform the refresh for all invalid entities. A refresh using IN is used
- * for cases where a class has multiple instances and it uses a single part
- * primary key. Otherwise the entities are looped through one at a time
- * doing separate refresh queries.
- */
- @SuppressWarnings("unchecked")
- private void refresh(Map<Class<?>, Collection<Object>> entitiesByClass) {
- for (Class<?> entityClass : entitiesByClass.keySet()) {
- Collection<Object> entities = entitiesByClass.get(entityClass);
- ClassDescriptor descriptor = getSharedSession().getClassDescriptor(entityClass);
-
- if (entities.size() > 1 && descriptor.getPrimaryKeyFields().size() == 1) {
- ReadAllQuery query = new ReadAllQuery(entityClass);
- query.refreshIdentityMapResult();
- query.setIsExecutionClone(true);
- query.setProperty(DO_NOT_VERIFY_PROPERTY, true);
-
- Object[] pks = new Object[entities.size()];
- int index = 0;
- for (Object entity : entities) {
- List<Object> entityPK = descriptor.getObjectBuilder().extractPrimaryKeyFromObject(entity, (AbstractSession) getSharedSession());
- pks[index++] = entityPK.get(0);
- }
- query.setSelectionCriteria(query.getExpressionBuilder().get(descriptor.getObjectBuilder().getPrimaryKeyMappings().get(0).getAttributeName()).in(pks));
- getSharedSession().getSessionLog().log(SessionLog.FINEST, "VerifyRelatedObjects.refresh::" + entityClass + " query: " + query);
- getSharedSession().executeQuery(query);
- } else {
- for (Object entity : entities) {
- ReadObjectQuery query = new ReadObjectQuery(entity);
- query.refreshIdentityMapResult();
- query.setIsExecutionClone(true);
- query.setProperty(DO_NOT_VERIFY_PROPERTY, true);
- getSharedSession().getSessionLog().log(SessionLog.FINEST, "VerifyRelatedObjects.refresh::" + entity + " query: " + query);
- getSharedSession().executeQuery(query);
- }
- }
- }
- }
-
- /**
- * This implementation of
- * {@link SessionEventListener#postLogin(SessionEvent)} is used to
- * initialize the cache of relationship mappings once during startup versus
- * lazily (and potentially with threading issues) during use of this event
- * listener's {@link #verifyGraph(Session, Object, HashSet)}
- */
- @Override
- public void postLogin(SessionEvent event) {
- this.sharedSession = (AbstractSession) event.getSession();
- this.mappingsFilter = new MappingCollector(getSharedSession(), new RelationshipMappingCriteria());
- }
-
- /**
- * Criteria for collecting the relationship mappings that will be checked.
- */
- private class RelationshipMappingCriteria implements MappingCollector.Criteria {
-
- public boolean collect(ClassDescriptor descriptor) {
- return !descriptor.isDescriptorForInterface() && !Modifier.isAbstract(descriptor.getJavaClass().getModifiers());
- }
-
- public boolean collect(DatabaseMapping mapping) {
- return mapping.getReferenceDescriptor() != null && !mapping.getReferenceDescriptor().shouldBeReadOnly();
- }
- }
-
- /**
- * Criteria used to identify the entities that are invalid and need to be
- * refreshed.
- */
- private class InvalidCacheCriteria implements EntityCollector.Criteria {
-
- @Override
- public boolean collect(Session session, DatabaseMapping mapping, Object entity) {
- return entity != null && (mapping != null && !mapping.isAggregateMapping() && !session.getIdentityMapAccessor().isValid(entity));
- }
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/AllTests.java b/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/AllTests.java
deleted file mode 100644
index c4b3ac4..0000000
--- a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/AllTests.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package testing;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { testing.example.util.AllTests.class, CheckRelatedInvalidEntities.class, RWUOWInBatchValueHolder.class })
-public class AllTests {
-}
diff --git a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/CheckRelatedInvalidEntities.java b/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/CheckRelatedInvalidEntities.java
deleted file mode 100644
index 3130314..0000000
--- a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/CheckRelatedInvalidEntities.java
+++ /dev/null
@@ -1,459 +0,0 @@
-package testing;
-
-import static junit.framework.Assert.*;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import model.*;
-
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.extension.listeners.RefreshInvalidGraphListener;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.ReadObjectQuery;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.Test;
-
-import example.Queries;
-
-@SuppressWarnings("unchecked")
-@PersistenceContext(unitName = "employee")
-public class CheckRelatedInvalidEntities extends EclipseLinkJPATest {
-
- @Test
- public void invalidAddress_find() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- Employee employee = new Queries().minEmployeeWithAddressAndPhones(em);
- Address address = employee.getAddress();
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
-
- session.getIdentityMapAccessor().invalidateObject(address);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertFalse(session.getIdentityMapAccessor().isValid(address));
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- em.find(Employee.class, employee.getId());
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
- assertEquals(numSelect + 1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void invalidAddress_refreshEmp_find() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- Employee employee = new Queries().minEmployeeWithAddressAndPhones(em);
- Address address = employee.getAddress();
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
-
- session.getIdentityMapAccessor().invalidateObject(address);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertFalse(session.getIdentityMapAccessor().isValid(address));
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- ReadObjectQuery query = new ReadObjectQuery(employee);
- query.refreshIdentityMapResult();
- query.setProperty(RefreshInvalidGraphListener.DO_NOT_VERIFY_PROPERTY, true);
- query.setIsExecutionClone(true);
- session.executeQuery(query);
- assertEquals(numSelect + 1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- em.find(Employee.class, employee.getId());
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
- assertEquals(numSelect + 2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void invalidAddress_removeEmp_find() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- Employee employee = new Queries().minEmployeeWithAddressAndPhones(em);
- Address address = employee.getAddress();
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
-
- session.getIdentityMapAccessor().invalidateObject(address);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertFalse(session.getIdentityMapAccessor().isValid(address));
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- session.getIdentityMapAccessor().removeFromIdentityMap(employee);
-
- em.clear();
- employee = em.find(Employee.class, employee.getId());
- assertEquals(numSelect + 1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- address = employee.getAddress();
- assertEquals(numSelect + 2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
- }
-
- @Test
- public void invalidAddress_jpql_all_resultList() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- Employee employee = new Queries().minEmployeeWithAddressAndPhones(em);
- Address address = employee.getAddress();
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
-
- session.getIdentityMapAccessor().invalidateObject(address);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertFalse(session.getIdentityMapAccessor().isValid(address));
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- em.createQuery("SELECT e FROM Employee e WHERE e.id = " + employee.getId()).getResultList();
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
- assertEquals(numSelect + 2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void invalidAddress_jpql_id_singeResult() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- Employee employee = new Queries().minEmployeeWithAddressAndPhones(em);
- Address address = employee.getAddress();
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
-
- session.getIdentityMapAccessor().invalidateObject(address);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertFalse(session.getIdentityMapAccessor().isValid(address));
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- em.createQuery("SELECT e FROM Employee e WHERE e.id = " + employee.getId()).getSingleResult();
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
- assertEquals(numSelect + 2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void invalidAddress_jpql_id_resultList() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- Employee employee = new Queries().minEmployeeWithAddressAndPhones(em);
- Address address = employee.getAddress();
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
-
- session.getIdentityMapAccessor().invalidateObject(address);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertFalse(session.getIdentityMapAccessor().isValid(address));
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- em.createQuery("SELECT e FROM Employee e WHERE e.id = " + employee.getId()).getResultList();
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
- assertEquals(numSelect + 2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void invalidAddress_refresh() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- Employee employee = new Queries().minEmployeeWithAddressAndPhones(em);
- Address address = employee.getAddress();
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
-
- session.getIdentityMapAccessor().invalidateObject(address);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertFalse(session.getIdentityMapAccessor().isValid(address));
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- em.refresh(employee);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
- assertEquals(numSelect + 2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void invalidAddress_refreshInTX() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- em.getTransaction().begin();
-
- Employee employee = new Queries().minEmployeeWithAddressAndPhones(em);
- Address address = employee.getAddress();
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
-
- session.getIdentityMapAccessor().invalidateObject(address);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertFalse(session.getIdentityMapAccessor().isValid(address));
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- em.refresh(employee);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
- assertEquals(numSelect + 2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- em.getTransaction().rollback();
- }
-
- @Test
- public void invalidPhone_find() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- Employee employee = new Queries().minEmployeeWithAddressAndPhones(em);
- PhoneNumber phone = employee.getPhoneNumbers().get(0);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(phone));
-
- session.getIdentityMapAccessor().invalidateObject(phone);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertFalse(session.getIdentityMapAccessor().isValid(phone));
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- em.find(Employee.class, employee.getId());
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(phone));
- assertEquals(numSelect + 1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void invalidPhone_refreshEmp_find() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- Employee employee = new Queries().minEmployeeWithAddressAndPhones(em);
- PhoneNumber phone = employee.getPhoneNumbers().get(0);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(phone));
-
- session.getIdentityMapAccessor().invalidateObject(phone);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertFalse(session.getIdentityMapAccessor().isValid(phone));
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- ReadObjectQuery query = new ReadObjectQuery(employee);
- query.refreshIdentityMapResult();
- query.setProperty(RefreshInvalidGraphListener.DO_NOT_VERIFY_PROPERTY, true);
- query.setIsExecutionClone(true);
- session.executeQuery(query);
- assertEquals(numSelect + 1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- em.find(Employee.class, employee.getId());
- assertEquals(numSelect + 2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(phone));
- }
-
- @Test
- public void invalidPhone_removeEmp_find() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- Employee employee = new Queries().minEmployeeWithAddressAndPhones(em);
- PhoneNumber phone = employee.getPhoneNumbers().get(0);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(phone));
-
- session.getIdentityMapAccessor().invalidateObject(phone);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertFalse(session.getIdentityMapAccessor().isValid(phone));
-
- int numSelect = getQuerySQLTracker(em).getTotalSQLSELECTCalls();
-
- session.getIdentityMapAccessor().removeFromIdentityMap(employee);
-
- em.clear();
- employee = em.find(Employee.class, employee.getId());
- assertEquals(numSelect + 1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- PhoneNumber refreshedPhone = employee.getPhoneNumbers().get(0);
- assertEquals(phone.getType(), refreshedPhone.getType());
- assertEquals(numSelect + 2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(phone));
- }
-
- @Test
- public void invalidManagerAddress() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- Employee employee = new Queries().minEmployeeWithAddressAndPhones(em);
- Employee manager = employee.getManager();
- Address address = manager.getAddress();
-
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(manager));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
-
- session.getIdentityMapAccessor().invalidateObject(address);
-
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(manager));
- assertFalse(session.getIdentityMapAccessor().isValid(address));
-
- session.getIdentityMapAccessor().removeFromIdentityMap(employee);
-
- em.clear();
- employee = em.find(Employee.class, employee.getId());
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- manager = employee.getManager();
- assertEquals(4, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- assertTrue(session.getIdentityMapAccessor().isValid(employee));
- assertTrue(session.getIdentityMapAccessor().isValid(manager));
- assertTrue(session.getIdentityMapAccessor().isValid(address));
- }
-
- @Test
- public void invalidAddresses_find() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- List<Employee> employees = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address").setMaxResults(2).getResultList();
- Employee emp1 = employees.get(0);
- Address address1 = emp1.getAddress();
- Employee emp2 = employees.get(1);
- Address address2 = emp2.getAddress();
-
- assertTrue(session.getIdentityMapAccessor().isValid(emp1));
- assertTrue(session.getIdentityMapAccessor().isValid(address1));
- assertTrue(session.getIdentityMapAccessor().isValid(emp2));
- assertTrue(session.getIdentityMapAccessor().isValid(address2));
-
- session.getIdentityMapAccessor().invalidateObject(address1);
- session.getIdentityMapAccessor().invalidateObject(address2);
-
- assertTrue(session.getIdentityMapAccessor().isValid(emp1));
- assertFalse(session.getIdentityMapAccessor().isValid(address1));
- assertTrue(session.getIdentityMapAccessor().isValid(emp2));
- assertFalse(session.getIdentityMapAccessor().isValid(address2));
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- em.find(Employee.class, emp1.getId());
-
- assertTrue(session.getIdentityMapAccessor().isValid(emp1));
- assertTrue(session.getIdentityMapAccessor().isValid(address1));
- assertTrue(session.getIdentityMapAccessor().isValid(emp2));
- assertFalse(session.getIdentityMapAccessor().isValid(address2));
- assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- em.find(Employee.class, emp2.getId());
-
- assertTrue(session.getIdentityMapAccessor().isValid(emp1));
- assertTrue(session.getIdentityMapAccessor().isValid(address1));
- assertTrue(session.getIdentityMapAccessor().isValid(emp2));
- assertTrue(session.getIdentityMapAccessor().isValid(address2));
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Test
- public void invalidAddresses_getResultList_IN() {
- EntityManager em = getEntityManager();
- Server session = JpaHelper.getEntityManager(em).getServerSession();
-
- List<Employee> employees = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address").setMaxResults(2).getResultList();
- Employee emp1 = employees.get(0);
- Address address1 = emp1.getAddress();
- Employee emp2 = employees.get(1);
- Address address2 = emp2.getAddress();
-
- assertTrue(session.getIdentityMapAccessor().isValid(emp1));
- assertTrue(session.getIdentityMapAccessor().isValid(address1));
- assertTrue(session.getIdentityMapAccessor().isValid(emp2));
- assertTrue(session.getIdentityMapAccessor().isValid(address2));
-
- session.getIdentityMapAccessor().invalidateObject(address1);
- session.getIdentityMapAccessor().invalidateObject(address2);
-
- assertTrue(session.getIdentityMapAccessor().isValid(emp1));
- assertFalse(session.getIdentityMapAccessor().isValid(address1));
- assertTrue(session.getIdentityMapAccessor().isValid(emp2));
- assertFalse(session.getIdentityMapAccessor().isValid(address2));
- assertEquals(1, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- em.createQuery("SELECT e FROM Employee e WHERE e.id IN(" + emp1.getId() + ", " + emp2.getId() + ")").getResultList();
-
- assertTrue(session.getIdentityMapAccessor().isValid(emp1));
- assertTrue(session.getIdentityMapAccessor().isValid(address1));
- assertTrue(session.getIdentityMapAccessor().isValid(emp2));
- assertTrue(session.getIdentityMapAccessor().isValid(address2));
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
-
- em.find(Employee.class, emp2.getId());
- em.find(Employee.class, emp2.getId());
-
- assertTrue(session.getIdentityMapAccessor().isValid(emp1));
- assertTrue(session.getIdentityMapAccessor().isValid(address1));
- assertTrue(session.getIdentityMapAccessor().isValid(emp2));
- assertTrue(session.getIdentityMapAccessor().isValid(address2));
- assertEquals(3, getQuerySQLTracker(em).getTotalSQLSELECTCalls());
- }
-
- @Override
- protected Map<?,?> getEMFProperties() {
- Map<String,String> properties = super.getEMFProperties();
- properties.put(PersistenceUnitProperties.SESSION_EVENT_LISTENER_CLASS, RefreshInvalidGraphListener.class.getName());
- // properties.put(PersistenceUnitProperties.LOGGING_LEVEL,
- // SessionLog.FINEST_LABEL);
- return properties;
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/JoiningtoUnmappedTables.java b/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/JoiningtoUnmappedTables.java
deleted file mode 100644
index 4b6bf4a..0000000
--- a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/JoiningtoUnmappedTables.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package testing;
-
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import model.Employee;
-import model.PhoneNumber;
-
-import org.eclipse.persistence.expressions.Expression;
-import org.eclipse.persistence.expressions.ExpressionBuilder;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.ReadAllQuery;
-import org.junit.Test;
-
-@PersistenceContext(unitName = "employee")
-public class JoiningtoUnmappedTables extends EclipseLinkJPATest {
-
- @Test
- public void test() throws Exception {
- EntityManager em = getEntityManager();
-
- ReadAllQuery raq = new ReadAllQuery(PhoneNumber.class);
- ExpressionBuilder eb = raq.getExpressionBuilder();
-
- ExpressionBuilder empEB = new ExpressionBuilder(Employee.class);
- Expression addrExp = empEB.getField("EMPLOYEE.GENDER").equal("M").and(empEB.getField("EMPLOYEE.EMP_ID").equal(eb.getParameter("PHONE.EMP_ID")));
-
- raq.setSelectionCriteria(addrExp);
-
- JpaHelper.createQuery(raq, em).getResultList();
-
- em.close();
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/RWUOWInBatchValueHolder.java b/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/RWUOWInBatchValueHolder.java
deleted file mode 100644
index 9a4267c..0000000
--- a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/RWUOWInBatchValueHolder.java
+++ /dev/null
@@ -1,178 +0,0 @@
-package testing;
-
-import static junit.framework.Assert.*;
-
-import java.util.List;
-
-import javax.persistence.*;
-
-import junit.framework.Assert;
-import model.*;
-
-import org.eclipse.persistence.config.QueryHints;
-import org.eclipse.persistence.indirection.IndirectContainer;
-import org.eclipse.persistence.indirection.ValueHolderInterface;
-import org.eclipse.persistence.internal.indirection.BatchValueHolder;
-import org.eclipse.persistence.internal.weaving.PersistenceWeaved;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.*;
-import org.eclipse.persistence.sessions.Session;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.Test;
-
-@PersistenceContext(unitName = "employee")
-public class RWUOWInBatchValueHolder extends EclipseLinkJPATest {
-
- @Test
- public void newEmpPersistRefreshBatch() throws Exception {
- Server session = JpaHelper.getServerSession(getEMF());
- session.getIdentityMapAccessor().initializeAllIdentityMaps();
-
- EntityManager em = getEntityManager();
-
- em.getTransaction().begin();
- JpaHelper.getEntityManager(em).getUnitOfWork().beginEarlyTransaction();
-
- Employee newEmp = new Employee();
- newEmp.setFirstName("test");
- newEmp.setLastName("test");
- newEmp.setGender(Gender.Male);
- Address newAddr = new Address();
- newEmp.setAddress(newAddr);
-
- em.persist(newEmp);
- em.flush();
-
- Query q = em.createQuery("SELECT e FROM Employee e WHERE e.id = " + newEmp.getId());
- q.setHint(QueryHints.REFRESH, "true");
- q.setHint(QueryHints.BATCH, "e.address");
- q.setHint(QueryHints.BATCH, "e.phoneNumbers");
- q.getResultList();
-
- em.getTransaction().commit();
- em.clear();
-
- verify(em, session, "newEmpPersistRefreshBatch");
- }
-
- @Test
- public void queryOutsideTX() throws Exception {
- Server session = JpaHelper.getServerSession(getEMF());
- session.getIdentityMapAccessor().initializeAllIdentityMaps();
-
- EntityManager em = getEntityManager();
-
- verify(em, session, "queryOutsideTX");
- }
-
- @Test
- public void queryInsideTX() throws Exception {
- Server session = JpaHelper.getServerSession(getEMF());
- session.getIdentityMapAccessor().initializeAllIdentityMaps();
-
- EntityManager em = getEntityManager();
-
- em.getTransaction().begin();
- verify(em, session, "queryInsideTX");
- em.getTransaction().rollback();
- }
-
- @Test
- public void queryInsideDBTX() throws Exception {
- Server session = JpaHelper.getServerSession(getEMF());
- session.getIdentityMapAccessor().initializeAllIdentityMaps();
-
- EntityManager em = getEntityManager();
-
- em.getTransaction().begin();
- JpaHelper.getEntityManager(em).getUnitOfWork().beginEarlyTransaction();
- Query query = em.createQuery("SELECT e FROM Employee e ORDER BY e.id");
- query.setHint(QueryHints.BATCH, "e.address");
- query.setHint(QueryHints.BATCH, "e.phoneNumbers");
- query.getResultList();
- em.getTransaction().commit();
-
- verify(em, session, "queryInsideDBTX");
- }
-
- @SuppressWarnings("unchecked")
- private void verify(EntityManager em, Server session, String testCaseName) {
- // Verify Configuration
- assertWoven("Employee");
- assertLazy("Employee", "address");
- assertLazy("Employee", "phoneNumbers");
-
- // em.getTransaction().begin();
-
- Query query = em.createQuery("SELECT e FROM Employee e ORDER BY e.id");
- query.setHint(QueryHints.BATCH, "e.address");
- query.setHint(QueryHints.BATCH, "e.phoneNumbers");
-
- List<Employee> emps = query.getResultList();
-
- assertNotNull(emps);
- assertTrue(emps.size() > 0);
-
- OneToOneMapping addressMapping = getMapping("Employee", "address", OneToOneMapping.class);
- OneToManyMapping phonesMapping = getMapping("Employee", "phoneNumbers", OneToManyMapping.class);
-
- for (Employee emp : emps) {
- Employee sharedEmp = (Employee) session.getIdentityMapAccessor().getFromIdentityMap(emp);
- assertNotNull("Shared instance not found in cache: " + emp, sharedEmp);
- assertNotSame(emp, sharedEmp);
-
- System.out.println(testCaseName + "::verifying: Employee(" + sharedEmp.getId() + ") @ " + System.identityHashCode(sharedEmp));
-
- ValueHolderInterface addressHolder = (ValueHolderInterface) addressMapping.getAttributeValueFromObject(sharedEmp);
- assertNotNull("No address holder found Employee id:" + sharedEmp.getId(), addressHolder);
- assertTrue("address holder not batch: " + addressHolder, addressHolder instanceof BatchValueHolder);
- BatchValueHolder addressBVH = (BatchValueHolder) addressHolder;
- assertFalse(addressBVH.isInstantiated());
- assertSame(session, addressBVH.getSession());
- Session querySession = addressBVH.getQuery().getSession();
- if (querySession != null) {
- assertSame(session, querySession);
- assertFalse(querySession.isUnitOfWork());
- } else {
- System.out.println("Employee(" + sharedEmp.getId() + ") has null session in address.BVH.query");
- }
- addressBVH.getValue();
- assertTrue(addressBVH.isInstantiated());
- assertNull(addressBVH.getSession());
- assertNull(addressBVH.getQuery());
-
- IndirectContainer phonesContainer = (IndirectContainer) phonesMapping.getAttributeValueFromObject(sharedEmp);
- ValueHolderInterface phonesHolder = phonesContainer.getValueHolder();
- assertNotNull("No phones holder found Employee id:" + sharedEmp.getId(), phonesHolder);
- assertTrue("phones holder not batch: " + phonesHolder, phonesHolder instanceof BatchValueHolder);
- BatchValueHolder phonesBVH = (BatchValueHolder) phonesHolder;
- assertFalse(phonesBVH.isInstantiated());
- assertSame(session, phonesBVH.getSession());
- querySession = phonesBVH.getQuery().getSession();
- if (querySession != null) {
- assertSame(session, querySession);
- assertFalse(querySession.isUnitOfWork());
- } else {
- System.out.println("Employee(" + sharedEmp.getId() + ") has null session in phoneNumbers.BVH.query");
- }
- phonesBVH.getValue();
- assertTrue(phonesBVH.isInstantiated());
- assertNull(phonesBVH.getSession());
- assertNull(phonesBVH.getQuery());
- }
- }
-
- @SuppressWarnings("unchecked")
- private <T> T getMapping(String entityAlias, String attribute, Class<T> class1) {
- return (T) JpaHelper.getServerSession(getEMF()).getDescriptorForAlias(entityAlias).getMappingForAttributeName(attribute);
- }
-
- private void assertLazy(String entityAlias, String attribute) {
- Assert.assertTrue(getMapping(entityAlias, attribute, DatabaseMapping.class).isLazy());
- }
-
- private void assertWoven(String entityAlias) {
- Assert.assertTrue(PersistenceWeaved.class.isAssignableFrom(JpaHelper.getServerSession(getEMF()).getDescriptorForAlias(entityAlias).getJavaClass()));
- }
-
-}
diff --git a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/example/util/AllTests.java b/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/example/util/AllTests.java
deleted file mode 100644
index 386332c..0000000
--- a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/example/util/AllTests.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dclarke - initial JPA Employee example using XML (bug 217884)
- ******************************************************************************/
-package testing.example.util;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { MappingCollectorTests.class, EntityCollectorTests.class })
-public class AllTests {
-}
diff --git a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/example/util/EntityCollectorTests.java b/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/example/util/EntityCollectorTests.java
deleted file mode 100644
index cf049cc..0000000
--- a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/example/util/EntityCollectorTests.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package testing.example.util;
-
-import javax.persistence.PersistenceContext;
-
-import org.junit.Test;
-
-import testing.EclipseLinkJPATest;
-
-@PersistenceContext(unitName = "employee")
-public class EntityCollectorTests extends EclipseLinkJPATest {
-
- @Test
- public void empty() {
-
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/example/util/MappingCollectorTests.java b/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/example/util/MappingCollectorTests.java
deleted file mode 100644
index b017c54..0000000
--- a/extensions/trunk/org.eclipse.persistence.extension.invalidgraph/test-src/testing/example/util/MappingCollectorTests.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package testing.example.util;
-
-import static junit.framework.Assert.*;
-
-import java.util.Iterator;
-
-import javax.persistence.PersistenceContext;
-
-import org.eclipse.persistence.descriptors.ClassDescriptor;
-import org.eclipse.persistence.extension.MappingCollector;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.mappings.DatabaseMapping;
-import org.eclipse.persistence.sessions.server.Server;
-import org.junit.Test;
-
-import testing.EclipseLinkJPATest;
-
-@PersistenceContext(unitName = "employee")
-public class MappingCollectorTests extends EclipseLinkJPATest {
-
- @Test
- public void empty() throws Exception {
- MappingCollector.Criteria criteria = new MappingCollector.Criteria() {
- public boolean collect(DatabaseMapping mapping) {
- return false;
- }
-
- public boolean collect(ClassDescriptor descriptor) {
- return false;
- }
- };
-
- MappingCollector collector = new MappingCollector(JpaHelper.getServerSession(getEMF()), criteria);
-
- assertSame(criteria, collector.getCriteria());
- assertNotNull(collector);
- assertTrue(collector.getMappings().isEmpty());
- }
-
- @Test
- public void allClassesNoMappings() throws Exception {
- MappingCollector.Criteria criteria = new MappingCollector.Criteria() {
- public boolean collect(DatabaseMapping mapping) {
- return false;
- }
-
- public boolean collect(ClassDescriptor descriptor) {
- return true;
- }
- };
-
- Server session = JpaHelper.getServerSession(getEMF());
- MappingCollector collector = new MappingCollector(session, criteria);
-
- assertSame(criteria, collector.getCriteria());
- assertNotNull(collector);
- assertEquals(session.getDescriptors().size(), collector.getMappings().size());
-
- for (Iterator<?> i = session.getDescriptors().values().iterator(); i.hasNext();) {
- ClassDescriptor descriptor = (ClassDescriptor) i.next();
-
- assertTrue(collector.getMappings(session, descriptor.getJavaClass()).isEmpty());
- }
- }
-
- @Test
- public void allClassesAllMappings() throws Exception {
- MappingCollector.Criteria criteria = new MappingCollector.Criteria() {
- public boolean collect(DatabaseMapping mapping) {
- return true;
- }
-
- public boolean collect(ClassDescriptor descriptor) {
- return true;
- }
- };
-
- Server session = JpaHelper.getServerSession(getEMF());
- MappingCollector collector = new MappingCollector(session, criteria);
-
- assertSame(criteria, collector.getCriteria());
- assertNotNull(collector);
- assertEquals(session.getDescriptors().size(), collector.getMappings().size());
-
- for (Iterator<?> i = session.getDescriptors().values().iterator(); i.hasNext();) {
- ClassDescriptor descriptor = (ClassDescriptor) i.next();
-
- assertFalse(collector.getMappings(session, descriptor.getJavaClass()).isEmpty());
- }
- }
-}
diff --git a/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/.classpath b/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/.classpath
deleted file mode 100644
index c14b71c..0000000
--- a/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.core"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/.project b/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/.project
deleted file mode 100644
index 3d0ced3..0000000
--- a/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.persistence.platform.database.db2as400</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/build.properties b/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/build.properties
deleted file mode 100644
index a5d14b4..0000000
--- a/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-#*******************************************************************************
-# Copyright (c) 1998, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
-# which accompanies this distribution.
-# The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
-# and the Eclipse Distribution License is available at
-# http://www.eclipse.org/org/documents/edl-v10.php.
-#
-# Contributors:
-# tware - DB2 AS400 EXTENSION INCUBATOR - Enhancement bug 248205
-#
-# This code is being developed under INCUBATION and is not currently included
-# in the automated EclipseLink build. The API in this code may change, or
-# may never be included in the product. Please provide feedback through mailing
-# lists or the bug database.
-#***************************************************************************** -->
-trunk.dir=../../../../trunk
-source.. = src/
diff --git a/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/build.xml b/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/build.xml
deleted file mode 100644
index 278a0ec..0000000
--- a/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/build.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0"?>
-<!-- *******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * tware - DB2 AS400 EXTENSION INCUBATOR - Enhancement bug 248205
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ****************************************************************************** -->
-<project name="extension.platform.db2as400" default="build" basedir=".">
-
- <property file="./build.properties"/>
- <property file="${trunk.dir}/build.properties"/>
-
- <!-- Set Compile Path-->
- <path id="compile.path">
- <pathelement path="${trunk.dir}/${eclipselink.jar.name}"/>
- </path>
-
- <target name="build" depends="clean,compile" />
-
- <!-- clean -->
- <target name="clean" description="Clean all generated content">
- <delete includeEmptyDirs="true" failonerror="false">
- <fileset dir="${classes.dir}"/>
- </delete>
- </target>
-
- <!-- compile -->
- <target name="compile" description="Compile DB2UDBiSeriesPlatform.java">
- <mkdir dir="${classes.dir}"/>
- <javac srcdir="${src.dir}"
- destdir="${classes.dir}"
- includes="**/*.java"
- debug="${javac.debug}"
- optimize="${javac.optimize}"
- source="${javac.version}"
- target="${javac.version}"
- deprecation="${javac.deprecation}"
- failonerror="true"
- memoryMaximumSize="512m"
- fork="true"
- classpathref="compile.path"
- />
- </target>
-
-</project>
diff --git a/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/readme.txt b/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/readme.txt
deleted file mode 100644
index 6816a61..0000000
--- a/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/readme.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-See the following page for details of this incubator project:
-
-http://wiki.eclipse.org/EclipseLink/Development/Incubator/Extensions/DB2AS400Platform
-
-See the following page for details of the extensions incubator:
-
-http://wiki.eclipse.org/EclipseLink/Development/Incubator/Extensions
\ No newline at end of file
diff --git a/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/src/org/eclipse/persistence/extensions/platform/database/DB2UDBiSeriesPlatform.java b/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/src/org/eclipse/persistence/extensions/platform/database/DB2UDBiSeriesPlatform.java
deleted file mode 100644
index 8a931b2..0000000
--- a/extensions/trunk/org.eclipse.persistence.platform.database.db2as400/src/org/eclipse/persistence/extensions/platform/database/DB2UDBiSeriesPlatform.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2009 Oracle., Bill Blalock All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Bill Blalock
- *
- * Patterned after:
- * org.eclipse.persistence.platform.database.DB2MainframePlatform
- ******************************************************************************/
-package org.eclipse.persistence.extensions.platform.database;
-
-import java.util.Vector;
-
-import org.eclipse.persistence.internal.sessions.AbstractSession;
-import org.eclipse.persistence.platform.database.DB2Platform;
-import org.eclipse.persistence.queries.ValueReadQuery;
-
-/**
- * <B>Purpose</B>: Provides specific behavior for DB2 Universal Database for iSeries.<P>
- * IBM iSeries has SYSIBM schema for compatibility with DB2. However the primary schema
- * for SQL system tables is QSYS2. All tables, table structures and behavior of QSYS2
- * tables are not duplicated in SYSIBM schema.<P>
- * <B>Responsibilities</B>:
- * <UL>
- * <LI>Override getNativeTableInfo() using QSYS2 schema and different column name.</LI>
- * <UL>
- * <LI>SYSTABLES in QSYS2 schema, not in SYSIBM schema</LI>
- * <LI>SYSTABLE = 'N' replaces TBCREATOR NOT IN ('SYS', 'SYSTEM')</LI>
- * <LI>CREATOR replaces TBCREATOR (not defined in QSYS2/SYSTABLES catalog.</LI>
- * </UL>
- * <LI>Override getTimestampQuery() using QSYS2 schema instead of SYSIBM.
- * </UL>
- *
- * @since Eclipselink 1.0
- * @author Bill Blalock
- */
-@SuppressWarnings("serial")
-public class DB2UDBiSeriesPlatform extends DB2Platform {
-
- public DB2UDBiSeriesPlatform() {
- super();
- }
- /**
- * Return the catalog information through using the native SQL catalog selects
- * of DB2 Universal Database for iSeries.
- * This is required because many JDBC driver do not support meta-data.
- * Wildcards can be passed as arguments.
- * @param table
- * @param creator
- * @param session
- * @return Catalog information returned from iSeries.
- * @overide
- */
- @SuppressWarnings("unchecked")
- public Vector getNativeTableInfo(String table, String creator, AbstractSession session) {
- String query = "SELECT * FROM QSYS2.SYSTABLES WHERE SYSTABLE = 'N'";
- if (table != null) {
- if (table.indexOf('%') != -1) {
- query = query + " AND TBNAME LIKE " + table;
- } else {
- query = query + " AND TBNAME = " + table;
- }
- }
- if (creator != null) {
- if (creator.indexOf('%') != -1) {
- query = query + " AND CREATOR LIKE " + creator;
- } else {
- query = query + " AND CREATOR = " + creator;
- }
- }
- return session.executeSelectingCall(new org.eclipse.persistence.queries.SQLCall(query));
- }
-
- /**
- * This method returns the query to select the timestamp
- * from the DB2 Universal Database for iSeries server.
- * @return ValueReadQuery to retrieve current timestamp from iSeries.
- * @override
- */
- public ValueReadQuery getTimestampQuery() {
- if (timestampQuery == null) {
- timestampQuery = new ValueReadQuery();
- timestampQuery.setSQLString("SELECT DISTINCT CURRENT TIMESTAMP FROM QSYS2.SYSTABLES");
- }
- return timestampQuery;
- }
-
-
-
-}
\ No newline at end of file
diff --git a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/.classpath b/extensions/trunk/org.eclipse.persistence.platform.database.ingres/.classpath
deleted file mode 100644
index c14b71c..0000000
--- a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.core"/>
- <classpathentry kind="output" path="classes"/>
-</classpath>
diff --git a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/.project b/extensions/trunk/org.eclipse.persistence.platform.database.ingres/.project
deleted file mode 100644
index cc28b0f..0000000
--- a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.persistence.platform.database.ingres</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/build.properties b/extensions/trunk/org.eclipse.persistence.platform.database.ingres/build.properties
deleted file mode 100644
index 5c9f440..0000000
--- a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-#*******************************************************************************
-# Copyright (c) 1998, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
-# which accompanies this distribution.
-# The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
-# and the Eclipse Distribution License is available at
-# http://www.eclipse.org/org/documents/edl-v10.php.
-#
-# Contributors:
-# tware - INGRES EXTENSION INCUBATOR - Enhancement bug 253682
-#
-# This code is being developed under INCUBATION and is not currently included
-# in the automated EclipseLink build. The API in this code may change, or
-# may never be included in the product. Please provide feedback through mailing
-# lists or the bug database.
-#***************************************************************************** -->
-trunk.dir=../../../../trunk
-source.. = src/
diff --git a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/build.xml b/extensions/trunk/org.eclipse.persistence.platform.database.ingres/build.xml
deleted file mode 100644
index bb68127..0000000
--- a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/build.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0"?>
-<!-- *******************************************************************************
- * Copyright (c) 1998, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * tware - INGRES EXTENSION INCUBATOR - Enhancement bug 253682
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ****************************************************************************** -->
-<project name="extension.platform.ingres" default="build" basedir=".">
-
- <property file="./build.properties"/>
- <property file="${trunk.dir}/build.properties"/>
-
- <!-- Set Compile Path-->
- <path id="compile.path">
- <pathelement path="${trunk.dir}/${eclipselink.jar.name}"/>
- </path>
-
- <target name="build" depends="clean,compile" />
-
- <!-- clean -->
- <target name="clean" description="Clean all generated content">
- <delete includeEmptyDirs="true" failonerror="false">
- <fileset dir="${classes.dir}"/>
- </delete>
- </target>
-
- <!-- compile -->
- <target name="compile" description="Compile IngresPlatform">
- <mkdir dir="${classes.dir}"/>
- <javac srcdir="${src.dir}"
- destdir="${classes.dir}"
- includes="**/*.java"
- debug="${javac.debug}"
- optimize="${javac.optimize}"
- source="${javac.version}"
- target="${javac.version}"
- deprecation="${javac.deprecation}"
- failonerror="true"
- memoryMaximumSize="512m"
- fork="true"
- classpathref="compile.path"
- />
- </target>
-
-</project>
diff --git a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/readme.txt b/extensions/trunk/org.eclipse.persistence.platform.database.ingres/readme.txt
deleted file mode 100644
index 99bda1b..0000000
--- a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/readme.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-See the following page for details of this incubator project:
-
-http://wiki.eclipse.org/EclipseLink/Development/Incubator/Extensions/IngresPlatform
-
-See the following page for details of the extensions incubator:
-
-http://wiki.eclipse.org/EclipseLink/Development/Incubator/Extensions
\ No newline at end of file
diff --git a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/src/org/eclipse/persistence/extensions/platform/database/IngresPlatform.java b/extensions/trunk/org.eclipse.persistence.platform.database.ingres/src/org/eclipse/persistence/extensions/platform/database/IngresPlatform.java
deleted file mode 100644
index a657c87..0000000
--- a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/src/org/eclipse/persistence/extensions/platform/database/IngresPlatform.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Ingres Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Ingres Corporation (rajus01@ingres.com) - Initial API version
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.extensions.platform.database;
-
-import java.io.*;
-import java.util.*;
-import org.eclipse.persistence.exceptions.ValidationException;
-import org.eclipse.persistence.expressions.ExpressionOperator;
-import org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition;
-import org.eclipse.persistence.internal.expressions.RelationExpression;
-import org.eclipse.persistence.internal.helper.*;
-import org.eclipse.persistence.queries.ValueReadQuery;
-import org.eclipse.persistence.tools.schemaframework.FieldDefinition;
-import org.eclipse.persistence.platform.database.DatabasePlatform;
-
-/**
- * <p><b>Purpose</b>: Provides Ingres specific behavior.
- * <p><b>Responsibilities</b>:<ul>
- * <li> Native SQL for Date, Time, & Timestamp.
- * <li> Native sequencing.
- * <li> Mapping of class types to database types for the schema framework.
- * <li> Pessimistic locking.
- * <li> Platform specific operators.
- * </ul>
- *
- */
-public class IngresPlatform extends DatabasePlatform {
-
- public IngresPlatform() {
- super();
- this.pingSQL = "SELECT 1";
- }
-
- /**
- * Appends a Boolean value.
- * In Ingres the following are the values that
- * are value for a boolean field
- * Valid literal values for the "true" state are:
- * TRUE, 't', 'true', 'y', 'yes', '1'
- * Valid literal values for the false" state are :
- * FALSE, 'f', 'false', 'n', 'no', '0'
- *
- * To be consistent with the other data platforms we are using the values
- * '1' and '0' for true and false states of a boolean field.
- */
- protected void appendBoolean(Boolean bool, Writer writer) throws IOException {
- if (bool.booleanValue()) {
- writer.write("\'1\'");
- } else {
- writer.write("\'0\'");
- }
- }
-
- /**
- * INTERNAL:
- * Initialize any platform-specific operators
- */
- protected void initializePlatformOperators() {
- super.initializePlatformOperators();
- addOperator(ExpressionOperator.simpleLogicalNoParens(ExpressionOperator.Concat, "||"));
- addOperator(ExpressionOperator.simpleTwoArgumentFunction(ExpressionOperator.Nvl, "IFNULL"));
- addOperator(operatorLocate());
- }
-
-
- /**
- * INTERNAL:
- * This method returns the query to select the timestamp from the server
- * for Ingres.
- */
- public ValueReadQuery getTimestampQuery() {
- if (timestampQuery == null) {
- timestampQuery = new ValueReadQuery();
- timestampQuery.setSQLString("select date('now')");
- }
- return timestampQuery;
-
- }
-
-
- /**
- * This method is used to print the output parameter token when stored
- * procedures are called
- */
- public String getInOutputProcedureToken() {
- return "OUT";
- }
-
- /**
- * This is required in the construction of the stored procedures with
- * output parameters
- */
- public boolean shouldPrintOutputTokenAtStart() {
- return false;
- }
-
- /**
- * INTERNAL:
- * Answers whether platform is Ingres
- */
- public boolean isIngres() {
- return true;
- }
-
- /**
- * INTERNAL:
- */
- protected String getCreateTempTableSqlSuffix() {
- return " ON COMMIT PRESERVE ROWS";
- }
-
- /**
- * INTERNAL:
- * Indicates whether the platform supports identity.
- * This method is to be used *ONLY* by sequencing classes
- */
- public boolean supportsIdentity() {
- return false;
- }
-
- /**
- * INTERNAL:
- * Returns query used to read back the value generated by Identity.
- * This method is called when identity NativeSequence is connected,
- * the returned query used until the sequence is disconnected.
- * If the platform supportsIdentity then (at least) one of buildSelectQueryForIdentity
- * methods should return non-null query.
- */
- public ValueReadQuery buildSelectQueryForIdentity() {
- ValueReadQuery selectQuery = new ValueReadQuery();
- selectQuery.setSQLString("");
- return selectQuery;
- }
-
- /**
- * INTERNAL:
- * Indicates whether the platform supports sequence objects.
- * This method is to be used *ONLY* by sequencing classes
- */
- public boolean supportsSequenceObjects() {
- return true;
- }
-
- /**
- * INTERNAL:
- * Returns query used to read value generated by sequence object (like Oracle sequence).
- * This method is called when sequence object NativeSequence is connected,
- * the returned query used until the sequence is disconnected.
- * If the platform supportsSequenceObjects then (at least) one of buildSelectQueryForSequenceObject
- * methods should return non-null query.
- */
- public ValueReadQuery buildSelectQueryForSequenceObject(String seqName, Integer size) {
- return new ValueReadQuery("select " + getQualifiedName(seqName) + ".nextval");
- }
-
- /**
- * INTERNAL:
- */
- protected String getCreateTempTableSqlBodyForTable(DatabaseTable table) {
- // returning null includes fields of the table in body
- // see javadoc of DatabasePlatform#getCreateTempTableSqlBodyForTable(DataBaseTable)
- // for details
- return null;
- }
-
- /**
- * INTERNAL:
- * Append the receiver's field 'identity' constraint clause to a writer
- */
- public void printFieldIdentityClause(Writer writer) throws ValidationException {
- try {
- writer.write(" SERIAL");
- } catch (IOException ioException) {
- throw ValidationException.fileError(ioException);
- }
- }
-
- protected Hashtable buildFieldTypes() {
- Hashtable fieldTypeMapping = new Hashtable();
-
- fieldTypeMapping.put(Boolean.class, new FieldTypeDefinition("INTEGER1", false));
-
- fieldTypeMapping.put(Integer.class, new FieldTypeDefinition("INTEGER", false));
- fieldTypeMapping.put(Long.class, new FieldTypeDefinition("BIGINT", false));
- fieldTypeMapping.put(Float.class, new FieldTypeDefinition("FLOAT"));
- fieldTypeMapping.put(Double.class, new FieldTypeDefinition("DECIMAL", 15));
- fieldTypeMapping.put(Short.class, new FieldTypeDefinition("SMALLINT", false));
- fieldTypeMapping.put(Byte.class, new FieldTypeDefinition("SMALLINT", false));
- fieldTypeMapping.put(java.math.BigInteger.class, new FieldTypeDefinition("BIGINT", false));
- fieldTypeMapping.put(java.math.BigDecimal.class, new FieldTypeDefinition("DECIMAL",19));
- fieldTypeMapping.put(Number.class, new FieldTypeDefinition("INTEGER", false));
-
- fieldTypeMapping.put(String.class, new FieldTypeDefinition("VARCHAR", 255));
- fieldTypeMapping.put(Character.class, new FieldTypeDefinition("CHAR", 1));
-
- fieldTypeMapping.put(Byte[].class, new FieldTypeDefinition("LONG BYTE", false));
- fieldTypeMapping.put(Character[].class, new FieldTypeDefinition("LONG VARCHAR"));
- fieldTypeMapping.put(byte[].class, new FieldTypeDefinition("LONG BYTE", false));
- fieldTypeMapping.put(char[].class, new FieldTypeDefinition("LONG VARCHAR"));
- fieldTypeMapping.put(java.sql.Blob.class, new FieldTypeDefinition("LONG BYTE"));
- fieldTypeMapping.put(java.sql.Clob.class, new FieldTypeDefinition("LONG VARCHAR"));
-
- fieldTypeMapping.put(java.sql.Date.class, new FieldTypeDefinition("DATE", false));
- fieldTypeMapping.put(java.sql.Time.class, new FieldTypeDefinition("TIME", false));
- fieldTypeMapping.put(java.sql.Timestamp.class, new FieldTypeDefinition("TIMESTAMP", false));
-
- return fieldTypeMapping;
- }
-
- /**
- * INTERNAL:
- * Override the default locate operator
- */
- protected ExpressionOperator operatorLocate() {
- ExpressionOperator result = new ExpressionOperator();
- result.setSelector(ExpressionOperator.Locate);
- Vector v = new Vector(3);
- v.addElement("STRPOS(");
- v.addElement(", ");
- v.addElement(")");
- result.printsAs(v);
- result.bePrefix();
- result.setNodeClass(RelationExpression.class);
- return result;
- }
-
-
- /**
- * INTERNAL:
- */
- public boolean supportsGlobalTempTables() {
- return true;
- }
-
- /**
- * INTERNAL:
- */
- protected String getCreateTempTableSqlPrefix() {
- return "CREATE GLOBAL TEMPORARY TABLE ";
- }
-
- /**
- * INTERNAL:
- * returns the maximum number of characters that can be used in a field
- * name on this platform.
- */
- public int getMaxFieldNameSize() {
- return 32;
- }
-
- public void printFieldTypeSize(Writer writer, FieldDefinition field,
- FieldTypeDefinition fieldType, boolean shouldPrintFieldIdentityClause) throws IOException {
- if(!shouldPrintFieldIdentityClause) {
- super.printFieldTypeSize(writer, field, fieldType);
- }
- }
-
- public void printFieldUnique(Writer writer, boolean shouldPrintFieldIdentityClause) throws IOException {
- if(!shouldPrintFieldIdentityClause) {
- super.printFieldUnique(writer);
- }
- }
-
- /**
- * JDBC defines and outer join syntax, many drivers do not support this. So we normally avoid it.
- */
- public boolean shouldUseJDBCOuterJoinSyntax() {
- return false;
- }
-
- /**
- * INTERNAL:
- * Override this method if the platform supports sequence objects.
- * Returns sql used to create sequence object in the database.
- */
- public Writer buildSequenceObjectCreationWriter(Writer writer, String fullSeqName, int increment, int start) throws IOException {
- writer.write("CREATE SEQUENCE ");
- writer.write(fullSeqName);
- if (increment != 1) {
- writer.write(" INCREMENT BY " + increment);
- }
- writer.write(" START WITH " + start);
- return writer;
- }
-
- /**
- * INTERNAL:
- * Override this method if the platform supports sequence objects.
- * Returns sql used to delete sequence object from the database.
- */
- public Writer buildSequenceObjectDeletionWriter(Writer writer, String fullSeqName) throws IOException {
- writer.write("DROP SEQUENCE ");
- writer.write(fullSeqName);
- return writer;
- }
-
- /**
- * INTERNAL:
- * Override this method if the platform supports sequence objects
- * and isAlterSequenceObjectSupported returns true.
- * Returns sql used to alter sequence object's increment in the database.
- */
- public Writer buildSequenceObjectAlterIncrementWriter(Writer writer, String fullSeqName, int increment) throws IOException {
- writer.write("ALTER SEQUENCE ");
- writer.write(fullSeqName);
- writer.write(" INCREMENT BY " + increment);
- return writer;
- }
-
- /**
- * INTERNAL:
- * Override this method if the platform supports sequence objects
- * and it's possible to alter sequence object's increment in the database.
- */
- public boolean isAlterSequenceObjectSupported() {
- return true;
- }
-
- public String getPostConstraintDeletionString() {
- return " CASCADE ";
- }
-
- /**
- * INTERNAL:
- * Used for pessimistic locking.
- */
- public String getSelectForUpdateString() {
- return " FOR UPDATE";
- }
-
- /**
- * INTERNAL:
- * This syntax does no wait on the lock.
- */
- public String getSelectForUpdateNoWaitString() {
- return " FOR UPDATE";
- }
-
- /**
- * This syntax does no wait on the lock.
- * (i.e. In Oracle adding NOWAIT to the end will accomplish this)
- */
- public String getNoWaitString() {
- return "";
- }
-
-
-}
-
diff --git a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/src/readme.txt b/extensions/trunk/org.eclipse.persistence.platform.database.ingres/src/readme.txt
deleted file mode 100644
index 72c6643..0000000
--- a/extensions/trunk/org.eclipse.persistence.platform.database.ingres/src/readme.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-This jar contains a contributed version of IngresPlatform from the following bug:
-
-https://bugs.eclipse.org/bugs/show_bug.cgi?id=253682
-
-When filing bugs against this platform, please reference the bug above.
-
-It is being made available for community use and testing and has been compiled against an EclipseLink 1.1 interim build.
-
-To make use of IngresPlatform, put this jar in your classpath and indicate to EclipseLink to use this platform. (e.g. Set the eclipselink.target-database persistence unit property to org.eclipse.persistence.platform.database.IngresPlatform)
-
-Below is the licensing information:
-
-/*******************************************************************************
- * Copyright (c) 2008 Ingres Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Ingres Corporation (rajus01@ingres.com) - Initial API version
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
-
- ******************************************************************************/
\ No newline at end of file
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/.classpath b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/.classpath
deleted file mode 100644
index 7aacb50..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry exported="true" kind="lib" path="lib/org.eclipse.persistence.core_2.0.1.v20100213-r6600.jar" sourcepath="lib/org.eclipse.persistence.core.source_2.0.1.v20100213-r6600.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry excluding="**/.svn/**" kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/.project b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/.project
deleted file mode 100644
index 0083d7e..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.persistence.incubator.geminijpa.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/.settings/org.eclipse.jdt.core.prefs b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d3a12f1..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Tue Mar 02 11:58:23 EST 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/.settings/org.eclipse.pde.core.prefs b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644
index cdbee29..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/.settings/org.eclipse.pde.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Tue Mar 02 11:58:23 EST 2010
-eclipse.preferences.version=1
-pluginProject.extensions=false
-resolve.requirebundle=false
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/META-INF/MANIFEST.MF b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 680369e..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,189 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: EclipseLink Core
-Bundle-SymbolicName: org.eclipse.persistence.incubator.geminijpa.core
-Bundle-Version: 2.0.2
-Bundle-ActivationPolicy: lazy
-Import-Package: javax.activation;resolution:=optional,
- javax.crypto;resolution:=optional,
- javax.crypto.spec;resolution:=optional,
- javax.imageio;resolution:=optional,
- javax.imageio.stream;resolution:=optional,
- javax.jms;resolution:=optional,
- javax.mail;resolution:=optional,
- javax.mail.internet;resolution:=optional,
- javax.management;resolution:=optional,
- javax.management.openmbean;resolution:=optional,
- javax.naming;resolution:=optional,
- javax.persistence;version="1.1.0",
- javax.persistence.spi;version="1.1.0",
- javax.rmi;resolution:=optional,
- javax.rmi.CORBA;resolution:=optional,
- javax.sql,
- javax.transaction;resolution:=optional,
- javax.xml.datatype;resolution:=optional,
- javax.xml.namespace;resolution:=optional,
- javax.xml.parsers;resolution:=optional,
- javax.xml.stream;resolution:=optional,
- javax.xml.stream.events;resolution:=optional,
- javax.xml.transform;resolution:=optional,
- javax.xml.transform.dom;resolution:=optional,
- javax.xml.transform.sax;resolution:=optional,
- javax.xml.transform.stream;resolution:=optional,
- javax.xml.validation;resolution:=optional,
- javax.xml.xpath;resolution:=optional,
- org.omg.CORBA;resolution:=optional,
- org.omg.CORBA.portable;resolution:=optional,
- org.omg.CORBA_2_3.portable;resolution:=optional,
- org.osgi.framework;version="1.3.0",
- org.w3c.dom;resolution:=optional,
- org.xml.sax;resolution:=optional,
- org.xml.sax.ext;resolution:=optional,
- org.xml.sax.helpers;resolution:=optional
-Bundle-Vendor: EclipseLink Project
-Bundle-ClassPath: .,
- lib/org.eclipse.persistence.core_2.0.1.v20100213-r6600.jar
-Export-Package: org.eclipse.persistence.annotations,
- org.eclipse.persistence.config,
- org.eclipse.persistence.descriptors,
- org.eclipse.persistence.descriptors.changetracking,
- org.eclipse.persistence.descriptors.copying,
- org.eclipse.persistence.descriptors.invalidation,
- org.eclipse.persistence.dynamic,
- org.eclipse.persistence.eis,
- org.eclipse.persistence.eis.adapters.jms,
- org.eclipse.persistence.eis.adapters.xmlfile,
- org.eclipse.persistence.eis.interactions,
- org.eclipse.persistence.eis.mappings,
- org.eclipse.persistence.exceptions,
- org.eclipse.persistence.exceptions.i18n,
- org.eclipse.persistence.expressions,
- org.eclipse.persistence.expressions.spatial,
- org.eclipse.persistence.history,
- org.eclipse.persistence.indirection,
- org.eclipse.persistence.internal.codegen,
- org.eclipse.persistence.internal.databaseaccess,
- org.eclipse.persistence.internal.descriptors,
- org.eclipse.persistence.internal.descriptors.changetracking,
- org.eclipse.persistence.internal.dynamic,
- org.eclipse.persistence.internal.eis.adapters.jms,
- org.eclipse.persistence.internal.eis.adapters.xmlfile,
- org.eclipse.persistence.internal.eis.cobol,
- org.eclipse.persistence.internal.eis.cobol.helper,
- org.eclipse.persistence.internal.expressions,
- org.eclipse.persistence.internal.helper,
- org.eclipse.persistence.internal.helper.linkedlist,
- org.eclipse.persistence.internal.history,
- org.eclipse.persistence.internal.identitymaps,
- org.eclipse.persistence.internal.indirection,
- org.eclipse.persistence.internal.jpa.parsing,
- org.eclipse.persistence.internal.jpa.parsing.jpql,
- org.eclipse.persistence.internal.jpa.parsing.jpql.antlr,
- org.eclipse.persistence.internal.localization,
- org.eclipse.persistence.internal.localization.i18n,
- org.eclipse.persistence.internal.oxm,
- org.eclipse.persistence.internal.oxm.accessor,
- org.eclipse.persistence.internal.oxm.conversion,
- org.eclipse.persistence.internal.oxm.documentpreservation,
- org.eclipse.persistence.internal.oxm.record,
- org.eclipse.persistence.internal.oxm.record.deferred,
- org.eclipse.persistence.internal.oxm.record.namespaces,
- org.eclipse.persistence.internal.oxm.schema,
- org.eclipse.persistence.internal.oxm.schema.model,
- org.eclipse.persistence.internal.platform.database,
- org.eclipse.persistence.internal.queries,
- org.eclipse.persistence.internal.security,
- org.eclipse.persistence.internal.sequencing,
- org.eclipse.persistence.internal.sessions,
- org.eclipse.persistence.internal.sessions.coordination,
- org.eclipse.persistence.internal.sessions.coordination.broadcast,
- org.eclipse.persistence.internal.sessions.coordination.corba,
- org.eclipse.persistence.internal.sessions.coordination.corba.sun,
- org.eclipse.persistence.internal.sessions.coordination.jms,
- org.eclipse.persistence.internal.sessions.coordination.rmi,
- org.eclipse.persistence.internal.sessions.coordination.rmi.iiop,
- org.eclipse.persistence.internal.sessions.factories,
- org.eclipse.persistence.internal.sessions.factories.model,
- org.eclipse.persistence.internal.sessions.factories.model.event,
- org.eclipse.persistence.internal.sessions.factories.model.log,
- org.eclipse.persistence.internal.sessions.factories.model.login,
- org.eclipse.persistence.internal.sessions.factories.model.platform,
- org.eclipse.persistence.internal.sessions.factories.model.pool,
- org.eclipse.persistence.internal.sessions.factories.model.project,
- org.eclipse.persistence.internal.sessions.factories.model.property,
- org.eclipse.persistence.internal.sessions.factories.model.rcm,
- org.eclipse.persistence.internal.sessions.factories.model.rcm.command,
- org.eclipse.persistence.internal.sessions.factories.model.sequencing,
- org.eclipse.persistence.internal.sessions.factories.model.session,
- org.eclipse.persistence.internal.sessions.factories.model.transport,
- org.eclipse.persistence.internal.sessions.factories.model.transport.discovery,
- org.eclipse.persistence.internal.sessions.factories.model.transport.naming,
- org.eclipse.persistence.internal.sessions.remote,
- org.eclipse.persistence.internal.weaving,
- org.eclipse.persistence.logging,
- org.eclipse.persistence.mappings,
- org.eclipse.persistence.mappings.converters,
- org.eclipse.persistence.mappings.foundation,
- org.eclipse.persistence.mappings.querykeys,
- org.eclipse.persistence.mappings.structures,
- org.eclipse.persistence.mappings.transformers,
- org.eclipse.persistence.mappings.xdb,
- org.eclipse.persistence.oxm,
- org.eclipse.persistence.oxm.annotations,
- org.eclipse.persistence.oxm.attachment,
- org.eclipse.persistence.oxm.documentpreservation,
- org.eclipse.persistence.oxm.mappings,
- org.eclipse.persistence.oxm.mappings.converters,
- org.eclipse.persistence.oxm.mappings.nullpolicy,
- org.eclipse.persistence.oxm.platform,
- org.eclipse.persistence.oxm.record,
- org.eclipse.persistence.oxm.schema,
- org.eclipse.persistence.oxm.sequenced,
- org.eclipse.persistence.oxm.unmapped,
- org.eclipse.persistence.platform.database,
- org.eclipse.persistence.platform.database.converters,
- org.eclipse.persistence.platform.database.jdbc,
- org.eclipse.persistence.platform.database.oracle.plsql,
- org.eclipse.persistence.platform.server,
- org.eclipse.persistence.platform.server.jboss,
- org.eclipse.persistence.platform.server.oc4j,
- org.eclipse.persistence.platform.server.sunas,
- org.eclipse.persistence.platform.server.was,
- org.eclipse.persistence.platform.server.wls,
- org.eclipse.persistence.platform.xml,
- org.eclipse.persistence.platform.xml.jaxp,
- org.eclipse.persistence.queries,
- org.eclipse.persistence.sequencing,
- org.eclipse.persistence.services,
- org.eclipse.persistence.services.mbean,
- org.eclipse.persistence.services.weblogic,
- org.eclipse.persistence.sessions,
- org.eclipse.persistence.sessions.broker,
- org.eclipse.persistence.sessions.changesets,
- org.eclipse.persistence.sessions.coordination,
- org.eclipse.persistence.sessions.coordination.broadcast,
- org.eclipse.persistence.sessions.coordination.corba,
- org.eclipse.persistence.sessions.coordination.corba.sun,
- org.eclipse.persistence.sessions.coordination.jms,
- org.eclipse.persistence.sessions.coordination.rmi,
- org.eclipse.persistence.sessions.factories,
- org.eclipse.persistence.sessions.interceptors,
- org.eclipse.persistence.sessions.remote,
- org.eclipse.persistence.sessions.remote.corba.sun,
- org.eclipse.persistence.sessions.remote.rmi,
- org.eclipse.persistence.sessions.remote.rmi.iiop,
- org.eclipse.persistence.sessions.server,
- org.eclipse.persistence.tools,
- org.eclipse.persistence.tools.file,
- org.eclipse.persistence.tools.profiler,
- org.eclipse.persistence.tools.schemaframework,
- org.eclipse.persistence.transaction,
- org.eclipse.persistence.transaction.jboss,
- org.eclipse.persistence.transaction.jotm,
- org.eclipse.persistence.transaction.oc4j,
- org.eclipse.persistence.transaction.sunas,
- org.eclipse.persistence.transaction.was,
- org.eclipse.persistence.transaction.wls
-Require-Bundle: org.eclipse.persistence.antlr;bundle-version="2.0.1",
- org.eclipse.persistence.asm;bundle-version="2.0.1"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/build.properties b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/build.properties
deleted file mode 100644
index a834e2e..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- lib/org.eclipse.persistence.core_2.0.1.v20100213-r6600.jar
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/build.xml b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/build.xml
deleted file mode 100644
index dd85f26..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/build.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0"?>
-<!--/*******************************************************************************
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
-* which accompanies this distribution.
-* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
-* and the Eclipse Distribution License is available at
-* http://www.eclipse.org/org/documents/edl-v10.php.
-*
-* Contributors:
-* dclarke - initial version
-#******************************************************************************/-->
-<project name="org.eclipse.persistence.incubator.geminijpa.core" default="package" basedir=".">
-
- <target name="init">
- <!-- This HAS to be defined after allowing user redefinitions (which will cause the condition not to set anything) -->
- <!-- This tests to make sure the extensions dir exists, if not sets to a existant dummy location -->
- <condition property="extensions.depend.dir" value="${core.2.base.dir}/../extension.lib.external" else="${core.build.location}">
- <available file="${core.2.base.dir}/../extension.lib.external" type="dir" />
- </condition>
- <echo message="extensions.depend.dir = '${extensions.depend.dir}'" />
-
- <!-- versioning -->
- <!-- These variables are set in autobuild.xml. A manual build gets defaults -->
- <tstamp>
- <format property="build.date" pattern="yyyyMMdd" />
- <format property="build.time" pattern="HHmm" />
- </tstamp>
- <property name="build.type" value="SNAPSHOT" />
- <property name="svn.revision" value="NA" />
- <property name="version.qualifier" value="qualifier" />
- <property name="version.string" value="${release.version}.${version.qualifier}" />
- <property name="release.designation" value="EclipseLink ${release.version} Build" />
- <property name="specification.vendor" value="Eclipse.org - EclipseLink Project" />
- <property name="implementation.vendor" value="${specification.vendor}" />
-
- <!-- dependency properties -->
- <property name="persistence.lib" value="${core.2.jpa.plugins.dir}/${persistence20.jar}" />
- <!-- Core has no jpa 2.0 specific compile dependency: use below instead to test assertion -->
- <!-- property name="persistence.lib" value="${core.2.common.plugins.dir}/${persistence10.jar}"/ -->
-
- <!-- dependency tests -->
- <available file="${persistence.lib}" property="persistence.bundle.exist" />
- <fail message="Cannot find: '${persistence.lib}'" unless="persistence.bundle.exist" />
-
- <!-- Check for BND library -->
- <condition property="bnd.lib" value="${extensions.depend.dir}/${bndtool.jar}">
- <available file="${extensions.depend.dir}/${bndtool.jar}" />
- </condition>
- <condition property="bnd.lib" value="${core.2.buildsys.dir}/${bndtool.jar}">
- <available file="${core.2.buildsys.dir}/${bndtool.jar}" />
- </condition>
- <echo message="bnd.lib = '${bnd.lib}'" />
-
- <!-- Set Compile Path-->
- <path id="core.compile.path">
- <pathelement path="${core.2.common.plugins.dir}/${antlr}" />
- <pathelement path="${core.2.common.plugins.dir}/${asm}" />
- <pathelement path="${persistence.lib}" />
- <fileset dir="${core.2.common.plugins.dir}" includes="${eclipselink.core.depend}" />
- </path>
- </target>
-
- <target name="package" unless="bnd.lib" depends="init" description="jar OSGI bundle">
- <jar jarfile="${core.2.common.plugins.dir}/${ant.project.name}_${version.string}.jar" manifest="${classes.dir}/MANIFEST.MF">
- <fileset dir="${core.2.base.dir}">
- <include name="about.html" />
- <include name="readme.html" />
- <include name="license.*" />
- </fileset>
- <fileset dir="${classes.dir}">
- <include name="org/eclipse/persistence/**/*.class" />
- </fileset>
- <fileset dir="${resource.dir}">
- <include name="xsd/*.xsd" />
- <include name="org/eclipse/persistence/internal/helper/VendorNameToPlatformMapping.properties" />
- </fileset>
- </jar>
- <jar jarfile="${core.2.common.plugins.dir}/${ant.project.name}.source_${version.string}.jar">
- <manifest>
- <attribute name="Specification-Vendor" value="${specification.vendor}" />
- <attribute name="Specification-Version" value="${release.version}" />
- <attribute name="Implementation-Vendor" value="${implementation.vendor}" />
- <attribute name="Implementation-Version" value="${version.string}" />
- <attribute name="Bundle-ManifestVersion" value="2" />
- <attribute name="Bundle-Name" value="EclipseLink Core Source" />
- <attribute name="Bundle-SymbolicName" value="${ant.project.name}.source" />
- <attribute name="Bundle-Vendor" value="${implementation.vendor}" />
- <attribute name="Bundle-Version" value="${version.string}" />
- <attribute name="Eclipse-SourceBundle" value="${ant.project.name};version="${version.string}"" />
- </manifest>
- <fileset dir="${core.2.base.dir}">
- <include name="about.html" />
- <include name="readme.html" />
- <include name="license.*" />
- </fileset>
- <fileset dir="${classes.dir}">
- <include name="org/eclipse/persistence/Version.java" />
- </fileset>
- <fileset dir="${src.dir}">
- <include name="org/eclipse/persistence/**/*.java" />
- <exclude name="org/eclipse/persistence/Version.java" />
- </fileset>
- <fileset dir="${resource.dir}">
- <include name="xsd/*.xsd" />
- <include name="org/eclipse/persistence/internal/helper/VendorNameToPlatformMapping.properties" />
- </fileset>
- </jar>
- </target>
-
-</project>
\ No newline at end of file
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/lib/org.eclipse.persistence.core.source_2.0.1.v20100213-r6600.jar b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/lib/org.eclipse.persistence.core.source_2.0.1.v20100213-r6600.jar
deleted file mode 100644
index 9c8d4e9..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/lib/org.eclipse.persistence.core.source_2.0.1.v20100213-r6600.jar
+++ /dev/null
Binary files differ
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/lib/org.eclipse.persistence.core_2.0.1.v20100213-r6600.jar b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/lib/org.eclipse.persistence.core_2.0.1.v20100213-r6600.jar
deleted file mode 100644
index 3374e6c..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.core/lib/org.eclipse.persistence.core_2.0.1.v20100213-r6600.jar
+++ /dev/null
Binary files differ
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/.classpath b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/.classpath
deleted file mode 100644
index 8411c40..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry exported="true" kind="lib" path="lib/org.eclipse.persistence.jpa_2.0.1.v20100213-r6600.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/.project b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/.project
deleted file mode 100644
index 34e042b..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.persistence.incubator.geminijpa.jpa</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/.settings/org.eclipse.jdt.core.prefs b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 6a6f297..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Tue Mar 02 11:59:23 EST 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/.settings/org.eclipse.pde.core.prefs b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644
index 7f8d7a6..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/.settings/org.eclipse.pde.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Tue Mar 02 11:59:23 EST 2010
-eclipse.preferences.version=1
-pluginProject.extensions=false
-resolve.requirebundle=false
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/META-INF/MANIFEST.MF b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/META-INF/MANIFEST.MF
deleted file mode 100644
index 1b1cc0a..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,67 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: EclipseLink JPA
-Bundle-SymbolicName: org.eclipse.persistence.incubator.geminijpa.jpa
-Bundle-Version: 2.0.2
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: javax.naming,
- javax.persistence;version="1.1.0",
- javax.persistence.criteria;version="1.1.0",
- javax.persistence.metamodel;version="1.1.0",
- javax.persistence.spi;version="1.1.0",
- javax.sql,
- javax.transaction;resolution:=optional,
- javax.transaction.xa;resolution:=optional,
- javax.validation;resolution:=optional,
- javax.validation.groups;resolution:=optional,
- javax.xml.parsers,
- javax.xml.transform;resolution:=optional,
- javax.xml.transform.stream;resolution:=optional,
- org.apache.tools.ant;resolution:=optional,
- org.apache.tools.ant.types;resolution:=optional,
- org.osgi.framework;version="1.3.0",
- org.osgi.service.jdbc,
- org.osgi.service.packageadmin;resolution:=optional,
- org.w3c.dom;resolution:=optional,
- org.xml.sax,
- org.xml.sax.helpers
-Bundle-ClassPath: .,
- lib/org.eclipse.persistence.jpa_2.0.1.v20100213-r6600.jar
-Require-Bundle: org.eclipse.persistence.asm;bundle-version="2.0.1",
- org.eclipse.persistence.antlr;bundle-version="2.0.1",
- org.eclipse.persistence.incubator.geminijpa.core;bundle-version="1.0.0"
-Bundle-Vendor: EclipseLink Project
-Export-Package: org.eclipse.persistence.internal.jpa.deployment,
- org.eclipse.persistence.internal.jpa.deployment.osgi,
- org.eclipse.persistence.internal.jpa.deployment.xml.parser,
- org.eclipse.persistence.internal.jpa.jdbc,
- org.eclipse.persistence.internal.jpa.metadata,
- org.eclipse.persistence.internal.jpa.metadata.accessors,
- org.eclipse.persistence.internal.jpa.metadata.accessors.classes,
- org.eclipse.persistence.internal.jpa.metadata.accessors.mappings,
- org.eclipse.persistence.internal.jpa.metadata.accessors.objects,
- org.eclipse.persistence.internal.jpa.metadata.cache,
- org.eclipse.persistence.internal.jpa.metadata.changetracking,
- org.eclipse.persistence.internal.jpa.metadata.columns,
- org.eclipse.persistence.internal.jpa.metadata.converters,
- org.eclipse.persistence.internal.jpa.metadata.copypolicy,
- org.eclipse.persistence.internal.jpa.metadata.inheritance,
- org.eclipse.persistence.internal.jpa.metadata.listeners,
- org.eclipse.persistence.internal.jpa.metadata.locking,
- org.eclipse.persistence.internal.jpa.metadata.mappings,
- org.eclipse.persistence.internal.jpa.metadata.queries,
- org.eclipse.persistence.internal.jpa.metadata.sequencing,
- org.eclipse.persistence.internal.jpa.metadata.tables,
- org.eclipse.persistence.internal.jpa.metadata.transformers,
- org.eclipse.persistence.internal.jpa.metadata.xml,
- org.eclipse.persistence.internal.jpa.metamodel,
- org.eclipse.persistence.internal.jpa.modelgen,
- org.eclipse.persistence.internal.jpa.querydef,
- org.eclipse.persistence.internal.jpa.transaction,
- org.eclipse.persistence.internal.jpa.weaving,
- org.eclipse.persistence.jpa,
- org.eclipse.persistence.jpa.dynamic,
- org.eclipse.persistence.jpa.osgi,
- org.eclipse.persistence.sessions,
- org.eclipse.persistence.tools.weaving.jpa
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/build.properties b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/build.properties
deleted file mode 100644
index d664375..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- lib/org.eclipse.persistence.jpa_2.0.1.v20100213-r6600.jar,\
- META-INF/
-bin.excludes = META-INF/.svn/
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/lib/org.eclipse.persistence.jpa.source_2.0.1.v20100213-r6600.jar b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/lib/org.eclipse.persistence.jpa.source_2.0.1.v20100213-r6600.jar
deleted file mode 100644
index 211e2fc..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/lib/org.eclipse.persistence.jpa.source_2.0.1.v20100213-r6600.jar
+++ /dev/null
Binary files differ
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/lib/org.eclipse.persistence.jpa_2.0.1.v20100213-r6600.jar b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/lib/org.eclipse.persistence.jpa_2.0.1.v20100213-r6600.jar
deleted file mode 100644
index 6e647a6..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/lib/org.eclipse.persistence.jpa_2.0.1.v20100213-r6600.jar
+++ /dev/null
Binary files differ
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/gemini/jpa/GeminiUtil.java b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/gemini/jpa/GeminiUtil.java
deleted file mode 100644
index 5235d3f..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/gemini/jpa/GeminiUtil.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (C) 2010 Oracle Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.eclipse.gemini.jpa;
-
-import java.io.Closeable;
-import java.lang.reflect.Array;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.ServiceReference;
-
-/**
- * Utility class containing functions that are generally useful during
- * development and at runtime.
- *
- * @author mkeith
- */
-public class GeminiUtil {
-
- /*==================*/
- /* Static constants */
- /*==================*/
-
- public static String JPA_JDBC_DRIVER_PROPERTY = "javax.persistence.jdbc.driver";
- public static String JPA_JDBC_URL_PROPERTY = "javax.persistence.jdbc.url";
- public static String JPA_JDBC_USER_PROPERTY = "javax.persistence.jdbc.user";
- public static String JPA_JDBC_PASSWORD_PROPERTY = "javax.persistence.jdbc.password";
-
- /*============================*/
- /* Helper and Utility methods */
- /*============================*/
-
- // Function to obtain the version from a bundle
- public static String bundleVersion(Bundle b) {
- return b.getVersion().toString();
- }
-
- // Function to return a package String formatted with "." instead of "/"
- public static String formattedPackageString(String s, char beingReplaced, char replacer) {
- String formatted = s;
- // Replace all instances of character
- if (formatted.indexOf(beingReplaced) >= 0)
- formatted = formatted.replace(beingReplaced, replacer);
- // Tack on trailing character if needed
- if (formatted.charAt(formatted.length()-1) != replacer)
- formatted = formatted + replacer;
- return formatted;
- }
-
- // Function to close a stream (as much as it can be closed)
- public static void closeStream(Closeable c) {
- try { c.close(); } catch (Exception ex){}
- }
-
- /*================================*/
- /* Status and debugging functions */
- /*================================*/
-
- // Function to throw a runtime exception (throws exception)
- public static void fatalError(String s, Throwable t) {
- System.out.println("*** FATAL ERROR *** " + s);
- if (t != null)
- t.printStackTrace(System.out);
- throw new RuntimeException(s,t);
- }
-
- // Function to indicate a warning condition (non-terminating)
- public static void warning(String msg) {
- warning(msg, "");
- }
-
- // Function to indicate a warning condition (non-terminating)
- public static void warning(String msg, Throwable t) {
- String msg2 = (t != null ? (" Exception: " + t) : "");
- warning(msg, msg2);
- }
-
- // Function to indicate a warning condition (non-terminating)
- public static void warning(String msg, String msg2) {
- String outputMsg = "WARNING: " + msg + msg2;
- System.out.println(outputMsg);
- }
-
- // Function to print out debug strings for XML parsing purposes
- public static void debugXml(String... msgs) {
- if (System.getProperty("GEMINI_DEBUG_XML") != null) {
- debug(msgs);
- }
- }
-
- // Function to print out series of debug strings
- public static void debug(String... msgs) {
- if (System.getProperty("GEMINI_DEBUG") != null) {
- StringBuilder sb = new StringBuilder();
- for (String msg : msgs) sb.append(msg);
- System.out.println(sb.toString());
- }
- }
-
- // Function to print out a string and an object.
- // Handles some objects specially and prints out more info
- public static void debug(String msg, Object obj) {
- if (System.getProperty("GEMINI_DEBUG") != null) {
- if (obj == null) {
- System.out.println(msg + String.valueOf(obj));
- } else if (ClassLoader.class.isAssignableFrom(obj.getClass())) {
- System.out.println(msg + obj);
- ClassLoader p = (ClassLoader)obj;
- while (p.getParent() != null) {
- System.out.println(" Parent loader: " + p.getParent());
- p = p.getParent();
- }
- } else if (Bundle.class.isAssignableFrom(obj.getClass())) {
- Bundle b = (Bundle) obj;
- System.out.println(msg + " bundle=" + b.getSymbolicName() +
- " id=" + b.getBundleId()+
- " state=" + stringBundleStateFromInt(b.getState()));
- } else if (BundleEvent.class.isAssignableFrom(obj.getClass())) {
- BundleEvent event = (BundleEvent) obj;
- System.out.println(msg + " bundle=" + event.getBundle().getSymbolicName() +
- ", event=" + stringBundleEventFromInt(event.getType()));
- } else if (obj.getClass().isArray()) {
- System.out.println(msg);
- int len = ((Object[])obj).length;
- for (int i=0; i<len; i++) {
- System.out.print(" ");
- System.out.println(String.valueOf(Array.get(obj, i)));
- }
- } else {
- System.out.println(msg + String.valueOf(obj));
- }
- }
- }
-
- public static String stringBundleStateFromInt(int bundleState) {
- switch (bundleState) {
- case 1: return "UNINSTALLED";
- case 2: return "INSTALLED";
- case 4: return "RESOLVED";
- case 8: return "STARTING";
- case 16: return "STOPPING";
- case 32: return "ACTIVE";
- default: return "UNDEFINED_STATE";
- }
- }
-
- public static String stringBundleEventFromInt(int eventType) {
- switch (eventType) {
- case 1: return "INSTALLED";
- case 2: return "STARTED";
- case 4: return "STOPPED";
- case 8: return "UPDATED";
- case 16: return "UNINSTALLED";
- case 32: return "RESOLVED";
- case 64: return "UNRESOLVED";
- case 128: return "STARTING";
- case 256: return "STOPPING";
- case 512: return "LAZY_ACTIVATION";
- default: return "UNDEFINED_EVENT";
- }
- }
-}
\ No newline at end of file
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/ArchiveFactoryImpl.java b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/ArchiveFactoryImpl.java
deleted file mode 100644
index e78a474..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/ArchiveFactoryImpl.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * mkeith - Gemini JPA work (INCUBATION)
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.internal.jpa.deployment;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.JarURLConnection;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.jar.JarInputStream;
-import java.util.logging.Logger;
-import java.util.logging.Level;
-
-import org.eclipse.persistence.internal.helper.Helper;
-import org.eclipse.persistence.jpa.Archive;
-import org.eclipse.persistence.jpa.ArchiveFactory;
-
-/**
- * This class is written to deal with various URLs that can be returned by
- * {@link javax.persistence.spi.PersistenceUnitInfo#getPersistenceUnitRootUrl()}
- *
- * @author Sanjeeb.Sahoo@Sun.COM
- */
-public class ArchiveFactoryImpl implements ArchiveFactory {
- /*
- * Implementation Note: This class does not have any dependency on either
- * EclipseLink or GlassFish implementation classes. Please retain this separation.
- */
-
- private Logger logger;
-
- @SuppressWarnings("deprecation")
- public ArchiveFactoryImpl() {
- this(Logger.global);
- }
-
- public ArchiveFactoryImpl(Logger logger) {
- this.logger = logger;
- }
-
- public Archive createArchive(URL rootUrl) throws URISyntaxException, IOException {
- return createArchive(rootUrl, null);
- }
-
- public Archive createArchive(URL rootUrl, URL descriptorUrl) throws URISyntaxException, IOException {
- logger.entering("ArchiveFactoryImpl", "createArchive", new Object[]{rootUrl, descriptorUrl});
- Archive result = null;
- String protocol = rootUrl.getProtocol();
- logger.logp(Level.FINER, "ArchiveFactoryImpl", "createArchive", "protocol = {0}", protocol);
-
- if ("file".equals(protocol)) {
- URI uri = Helper.toURI(rootUrl);
-
- File f;
- try {
- // Attempt to create the file with the uri. The pre-conditions
- // are checked in the constructor and an exception is thrown
- // if the uri does not meet them.
- f = new File(uri);
- } catch (IllegalArgumentException e) {
- // Invalid uri for File. Go our back up route of using the
- // path from the url.
- f = new File(rootUrl.getPath());
- }
-
- if (f.isDirectory()) {
- // e.g. file:/tmp/a_ear/ejb_jar
- result = new DirectoryArchive(f);
- } else {
- // e.g. file:/tmp/a_ear/lib/pu.jarlo
- // It's not a directory. Then it must be a jar file.
- result = new JarFileArchive(new JarFile(f));
- }
- // mkeith - add bundle archive hook
- // TODO Does this work for all OSGi frameworks?
- } else if ("bundleresource".equals(protocol)) { // NOI18N
- // mkeith - for regular non-embedded descriptors
- result = new BundleArchive(rootUrl, descriptorUrl);
-
- } else if ("jar".equals(protocol)) { // NOI18N
- JarURLConnection conn = JarURLConnection.class.cast(rootUrl.openConnection());
- JarEntry je = conn.getJarEntry();
- if (je == null) {
- // e.g. jar:file:/tmp/a_ear/lib/pu.jar!/
- // No entryName specified, hence URL points to a JAR file and
- // not to any entry inside it. Ideally this should have been
- // file:/tmp/a_ear/lib/pu.jar,
- // but containers (e.g.) WebLogic return this kind of URL,
- // so we better handle this in our code to imrove pluggability.
- // Read the entire jar file.
- result = new JarFileArchive(conn.getJarFile());
- } else if (je.isDirectory()) {
- // e.g. jar:file:/tmp/a_ear/b.war!/WEB-INF/classes/
- // entryName [je.getName()] is a directory
- result = new DirectoryInsideJarURLArchive(rootUrl);
- } else {
- // some URL (e.g.) jar:file:/tmp/a_ear/b.war!/WEB-INF/lib/pu.jar
- // entryName [je.getName()] is a file, so treat this URL as a
- // URL from which a JAR format InputStream can be obtained.
- result = new JarInputStreamURLArchive(rootUrl);
- }
- } else if (isJarInputStream(rootUrl)){
- result = new JarInputStreamURLArchive(rootUrl);
- } else {
- result = new URLArchive(rootUrl);
- }
- logger.exiting("ArchiveFactoryImpl", "createArchive", result);
- return result;
- }
-
- /**
- * This method is called for a URL which has neither jar nor file protocol.
- * This attempts to find out if we can treat it as a URL from which a JAR
- * format InputStream can be obtained.
- * @param url
- */
- private boolean isJarInputStream(URL url) throws IOException {
- InputStream in = null;
- try {
- in = url.openStream();
- if (in == null) { // for directories, we may get InputStream as null
- return false;
- }
- JarInputStream jis = new JarInputStream(in);
- jis.close();
- return true; // we are successful in creating a Jar format IS
- } catch (IOException ioe) {
- if (in != null) {
- in.close();
- }
- return false;
- }
- }
-}
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/BundleArchive.java b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/BundleArchive.java
deleted file mode 100644
index 19ed829..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/BundleArchive.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * mkeith - Gemini JPA work (INCUBATION)
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.internal.jpa.deployment;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.gemini.jpa.GeminiUtil;
-
-public class BundleArchive extends URLArchive {
-
- URL descriptorUrl;
-
- public BundleArchive(URL rootUrl, URL descriptorUrl) {
- super(rootUrl);
- this.descriptorUrl = descriptorUrl;
- }
-
- public InputStream getDescriptorStream() {
- GeminiUtil.debug("BundleArchive - getDescriptorStream, url: ", descriptorUrl);
- InputStream is = null;
- try {
- is = descriptorUrl.openStream();
- } catch (IOException ioe) {
- // we return null when entry does not exist
- }
- GeminiUtil.debug("BundleArchive - getDescriptorStream, returning: ", is);
- return is;
- }
-
- public InputStream getEntry(String entryPath) throws IOException {
- GeminiUtil.debug("BundleArchive - getEntry, path: ", entryPath);
- URL subEntry = new URL(getRootURL(), entryPath);
- GeminiUtil.debug("BundleArchive - getEntry, new url: ", subEntry);
- InputStream is = null;
- try {
- is = subEntry.openStream();
- } catch (IOException ioe) {
- // we return null when entry does not exist
- }
- GeminiUtil.debug("BundleArchive - getEntry, returning: ", is);
- return is;
- }
-
- public URL getEntryAsURL(String entryPath) throws IOException {
- GeminiUtil.debug("BundleArchive - getEntryAsURL, path: ", entryPath);
- URL subEntry = new URL(getRootURL(), entryPath);
- try {
- InputStream is = subEntry.openStream();
- if (is == null){
- return null;
- }
- is.close();
- } catch (IOException ioe) {
- return null; // return null when entry does not exist
- }
- GeminiUtil.debug("BundleArchive - getEntryAsURL, returning: ", subEntry);
- return subEntry;
- }
-}
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/BundleJarUrlArchive.java b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/BundleJarUrlArchive.java
deleted file mode 100644
index 0f44758..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/BundleJarUrlArchive.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.eclipse.persistence.internal.jpa.deployment;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-public class BundleJarUrlArchive extends JarInputStreamURLArchive {
-
- String descriptorPath;
-
- public BundleJarUrlArchive(URL jarUrl, String descPath) throws IOException {
- super(jarUrl);
- descriptorPath = descPath;
- }
-
- public InputStream getDescriptorStream() {
- InputStream result = null;
- try {
- result = getEntry(descriptorPath);
- } catch (IOException ioEx) {} // result is just null
- return result;
- }
-
- public URL getDescriptorURL() {
- return null;
- }
-
- public URL getJarUrl() {
- // The JAR url is what the superclass thinks is the root URL
- return super.getRootURL();
- }
-
- public URL getRootURL() {
- // The root url is just the root of the bundle
- try {
- URL rootUrl = new URL(getJarUrl().getProtocol()+ "://" + getJarUrl().getAuthority());
- return rootUrl;
- } catch (IOException ioEx) {
- throw new RuntimeException("Error trying to create Root URL in BundleJarArchive: " + ioEx);
- }
- }
-}
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/JPAInitializer.java b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/JPAInitializer.java
deleted file mode 100644
index 5f56a3d..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/JPAInitializer.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * mkeith - Gemini JPA work (INCUBATION)
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.internal.jpa.deployment;
-
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.persistence.spi.ClassTransformer;
-import javax.persistence.spi.PersistenceUnitInfo;
-
-import org.eclipse.gemini.jpa.GeminiUtil;
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.exceptions.ValidationException;
-import org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider;
-import org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl;
-import org.eclipse.persistence.jpa.Archive;
-import org.eclipse.persistence.jpa.PersistenceProvider;
-import org.eclipse.persistence.logging.AbstractSessionLog;
-import org.eclipse.persistence.logging.SessionLog;
-
-/**
- * Base class for all JPA initialization classes. This is an abstract class that provides the framework
- * for JPA initialization (finding and initializing persistence units). Subclasses implement the abstract methods
- * to provide customized functionality
- *
- * @see JavaSESMPInitializer
- * @see OSGiInitializer
- * @See EquinoxInitializer
- * @author tware
- *
- */
-public abstract class JPAInitializer {
-
- // The internal loader is used by applications that do weaving to pre load classes
- // When this flag is set to false, we will not be able to weave.
- protected boolean shouldCreateInternalLoader = true;
-
- protected ClassLoader initializationClassloader = null;
-
- /**
- * Initialize the logging file if it is specified by the system property.
- */
- public static void initializeTopLinkLoggingFile() {
- String loggingFile = System.getProperty(PersistenceUnitProperties.LOGGING_FILE);
- try {
- if (loggingFile != null) {
- AbstractSessionLog.getLog().setWriter(new FileWriter(loggingFile));
- }
- } catch (IOException e) {
- AbstractSessionLog.getLog().log(SessionLog.WARNING, "cmp_init_default_logging_file_is_invalid",loggingFile,e);
- }
- }
-
- /**
- * predeploy (with deploy) is one of the two steps required in deployment of entities
- * This method will prepare to call predeploy, call it and finally register the
- * transformer returned to be used for weaving.
- */
- public EntityManagerSetupImpl callPredeploy(SEPersistenceUnitInfo persistenceUnitInfo, Map m, PersistenceInitializationHelper persistenceHelper, String persistenceUnitUniqueName, String sessionName) {
- AbstractSessionLog.getLog().log(SessionLog.FINER, "cmp_init_invoke_predeploy", persistenceUnitInfo.getPersistenceUnitName());
- Map mergedProperties = EntityManagerFactoryProvider.mergeMaps(m, persistenceUnitInfo.getProperties());
- // Bug#4452468 When globalInstrumentation is null, there is no weaving
- checkWeaving(mergedProperties);
-
- Set tempLoaderSet = PersistenceUnitProcessor.buildClassSet(persistenceUnitInfo, persistenceHelper.getClassLoader(persistenceUnitInfo.getPersistenceUnitName(), m));
- // Create the temp loader that will not cache classes for entities in our persistence unit
- ClassLoader tempLoader = createTempLoader(tempLoaderSet);
- ((SEPersistenceUnitInfo)persistenceUnitInfo).setNewTempClassLoader(tempLoader);
- ((SEPersistenceUnitInfo)persistenceUnitInfo).setClassLoader(persistenceHelper.getClassLoader(persistenceUnitInfo.getPersistenceUnitName(), m));
-
- EntityManagerSetupImpl emSetupImpl = new EntityManagerSetupImpl(persistenceUnitUniqueName, sessionName);
-
- // A call to predeploy will partially build the session we will use
- final ClassTransformer transformer = emSetupImpl.predeploy(persistenceUnitInfo, mergedProperties);
-
- // After preDeploy it's impossible to weave again - so may substitute the temporary classloader with the real one.
- // The temporary classloader could be garbage collected even if the puInfo is cached for the future use by other emSetupImpls.
- ((SEPersistenceUnitInfo)persistenceUnitInfo).setNewTempClassLoader(((SEPersistenceUnitInfo)persistenceUnitInfo).getClassLoader());
-
- registerTransformer(transformer, persistenceUnitInfo);
- return emSetupImpl;
- }
-
- /**
- * Check whether weaving is possible and update the properties and variable as appropriate
- * @param properties The list of properties to check for weaving and update if weaving is not needed
- */
- public abstract void checkWeaving(Map properties);
-
- /**
- * Create a temporary class loader that can be used to inspect classes and then
- * thrown away. This allows classes to be introspected prior to loading them
- * with application's main class loader enabling weaving.
- */
- protected abstract ClassLoader createTempLoader(Collection col);
-
- protected abstract ClassLoader createTempLoader(Collection col, boolean shouldOverrideLoadClassForCollectionMembers);
-
- /**
- * Find PersistenceUnitInfo corresponding to the persistence unit name.
- * Returns null if either persistence unit either not found or provider is not supported.
- */
- public SEPersistenceUnitInfo findPersistenceUnitInfo(String puName, Map m, PersistenceInitializationHelper persistenceHelper) {
- SEPersistenceUnitInfo persistenceUnitInfo = null;
- if(EntityManagerFactoryProvider.initialPuInfos != null) {
- persistenceUnitInfo = EntityManagerFactoryProvider.initialPuInfos.get(puName);
- if(persistenceUnitInfo != null) {
- return persistenceUnitInfo;
- }
- }
- return findPersistenceUnitInfoInArchives(puName, m, persistenceHelper);
- }
-
- /**
- * Find PersistenceUnitInfo corresponding to the persistence unit name.
- * Returns null if either persistence unit either not found or provider is not supported.
- */
- protected SEPersistenceUnitInfo findPersistenceUnitInfoInArchives(String puName, Map m, PersistenceInitializationHelper persistenceHelper) {
- SEPersistenceUnitInfo persistenceUnitInfo = null;
- // mkeith - get resource name from prop and include in subsequent call
- GeminiUtil.debug("JPAInit - findPersistenceUnitInfoInArchives, props = ", m);
- String descriptorPath = (String) m.get(PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML);
- final Set<Archive> pars;
- if (descriptorPath != null) {
- pars = PersistenceUnitProcessor.findPersistenceArchives(initializationClassloader, descriptorPath);
- } else {
- pars = PersistenceUnitProcessor.findPersistenceArchives(initializationClassloader);
- }
- for (Archive archive: pars) {
- persistenceUnitInfo = findPersistenceUnitInfoInArchive(puName, archive, m, persistenceHelper);
- if(persistenceUnitInfo != null) {
- break;
- }
- }
- return persistenceUnitInfo;
- }
-
- /**
- * Find PersistenceUnitInfo corresponding to the persistence unit name in the archive.
- * Returns null if either persistence unit either not found or provider is not supported.
- */
- protected SEPersistenceUnitInfo findPersistenceUnitInfoInArchive(String puName, Archive archive, Map m, PersistenceInitializationHelper persistenceActivator){
- GeminiUtil.debug("JPAInit - findPersistenceUnitInfoInArchive, puName = ", puName);
- Iterator<SEPersistenceUnitInfo> persistenceUnits = PersistenceUnitProcessor.getPersistenceUnits(archive, initializationClassloader).iterator();
- while (persistenceUnits.hasNext()) {
- SEPersistenceUnitInfo persistenceUnitInfo = persistenceUnits.next();
- if(isPersistenceProviderSupported(persistenceUnitInfo.getPersistenceProviderClassName()) && persistenceUnitInfo.getPersistenceUnitName().equals(puName)) {
- return persistenceUnitInfo;
- }
- }
- return null;
- }
-
- /**
- * Returns whether the given persistence provider class is supported by this implementation
- * @param providerClassName
- * @return
- */
- public boolean isPersistenceProviderSupported(String providerClassName){
- return (providerClassName == null) || providerClassName.equals("") || providerClassName.equals(EntityManagerFactoryProvider.class.getName()) || providerClassName.equals(PersistenceProvider.class.getName());
- }
-
- /**
- * Create a list of java.lang.Class that contains the classes of all the entities
- * that we will be deploying.
- */
- protected Set loadEntityClasses(Collection entityNames, ClassLoader classLoader) {
- Set entityClasses = new HashSet();
-
- // Load the classes using the loader passed in
- AbstractSessionLog.getLog().log(SessionLog.FINER, "cmp_loading_entities_using_loader", classLoader);
- for (Iterator iter = entityNames.iterator(); iter.hasNext();) {
- String entityClassName = (String)iter.next();
- try {
- entityClasses.add(classLoader.loadClass(entityClassName));
- } catch (ClassNotFoundException cnfEx) {
- throw ValidationException.entityClassNotFound(entityClassName, classLoader, cnfEx);
- }
- }
- return entityClasses;
- }
-
- /**
- * Register a transformer. This method should be overridden to provide the appropriate transformer
- * registration for the environment
- * @param transformer
- * @param persistenceUnitInfo
- */
- public abstract void registerTransformer(final ClassTransformer transformer, PersistenceUnitInfo persistenceUnitInfo);
-
- /**
- * Indicates whether puName uniquely defines the persistence unit.
- */
- public boolean isPersistenceUnitUniquelyDefinedByName() {
- return true;
- }
-
- /**
- * In case persistence unit is not uniquely defined by name
- * this method is called to generate a unique name.
- */
- public String createUniquePersistenceUnitName(PersistenceUnitInfo puInfo) {
- return PersistenceUnitProcessor.buildPersistenceUnitName(puInfo.getPersistenceUnitRootUrl(), puInfo.getPersistenceUnitName());
- }
-}
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/PersistenceUnitProcessor.java b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/PersistenceUnitProcessor.java
deleted file mode 100644
index 0bfa84b..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/PersistenceUnitProcessor.java
+++ /dev/null
@@ -1,558 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * mkeith - Gemini JPA work (INCUBATION)
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.internal.jpa.deployment;
-
-import java.net.URL;
-import java.net.URISyntaxException;
-import java.net.JarURLConnection;
-import java.net.MalformedURLException;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.util.Enumeration;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.HashSet;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.persistence.spi.PersistenceUnitInfo;
-import java.net.URLDecoder;
-import java.io.UnsupportedEncodingException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.InputSource;
-
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.config.SystemProperties;
-import org.eclipse.persistence.exceptions.PersistenceUnitLoadingException;
-import org.eclipse.persistence.exceptions.XMLParseException;
-import org.eclipse.persistence.internal.jpa.deployment.xml.parser.PersistenceContentHandler;
-import org.eclipse.persistence.internal.jpa.deployment.xml.parser.XMLException;
-import org.eclipse.persistence.internal.jpa.deployment.xml.parser.XMLExceptionHandler;
-import org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor;
-import org.eclipse.persistence.internal.jpa.metadata.MetadataProject;
-import org.eclipse.persistence.logging.AbstractSessionLog;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotation;
-import org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataClass;
-import org.eclipse.persistence.internal.security.PrivilegedAccessHelper;
-import org.eclipse.persistence.internal.security.PrivilegedNewInstanceFromClass;
-import org.eclipse.persistence.jpa.Archive;
-import org.eclipse.persistence.jpa.ArchiveFactory;
-
-import static org.eclipse.gemini.jpa.GeminiUtil.*;
-
-/**
- * INTERNAL:
- * Utility Class that deals with persistence archives for EJB 3.0
- * Provides functions like searching for persistence archives, processing
- * persistence.xml and searching for Entities in a Persistence archive
- */
-public class PersistenceUnitProcessor {
-
- /**
- * Entries in a zip file are directory entries using slashes to separate
- * them. Build a class name using '.' instead of slash and removing the
- * '.class' extension.
- */
- public static String buildClassNameFromEntryString(String classEntryString){
- String classNameForLoader = classEntryString;
- if (classEntryString.endsWith(".class")){
- classNameForLoader = classNameForLoader.substring(0, classNameForLoader.length() - 6);
- classNameForLoader = classNameForLoader.replace("/", ".");
- }
- return classNameForLoader;
- }
-
- /**
- * Build a set that contains all the class names at a URL.
- * @return a Set of class name strings
- */
- public static Set<String> buildClassSet(PersistenceUnitInfo persistenceUnitInfo, ClassLoader loader){
- Set<String> set = new HashSet<String>();
- set.addAll(persistenceUnitInfo.getManagedClassNames());
- Iterator i = persistenceUnitInfo.getJarFileUrls().iterator();
- while (i.hasNext()) {
- set.addAll(getClassNamesFromURL((URL)i.next(), loader));
- }
- if (!persistenceUnitInfo.excludeUnlistedClasses()){
- set.addAll(getClassNamesFromURL(persistenceUnitInfo.getPersistenceUnitRootUrl(), loader));
- }
- // No longer need to add classes from XML, as temp class loader is only used for sessions.xml.
- return set;
- }
-
- /**
- * Create a list of the entities that will be deployed. This list is built
- * from the information provided in the PersistenceUnitInfo argument.
- * The list contains Classes specified in the PersistenceUnitInfo's class
- * list and also files that are annotated with @Entity and @Embeddable in
- * the jar files provided in the persistence info. This list of classes will
- * used to build a deployment project and to decide what classes
- * to weave.
- */
- public static Collection<MetadataClass> buildEntityList(MetadataProcessor processor, ClassLoader loader) {
- ArrayList<MetadataClass> entityList = new ArrayList<MetadataClass>();
- for (String className : processor.getProject().getWeavableClassNames()) {
- entityList.add(processor.getMetadataFactory().getMetadataClass(className));
- }
- return entityList;
- }
-
- /**
- * Determine the URL path to the persistence unit
- * @param pxmlURL - Encoded URL containing the pu
- * @return
- * @throws IOException
- */
- public static URL computePURootURL(URL pxmlURL) throws IOException, URISyntaxException {
- URL result;
- String protocol = pxmlURL.getProtocol();
- if("file".equals(protocol)) { // NOI18N
- // e.g. file:/tmp/META-INF/persistence.xml
- // 210280: any file url will be assumed to always reference a file (not a directory)
- result = new URL(pxmlURL, ".."); // NOI18N
- } else if("jar".equals(protocol)) { // NOI18N
- // e.g. jar:file:/tmp/a_ear/b.jar!/META-INF/persistence.xml
- JarURLConnection conn =
- JarURLConnection.class.cast(pxmlURL.openConnection());
-// mkeith - Don't assert we know the name of the descriptor
-// assert(conn.getJarEntry().getName().equals(
-// "META-INF/persistence.xml")); // NOI18N
- result = conn.getJarFileURL();
- // mkeith - add bundle protocol cases
- } else if ("bundleentry".equals(protocol)) {
- result = new URL("bundleentry://" + pxmlURL.getAuthority());
- } else if ("bundleresource".equals(protocol)) {
- result = new URL("bundleresource://" + pxmlURL.getAuthority());
- } else {
- // some other protocol
- // e.g. bundleresource://21/META-INF/persistence.xml
- result = new URL(pxmlURL, "../"); // NOI18N
- }
- result = fixUNC(result);
- return result;
- }
-
-
- /**
- * This method fixes incorrect authority attribute
- * that is set by JDK when UNC is used in classpath.
- * See JDK bug #6585937 and GlassFish issue #3209 for more details.
- */
- private static URL fixUNC(URL url) throws URISyntaxException, MalformedURLException, UnsupportedEncodingException
- {
- String protocol = url.getProtocol();
- if (!"file".equalsIgnoreCase(protocol)) {
- return url;
- }
- String authority= url.getAuthority();
- String file = url.getFile();
- if (authority != null) {
- AbstractSessionLog.getLog().finer(
- "fixUNC: before fixing: url = " + url + ", authority = " + authority + ", file = " + file);
- assert(url.getPort() == -1);
-
- // See GlassFish issue https://glassfish.dev.java.net/issues/show_bug.cgi?id=3209 and
- // JDK issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6585937
- // When there is UNC path in classpath, the classloader.getResource
- // returns a file: URL with an authority component in it.
- // The URL looks like this:
- // file://ahost/afile.
- // Interestingly, authority and file components for the above URL
- // are either "ahost" and "/afile" or "" and "//ahost/afile" depending on
- // how the URL is obtained. If classpath is set as a jar with UNC,
- // the former is true, if the classpath is set as a directory with UNC,
- // the latter is true.
- String prefix = "";
- if (authority.length() > 0) {
- prefix = "////";
- } else if (file.startsWith("//")) {
- prefix = "//";
- }
- file = prefix.concat(authority).concat(file);
- url = new URL(protocol, null, file);
- AbstractSessionLog.getLog().finer(
- "fixUNC: after fixing: url = " + url + ", authority = " + url.getAuthority() + ", file = " + url.getFile());
- }
- return url;
- }
-
- /**
- * Search the classpath for persistence archives. A persistence archive is
- * defined as any part of the class path that contains a META-INF directory
- * with a persistence.xml file in it. Return a list of the URLs of those
- * files. Use the current thread's context classloader to get the classpath.
- * We assume it is a URL class loader.
- */
- public static Set<Archive> findPersistenceArchives(){
- // mkeith - change to use constant
- debug("New PP findPersistenceArchives - defaults");
- ClassLoader threadLoader = Thread.currentThread().getContextClassLoader();
- return findPersistenceArchives(threadLoader);
- }
-
- /**
- * Search the classpath for persistence archives. A persistence archive is
- * defined as any part of the class path that contains a META-INF directory
- * with a persistence.xml file in it. Return a list of {@link Archive}
- * representing the root of those files. It is the caller's responsibility
- * to close all the archives.
- *
- * @param loader the class loader to get the class path from
- */
- public static Set<Archive> findPersistenceArchives(ClassLoader loader){
- Set<Archive> pars = new HashSet<Archive>();
- try {
- Enumeration<URL> resources = loader.getResources(PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML_DEFAULT);
- while (resources.hasMoreElements()){
- URL pxmlURL = resources.nextElement();
- URL puRootURL = computePURootURL(pxmlURL);
- Archive archive = PersistenceUnitProcessor.getArchiveFactory(loader).createArchive(puRootURL);
- pars.add(archive);
- }
- } catch (java.io.IOException exc){
- //clean up first
- for (Archive archive : pars) {
- archive.close();
- }
- throw PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(loader, exc);
- } catch (URISyntaxException exc) {
- //clean up first
- for (Archive archive : pars) {
- archive.close();
- }
- throw PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(loader, exc);
- }
-
- return pars;
- }
-
- /**
- * Return a list of Archives representing the root of the persistence descriptor.
- * It is the caller's responsibility to close all the archives.
- *
- * @param loader the class loader to get the class path from
- */
- // mkeith - add descriptorPath argument
- public static Set<Archive> findPersistenceArchives(ClassLoader loader, String descriptorPath){
-
- debug("PUP findPersistenceArchives - desc path: ", descriptorPath);
- Archive archive = null;
- boolean embedded = false;
-
- Set<Archive> archives = new HashSet<Archive>();
-
- // See if we are talking about an embedded descriptor
- int splitPosition = descriptorPath.indexOf("!/");
-
- try {
- // If not embedded descriptor then just use the regular descriptor path
- if (splitPosition == -1) {
- URL descUrl = loader.getResource(descriptorPath);
- URL puRootUrl = computePURootURL(descUrl);
- debug("PUP findPersistenceArchives - computedRootUrl ", puRootUrl);
- archive = new BundleArchive(puRootUrl, descUrl);
- debug("PUP findPersistenceArchives - archive ", archive);
- if (archive != null)
- archives.add(archive);
- } else {
- // It is an embedded archive, so split up the parts
- String jarPrefixPath = descriptorPath.substring(0, splitPosition);
- debug("PUP - Embedded descriptor JAR prefix: ", jarPrefixPath);
- String descPath = descriptorPath.substring(splitPosition+2);
- debug("PUP - Embedded descriptor suffix: ", descPath);
- // TODO This causes the bundle to be resolved (not what we want)!
- URL prefixUrl = loader.getResource(jarPrefixPath);
- archive = new BundleJarUrlArchive(prefixUrl, descPath);
- if (prefixUrl != null) {
- archives.add(archive);
- }
- debug("PUP findPersistenceArchives - archive ", archive);
- if (archive != null)
- archives.add(archive);
- }
- } catch (Exception ex){
- //clean up first
- for (Archive a : archives)
- a.close();
- throw PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(loader, ex);
- }
- return archives;
- }
-
- public static ArchiveFactory getArchiveFactory(ClassLoader loader){
- String factoryClassName = System.getProperty(SystemProperties.ARCHIVE_FACTORY, null);
- if (factoryClassName == null){
- return new ArchiveFactoryImpl();
- }
- try{
- if (factoryClassName != null){
- ArchiveFactory factory = null;
- if (loader != null) {
- Class archiveClass = loader.loadClass(factoryClassName);
- if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
- try {
- factory = (ArchiveFactory)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(archiveClass));
- } catch (PrivilegedActionException exception) {
- throw PersistenceUnitLoadingException.exceptionCreatingArchiveFactory(factoryClassName, exception);
- }
- } else {
- factory = (ArchiveFactory)PrivilegedAccessHelper.newInstanceFromClass(archiveClass);
- }
- }
- return factory;
- }
- return new ArchiveFactoryImpl();
- } catch (ClassNotFoundException cnfe) {
- throw PersistenceUnitLoadingException.exceptionCreatingArchiveFactory(factoryClassName, cnfe);
- } catch (IllegalAccessException iae) {
- throw PersistenceUnitLoadingException.exceptionCreatingArchiveFactory(factoryClassName, iae);
- } catch (InstantiationException ie) {
- throw PersistenceUnitLoadingException.exceptionCreatingArchiveFactory(factoryClassName, ie);
- }
- }
-
- public static Set<String> getClassNamesFromURL(URL url, ClassLoader loader) {
- Set<String> classNames = new HashSet<String>();
- Archive archive = null;
- try {
- archive = PersistenceUnitProcessor.getArchiveFactory(loader).createArchive(url);
-
- for (Iterator<String> entries = archive.getEntries(); entries.hasNext();) {
- String entry = entries.next();
- if (entry.endsWith(".class")){ // NOI18N
- classNames.add(buildClassNameFromEntryString(entry));
- }
- }
- } catch (URISyntaxException e) {
- throw new RuntimeException("url = [" + url + "]", e); // NOI18N
- } catch (IOException e) {
- throw new RuntimeException("url = [" + url + "]", e); // NOI18N
- } finally {
- if (archive != null) {
- archive.close();
- }
- }
- return classNames;
- }
-
- /**
- * Return if a given class is annotated with @Embeddable.
- */
- public static MetadataAnnotation getEmbeddableAnnotation(MetadataClass candidateClass){
- return candidateClass.getAnnotation(javax.persistence.Embeddable.class);
- }
-
- /**
- * Return if a given class is annotated with @Entity.
- */
- public static MetadataAnnotation getEntityAnnotation(MetadataClass candidateClass){
- return candidateClass.getAnnotation(javax.persistence.Entity.class);
- }
-
- /**
- * Get a list of persistence units from the file or directory at the given
- * url. PersistenceUnits are built based on the presence of a persistence descriptor
- * *
- * @param archive The url of a jar file or directory to check
- */
- public static List<SEPersistenceUnitInfo> getPersistenceUnits(Archive archive, ClassLoader loader){
- return processPersistenceArchive(archive, loader);
- }
-
- /**
- * Return the @StaticMetamodel annotation on the given class.
- */
- public static MetadataAnnotation getStaticMetamodelAnnotation(MetadataClass candidateClass){
- return candidateClass.getAnnotation(javax.persistence.metamodel.StaticMetamodel.class);
- }
-
- /**
- * Return if a given class is annotated with @Embeddable.
- */
- public static boolean isEmbeddable(MetadataClass candidateClass) {
- return candidateClass.isAnnotationPresent(javax.persistence.Embeddable.class);
- }
-
- /**
- * Return if a given class is annotated with @Entity.
- */
- public static boolean isEntity(MetadataClass candidateClass){
- return candidateClass.isAnnotationPresent(javax.persistence.Entity.class);
- }
-
- /**
- * Return if a given class is annotated with @StaticMetamodel.
- */
- public static boolean isStaticMetamodelClass(MetadataClass candidateClass) {
- return candidateClass.isAnnotationPresent(javax.persistence.metamodel.StaticMetamodel.class);
- }
-
- /**
- * Load the given class name with the given class loader.
- */
- public static Class loadClass(String className, ClassLoader loader, boolean throwExceptionIfNotFound, MetadataProject project) {
- Class candidateClass = null;
-
- try {
- candidateClass = loader.loadClass(className);
- } catch (ClassNotFoundException exc){
- if (throwExceptionIfNotFound){
- throw PersistenceUnitLoadingException.exceptionLoadingClassWhileLookingForAnnotations(className, exc);
- } else {
- AbstractSessionLog.getLog().log(AbstractSessionLog.WARNING, "persistence_unit_processor_error_loading_class", exc.getClass().getName(), exc.getLocalizedMessage() , className);
- }
- } catch (NullPointerException npe) {
- // Bug 227630: If any weavable class is not found in the temporary
- // classLoader - disable weaving
- AbstractSessionLog.getLog().log(AbstractSessionLog.WARNING, "persistence_unit_processor_error_loading_class_weaving_disabled", loader, project.getPersistenceUnitInfo().getPersistenceUnitName(), className);
- // Disable weaving (for 1->1 and many->1)only if the classLoader
- // returns a NPE on loadClass()
- project.setWeavingEnabled(false);
- } catch (Exception exception){
- AbstractSessionLog.getLog().log(AbstractSessionLog.WARNING, "persistence_unit_processor_error_loading_class", exception.getClass().getName(), exception.getLocalizedMessage() , className);
- } catch (Error error){
- AbstractSessionLog.getLog().log(AbstractSessionLog.WARNING, "persistence_unit_processor_error_loading_class", error.getClass().getName(), error.getLocalizedMessage() , className);
- throw error;
- }
-
- return candidateClass;
- }
-
- /**
- * Process the Object/relational metadata from XML and annotations
- */
- public static void processORMetadata(MetadataProcessor processor, boolean throwExceptionOnFail) {
- // DO NOT CHANGE the order of invocation of various methods.
-
- // 1 - Load the list of mapping files for the persistence unit. Need to
- // do this before we start processing entities as the list of entity
- // classes depend on metadata read from mapping files.
- processor.loadMappingFiles(throwExceptionOnFail);
-
- // 2 - Process each XML entity mappings file metadata (except for
- // the actual classes themselves). This method is also responsible
- // for handling any XML merging.
- processor.processEntityMappings();
-
- // 3 - Process the persistence unit classes (from XML and annotations)
- // and their metadata now.
- processor.processORMMetadata();
- }
-
- /**
- * Go through the jar file for this PersistenceUnitProcessor and process any
- * XML provided in it.
- */
- public static List<SEPersistenceUnitInfo> processPersistenceArchive(Archive archive, ClassLoader loader){
- URL puRootURL = archive.getRootURL();
- try {
- // mkeith - if we have a URL use it
- InputStream pxmlStream = null;
- if (archive.getDescriptorStream() != null) {
- pxmlStream = archive.getDescriptorStream();
- } else {
- pxmlStream = archive.getEntry(PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML_DEFAULT);
- }
- return processPersistenceXML(puRootURL, pxmlStream, loader);
-// } catch (IOException e) {
- } catch (Exception e) {
- throw PersistenceUnitLoadingException.exceptionLoadingFromUrl(puRootURL.toString(), e);
- }
- }
-
- /**
- * Build a persistence.xml file into a SEPersistenceUnitInfo object.
- * May eventually change this to use OX mapping as well.
- */
- private static List<SEPersistenceUnitInfo> processPersistenceXML(URL baseURL, InputStream input, ClassLoader loader){
- SAXParserFactory spf = SAXParserFactory.newInstance();
- spf.setNamespaceAware(true);
-
- XMLReader xmlReader = null;
- SAXParser sp = null;
- XMLExceptionHandler xmlErrorHandler = new XMLExceptionHandler();
- // 247735 - remove the validation of XML.
-
- // create a SAX parser
- try {
- sp = spf.newSAXParser();
- } catch (javax.xml.parsers.ParserConfigurationException exc){
- throw XMLParseException.exceptionCreatingSAXParser(baseURL, exc);
- } catch (org.xml.sax.SAXException exc){
- throw XMLParseException.exceptionCreatingSAXParser(baseURL, exc);
- }
-
- // create an XMLReader
- try {
- xmlReader = sp.getXMLReader();
- xmlReader.setErrorHandler(xmlErrorHandler);
- } catch (org.xml.sax.SAXException exc){
- throw XMLParseException.exceptionCreatingXMLReader(baseURL, exc);
- }
-
- PersistenceContentHandler myContentHandler = new PersistenceContentHandler();
- xmlReader.setContentHandler(myContentHandler);
-
- InputSource inputSource = new InputSource(input);
- try{
- xmlReader.parse(inputSource);
- } catch (IOException exc){
- throw PersistenceUnitLoadingException.exceptionProcessingPersistenceXML(baseURL, exc);
- } catch (org.xml.sax.SAXException exc){
- // XMLErrorHandler will handle SAX exceptions
- }
-
- // handle any parse exceptions
- XMLException xmlError = xmlErrorHandler.getXMLException();
- if (xmlError != null) {
- throw PersistenceUnitLoadingException.exceptionProcessingPersistenceXML(baseURL, xmlError);
- }
-
- Iterator<SEPersistenceUnitInfo> persistenceInfos = myContentHandler.getPersistenceUnits().iterator();
- while (persistenceInfos.hasNext()){
- SEPersistenceUnitInfo info = persistenceInfos.next();
- info.setPersistenceUnitRootUrl(baseURL);
- }
- return myContentHandler.getPersistenceUnits();
- }
-
- /**
- * Build the unique persistence name by concatenating the decoded URL with the persistence unit name.
- * A decoded URL is required while persisting on a multi-bytes OS.
- * @param URL
- * @param puName
- * @return String
- */
- public static String buildPersistenceUnitName(URL url, String puName){
- String fullPuName = null;
- try {
- // append the persistence unit name to the decoded URL
- fullPuName = URLDecoder.decode(url.toString(), "UTF8")+"_"+puName;
- } catch (UnsupportedEncodingException e) {
- throw PersistenceUnitLoadingException.couldNotBuildPersistenceUntiName(e,url.toString(),puName);
- }
- return fullPuName;
- }
-
-}
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/URLArchive.java b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/URLArchive.java
deleted file mode 100644
index 1d17a82..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/internal/jpa/deployment/URLArchive.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * mkeith - Gemini JPA work (INCUBATION)
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.internal.jpa.deployment;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.gemini.jpa.GeminiUtil;
-import org.eclipse.persistence.jpa.Archive;
-
-/**
- * This is an implementation of {@link Archive} when container returns a url
- * that is not one of the familiar URL types like file or jar URLs. So, we can
- * not recursively walk thru' its hierarchy. As a result {@link #getEntries()}
- * returns an empty collection.
- *
- * @author Sanjeeb.Sahoo@Sun.COM
- */
-public class URLArchive implements Archive {
- /*
- * Implementation Note: This class does not have any dependency on either
- * EclipseLink or GlassFish implementation classes. Please retain this separation.
- */
-
- /**
- * The URL representation of this archive.
- */
- protected URL url;
-
- public URLArchive(URL url) {
- this.url = url;
- }
-
- // mkeith - not used right now
- public InputStream getDescriptorStream() { return null; }
- // mkeith - not used right now
- public URL getDescriptorURL() { return null; }
-
- public Iterator<String> getEntries() {
- return Collections.EMPTY_LIST.iterator();
- }
-
- public InputStream getEntry(String entryPath) throws IOException {
- URL subEntry = new URL(url, entryPath);
- InputStream is = null;
- try {
- is = subEntry.openStream();
- } catch (IOException ioe) {
- // we return null when entry does not exist
- }
- return is;
- }
-
- public URL getEntryAsURL(String entryPath) throws IOException {
- URL subEntry = new URL(url, entryPath);
- try {
- InputStream is = subEntry.openStream();
- if (is == null){
- return null;
- }
- is.close();
- } catch (IOException ioe) {
- return null; // return null when entry does not exist
- }
- return subEntry;
- }
-
- public URL getRootURL() {
- return url;
- }
-
- public void close() {
- // nothing to close. it's caller's responsibility to close
- // any InputStream returned by getEntry().
- }
-}
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/jpa/Archive.java b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/jpa/Archive.java
deleted file mode 100644
index 67daeef..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/jpa/Archive.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * mkeith - Gemini JPA work (INCUBATION)
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.jpa;
-
-import java.util.Iterator;
-import java.io.InputStream;
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.persistence.internal.jpa.deployment.ArchiveFactoryImpl;
-
-/**
- * Provides an abstraction to deal with various kinds of URLs that can
- * be returned by
- * {@link javax.persistence.spi.PersistenceUnitInfo#getPersistenceUnitRootUrl()}
- *
- * @see ArchiveFactoryImpl
- * @author Sanjeeb.Sahoo@Sun.COM
- */
-public interface Archive {
- /*
- * Implementation Note: This class does not have any dependency on either
- * EclipseLink or GlassFish implementation classes. Please retain this separation.
- */
-
- /**
- * Returns an {@link java.util.Iterator} of the file entries. Each String represents
- * a file name relative to the root of the module.
- */
- Iterator<String> getEntries();
-
- /**
- * Returns the InputStream for the given entry name. Returns null if no such
- * entry exists. The entry name must be relative to the root of the module.
- *
- * @param entryPath the file name relative to the root of the module.
- * @return the InputStream for the given entry name or null if not found.
- */
- InputStream getEntry(String entryPath) throws IOException;
-
- /**
- * Returns the URL for the given entry name. Returns null if no such
- * entry exists. The entry name must be relative to the root of the module.
- *
- * @param entryPath the file name relative to the root of the module.
- * @return the URL for the given entry name or null if not found.
- */
- URL getEntryAsURL(String entryPath) throws IOException;
-
- /**
- * @return the URL that this archive represents.
- */
- URL getRootURL();
-
- /**
- * @return the URL for the persistence descriptor.
- */
- URL getDescriptorURL();
-
- /**
- * @return an input stream on the persistence descriptor.
- */
- InputStream getDescriptorStream();
-
- /**
- * Close this archive and associated InputStream.
- */
- void close();
-}
-
diff --git a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/jpa/ArchiveFactory.java b/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/jpa/ArchiveFactory.java
deleted file mode 100644
index c0a5e5f..0000000
--- a/gemini-jpa/org.eclipse.persistence.incubator.geminijpa.jpa/src/org/eclipse/persistence/jpa/ArchiveFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * mkeith - Gemini JPA work (INCUBATION)
- *
- * This code is being developed under INCUBATION and is not currently included
- * in the automated EclipseLink build. The API in this code may change, or
- * may never be included in the product. Please provide feedback through mailing
- * lists or the bug database.
- ******************************************************************************/
-package org.eclipse.persistence.jpa;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-/**
- * This interface should be implemented by users that want to provide a custom way
- * of dealing with archives that contain persistence units. An implementer of this class
- * can be enabled by providing a System property
- *
- * @see org.eclipse.persistence.config.SystemProperties
- * @author tware
- *
- */
-public interface ArchiveFactory {
-
- /**
- * Return an instance of an implementer of Archive that can process the URL provided
- *
- * @throws URISyntaxException
- * @throws IOException
- */
- public Archive createArchive(URL rootUrl) throws URISyntaxException, IOException;
-
- public Archive createArchive(URL rootUrl, URL descriptorUrl) throws URISyntaxException, IOException;
-}
diff --git a/jpa-broker/trunk/org.eclipse.persistence.incubator.jpa.broker/readme.txt b/jpa-broker/trunk/org.eclipse.persistence.incubator.jpa.broker/readme.txt
deleted file mode 100644
index 2973c02..0000000
--- a/jpa-broker/trunk/org.eclipse.persistence.incubator.jpa.broker/readme.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-r6131 | dclarke | 2009-12-18 23:41:48 -0500 (Fri, 18 Dec 2009) | 1 line
-Changed paths:
- A /incubator/jpa-broker (from /incubators/jpa-broker:6130)
- D /incubators/jpa-broker
-
-
-------------------------------------------------------------------------
-r6130 | dclarke | 2009-12-18 23:36:13 -0500 (Fri, 18 Dec 2009) | 1 line
-Changed paths:
- A /incubators
- A /incubators/jpa-broker
- A /incubators/jpa-broker/trunk
- A /incubators/jpa-broker/trunk/org.eclipse.persistence.incubator.jpa.broker
-
-Share project "org.eclipse.persistence.incubator.jpa.broker" into "https://dclarke@dev.eclipse.org/svnroot/rt/org.eclipse.persistence"
diff --git a/summit-2010.zip b/summit-2010.zip
new file mode 100644
index 0000000..1704df8
--- /dev/null
+++ b/summit-2010.zip
Binary files differ
diff --git a/summit-2010/.project b/summit-2010/.project
deleted file mode 100644
index d11d657..0000000
--- a/summit-2010/.project
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>EclipseLink Summit</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- </buildSpec>
- <natures>
- </natures>
-</projectDescription>
diff --git a/summit-2010/Advanced-Cache.ppt b/summit-2010/Advanced-Cache.ppt
deleted file mode 100644
index 6340cb1..0000000
--- a/summit-2010/Advanced-Cache.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/AdvancedQueries.ppt b/summit-2010/AdvancedQueries.ppt
deleted file mode 100644
index 53b6bbd..0000000
--- a/summit-2010/AdvancedQueries.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/Architecture-MOXyAndSDO.ppt b/summit-2010/Architecture-MOXyAndSDO.ppt
deleted file mode 100644
index 12c6d4a..0000000
--- a/summit-2010/Architecture-MOXyAndSDO.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/Architecture-orm.ppt b/summit-2010/Architecture-orm.ppt
deleted file mode 100644
index 846aed5..0000000
--- a/summit-2010/Architecture-orm.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/CanonicalDemo/META-INF/eclipselink-orm.xml b/summit-2010/CanonicalDemo/META-INF/eclipselink-orm.xml
deleted file mode 100644
index b20c8be..0000000
--- a/summit-2010/CanonicalDemo/META-INF/eclipselink-orm.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<entity-mappings version="2.1" xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
- <package>model</package>
-
- <entity name="Employee" class="Employee" access="PROPERTY">
- <attributes>
- <id name="id">
- <column name="EMP_ID"/>
- </id>
- <basic-collection name="responsibilities">
- <value-column name="DESCRIPTION"/>
- <collection-table name="RESPONS"/>
- </basic-collection>
- <many-to-one name="address" target-entity="Address" fetch="LAZY">
- <join-column name="ADDR_ID"/>
- </many-to-one>
- <many-to-one name="manager" target-entity="Employee" fetch="LAZY">
- <join-column name="MANAGER_ID" referenced-column-name="EMP_ID"/>
- </many-to-one>
- <one-to-many name="phoneNumbers" target-entity="PhoneNumber" mapped-by="owner"/>
- <one-to-many name="managedEmployees" target-entity="Employee" mapped-by="manager"/>
- <many-to-many name="projects" target-entity="Project"/>
- <embedded name="period">
- <attribute-override name="startDate">
- <column name="START_DATE" nullable="false"/>
- </attribute-override>
- <attribute-override name="endDate">
- <column name="END_DATE" nullable="true"/>
- </attribute-override>
- </embedded>
- </attributes>
- </entity>
-
- <entity name="Address" class="Address" access="PROPERTY">
- <attributes>
- <id name="id">
- <column name="ADDRESS_ID"/>
- </id>
- <one-to-many name="employees" target-entity="Employee" mapped-by="address"/>
- </attributes>
- </entity>
-
- <entity name="PhoneNumber" class="PhoneNumber" access="PROPERTY">
- <id-class class="PhoneNumberPK"/>
- <attributes>
- <id name="id">
- <column name="OWNER_ID" insertable="false" updatable="false"/>
- </id>
- <id name="type">
- <column name="TYPE"/>
- </id>
- <basic name="number">
- <column name="NUMB"/>
- </basic>
- <many-to-one name="owner" target-entity="Employee">
- <join-column name="OWNER_ID" referenced-column-name="EMP_ID"/>
- </many-to-one>
- </attributes>
- </entity>
-
- <entity name="Project" class="Project" access="PROPERTY">
- <inheritance strategy="JOINED"/>
- <discriminator-value>P</discriminator-value>
- <attributes>
- <id name="id">
- <column name="PROJ_ID"/>
- </id>
- <one-to-one name="teamLeader" target-entity="Employee">
- <join-column name="LEADER_ID"/>
- </one-to-one>
- <many-to-many name="teamMembers" target-entity="Employee" mapped-by="projects"/>
- </attributes>
- </entity>
-
- <embeddable class="EmploymentPeriod" access="PROPERTY">
- <attributes>
- <basic name="startDate">
- <column name="S_DATE"/>
- </basic>
- <basic name="endDate">
- <column name="E_DATE"/>
- </basic>
- </attributes>
- </embeddable>
-
-</entity-mappings>
diff --git a/summit-2010/CanonicalDemo/META-INF/jpa-orm.xml b/summit-2010/CanonicalDemo/META-INF/jpa-orm.xml
deleted file mode 100644
index 2b6b092..0000000
--- a/summit-2010/CanonicalDemo/META-INF/jpa-orm.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<entity-mappings version="2.0" xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
- <package>model</package>
-
- <entity name="Employee" class="Employee" access="PROPERTY">
- <attributes>
- <id name="id">
- <column name="EMP_ID"/>
- </id>
- <element-collection name="responsibilities"/>
- <many-to-one name="address" target-entity="Address" fetch="LAZY">
- <join-column name="ADDR_ID"/>
- </many-to-one>
- <many-to-one name="manager" target-entity="Employee" fetch="LAZY">
- <join-column name="MANAGER_ID" referenced-column-name="EMP_ID"/>
- </many-to-one>
- <one-to-many name="phoneNumbers" target-entity="PhoneNumber" mapped-by="owner"/>
- <one-to-many name="managedEmployees" target-entity="Employee" mapped-by="manager"/>
- <many-to-many name="projects" target-entity="Project"/>
- <embedded name="period">
- <attribute-override name="startDate">
- <column name="START_DATE" nullable="false"/>
- </attribute-override>
- <attribute-override name="endDate">
- <column name="END_DATE" nullable="true"/>
- </attribute-override>
- </embedded>
- </attributes>
- </entity>
-
- <entity name="Address" class="Address" access="PROPERTY">
- <attributes>
- <id name="id">
- <column name="ADDRESS_ID"/>
- </id>
- <one-to-many name="employees" target-entity="Employee" mapped-by="address"/>
- </attributes>
- </entity>
-
- <entity name="PhoneNumber" class="PhoneNumber" access="PROPERTY">
- <id-class class="PhoneNumberPK"/>
- <attributes>
- <id name="id">
- <column name="OWNER_ID" insertable="false" updatable="false"/>
- </id>
- <id name="type">
- <column name="TYPE"/>
- </id>
- <basic name="number">
- <column name="NUMB"/>
- </basic>
- <many-to-one name="owner" target-entity="Employee">
- <join-column name="OWNER_ID" referenced-column-name="EMP_ID"/>
- </many-to-one>
- </attributes>
- </entity>
-
- <entity name="Project" class="Project" access="PROPERTY">
- <inheritance strategy="JOINED"/>
- <discriminator-value>P</discriminator-value>
- <attributes>
- <id name="id">
- <column name="PROJ_ID"/>
- </id>
- <one-to-one name="teamLeader" target-entity="Employee">
- <join-column name="LEADER_ID"/>
- </one-to-one>
- <many-to-many name="teamMembers" target-entity="Employee" mapped-by="projects"/>
- </attributes>
- </entity>
-
- <embeddable class="EmploymentPeriod" access="PROPERTY">
- <attributes>
- <basic name="startDate">
- <column name="S_DATE"/>
- </basic>
- <basic name="endDate">
- <column name="E_DATE"/>
- </basic>
- </attributes>
- </embeddable>
-
-</entity-mappings>
diff --git a/summit-2010/CanonicalDemo/META-INF/persistence.xml b/summit-2010/CanonicalDemo/META-INF/persistence.xml
deleted file mode 100644
index d6d61c7..0000000
--- a/summit-2010/CanonicalDemo/META-INF/persistence.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<persistence 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 persistence_2_0.xsd" version="2.0">
- <persistence-unit name="default" transaction-type="RESOURCE_LOCAL">
- <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
- <mapping-file>META-INF/jpa-orm.xml</mapping-file>
- <exclude-unlisted-classes>false</exclude-unlisted-classes>
- <properties>
- <property name="eclipselink.exclude-eclipselink-orm" value="true"/>
- </properties>
- </persistence-unit>
-</persistence>
\ No newline at end of file
diff --git a/summit-2010/CanonicalDemo/build.xml b/summit-2010/CanonicalDemo/build.xml
deleted file mode 100644
index aaaca28..0000000
--- a/summit-2010/CanonicalDemo/build.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-<project name="canonical.demo" default="compile-with-modelgen" basedir=".">
- <property name="env" environment="env" value="env"/>
-
- <echo message="modelgen.processor.jar='${modelgen.processor.jar}'"/>
-
- <target name="compile-with-modelgen">
- <copy todir="${jpatest.build.location}/${classes.dir}">
- <fileset dir="${jpatest.build.location}/${resource.dir}" includes="eclipselink-canonical-meta-model/persistence.xml"/>
- </copy>
- <!-- Copy to META-INF because IBM Compiler apparently is no longer recognizing -A (temporary) -->
- <copy todir="${jpatest.build.location}/${classes.dir}/META-INF">
- <fileset dir="${jpatest.build.location}/${resource.dir}/eclipselink-canonical-meta-model" includes="persistence.xml"/>
- </copy>
- <antcall target="model-compile" inheritRefs="true">
- <param name="SRC_PATH" value="${eclipselink.jpa.test}/${src.dir}"/>
- <param name="DEST_PATH" value="${eclipselink.jpa.test}/${classes.dir}"/>
- <param name="MODEL_PATH" value="org/eclipse/persistence/testing/models/jpa/advanced"/>
- <param name="PERSISTENCE_XML_PATH" value="eclipselink-canonical-meta-model/persistence.xml"/>
- <param name="COMPILE_PATH_REF" value="compile.modelgen.path"/>
- </antcall>
- <!-- This persistence.xml MUST be deleted because tests will pick it up otherwise and fail -->
- <delete dir="${jpatest.build.location}/${classes.dir}/META-INF"/>
- <available file="${jpatest.build.location}/${classes.dir}/org/eclipse/persistence/testing/models/jpa/advanced/Address_.class" property="modelgen.created.classes.exist"/>
- </target>
-
-</project>
diff --git a/summit-2010/CanonicalDemo/eclipselink.jar b/summit-2010/CanonicalDemo/eclipselink.jar
deleted file mode 100644
index 55017a6..0000000
--- a/summit-2010/CanonicalDemo/eclipselink.jar
+++ /dev/null
Binary files differ
diff --git a/summit-2010/CanonicalDemo/jpa.jar b/summit-2010/CanonicalDemo/jpa.jar
deleted file mode 100644
index dc968bf..0000000
--- a/summit-2010/CanonicalDemo/jpa.jar
+++ /dev/null
Binary files differ
diff --git a/summit-2010/CanonicalDemo/model/Address.java b/summit-2010/CanonicalDemo/model/Address.java
deleted file mode 100644
index 568f149..0000000
--- a/summit-2010/CanonicalDemo/model/Address.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package model;
-
-import java.io.Serializable;
-import javax.persistence.*;
-import static javax.persistence.GenerationType.*;
-import java.util.*;
-import static javax.persistence.CascadeType.*;
-
-@Table(name="ADDRESS")
-@NamedNativeQuery(
- name="findAllSQLAddresses",
- query="select * from CMP3_ANN_MERGE_ADDRESS",
- resultClass=Address.class
-)
-@NamedQuery(
- name="findAllAddressesByPostalCode",
- query="SELECT OBJECT(address) FROM Address address WHERE address.postalCode = :postalcode"
-)
-public class Address implements Serializable {
- private Integer id;
- private String street;
- private String city;
- private String province;
- private String postalCode;
- private String country;
- private Collection<Employee> employees;
-
- public Address() {
- city = "";
- province = "";
- postalCode = "";
- street = "";
- country = "";
- this.employees = new Vector<Employee>();
- }
-
- public Address(String street, String city, String province, String country, String postalCode) {
- this.street = street;
- this.city = city;
- this.province = province;
- this.country = country;
- this.postalCode = postalCode;
- this.employees = new Vector<Employee>();
- }
-
- public String getCity() {
- return city;
- }
-
- public String getCountry() {
- return country;
- }
-
- public Collection<Employee> getEmployees() {
- return employees;
- }
-
- public Integer getId() {
- return id;
- }
-
- @Column(name="P_CODE")
- public String getPostalCode() {
- return postalCode;
- }
-
- public String getProvince() {
- return province;
- }
-
- public String getStreet() {
- return street;
- }
-
- public void setEmployees(Collection<Employee> employees) {
- this.employees = employees;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- public void setCity(String city) {
- this.city = city;
- }
-
- public void setCountry(String country) {
- this.country = country;
- }
-
- public void setPostalCode(String postalCode) {
- this.postalCode = postalCode;
- }
-
- public void setProvince(String province) {
- this.province = province;
- }
-
- public void setStreet(String street) {
- this.street = street;
- }
-}
diff --git a/summit-2010/CanonicalDemo/model/Employee.java b/summit-2010/CanonicalDemo/model/Employee.java
deleted file mode 100644
index d95cba9..0000000
--- a/summit-2010/CanonicalDemo/model/Employee.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package model;
-
-import java.util.*;
-import java.io.Serializable;
-import javax.persistence.*;
-import static javax.persistence.GenerationType.*;
-import static javax.persistence.CascadeType.*;
-import static javax.persistence.FetchType.*;
-
-@EntityListeners(EmployeeListener.class)
-@Table(name="EMPLOYEE")
-@SecondaryTable(name="SALARY")
-@PrimaryKeyJoinColumn(name="EMP_ID", referencedColumnName="EMP_ID")
-@NamedQueries({
- @NamedQuery(
- name="findAllEmployeesByFirstName",
- query="SELECT OBJECT(employee) FROM Employee employee WHERE employee.firstName = :firstname"
- ),
- @NamedQuery(
- name="constuctEmployees",
- query="SELECT new Employee(employee.firstName, employee.lastName) FROM Employee employee")
-}
-)
-public class Employee implements Serializable {
- private int salary;
- private int version;
-
- private Integer id;
-
- private String firstName;
- private String lastName;
-
- private Collection<PhoneNumber> phoneNumbers;
- private Collection<Project> projects;
- private Collection<Employee> managedEmployees;
- private Collection<String> responsibilities;
-
- private Address address;
- private EmploymentPeriod period;
-
- private Employee manager;
-
- public Employee () {}
-
- public Address getAddress() {
- return address;
- }
-
- @Column(name="F_NAME")
- public String getFirstName() {
- return firstName;
- }
-
- @Transient
- public String getLastName() {
- return lastName;
- }
-
- public Integer getId() {
- return id;
- }
-
- public Collection<Employee> getManagedEmployees() {
- return managedEmployees;
- }
-
- @ManyToOne(cascade=PERSIST, fetch=LAZY)
- public Employee getManager() {
- return manager;
- }
-
- public EmploymentPeriod getPeriod() {
- return period;
- }
-
- public Collection<PhoneNumber> getPhoneNumbers() {
- return phoneNumbers;
- }
-
- public Collection<Project> getProjects() {
- return projects;
- }
-
- public Collection<String> getResponsibilities() {
- return responsibilities;
- }
-
- @Column(table="SALARY")
- public int getSalary() {
- return salary;
- }
-
- @Version
- @Column(name="VERSION")
- public int getVersion() {
- return version;
- }
-
- public void setAddress(Address address) {
- this.address = address;
- }
-
- public void setFirstName(String name) {
- this.firstName = name;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- public void setLastName(String name) {
- this.lastName = name;
- }
-
- public void setManagedEmployees(Collection<Employee> managedEmployees) {
- this.managedEmployees = managedEmployees;
- }
-
- public void setManager(Employee manager) {
- this.manager = manager;
- }
-
- public void setPeriod(EmploymentPeriod period) {
- this.period = period;
- }
-
- public void setPhoneNumbers(Collection<PhoneNumber> phoneNumbers) {
- this.phoneNumbers = phoneNumbers;
- }
-
- public void setProjects(Collection<Project> projects) {
- this.projects = projects;
- }
-
- public void setResponsibilities(Collection<String> responsibilities) {
- this.responsibilities = responsibilities;
- }
-
- public void setSalary(int salary) {
- this.salary = salary;
- }
-
- protected void setVersion(int version) {
- this.version = version;
- }
-}
diff --git a/summit-2010/CanonicalDemo/model/EmployeeListener.java b/summit-2010/CanonicalDemo/model/EmployeeListener.java
deleted file mode 100644
index bd89f92..0000000
--- a/summit-2010/CanonicalDemo/model/EmployeeListener.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package model;
-
-import javax.persistence.*;
-import java.util.EventListener;
-
-public class EmployeeListener implements EventListener {
- public static int PRE_PERSIST_COUNT = 0;
- public static int POST_PERSIST_COUNT = 0;
- public static int PRE_REMOVE_COUNT = 0;
- public static int POST_REMOVE_COUNT = 0;
- public static int PRE_UPDATE_COUNT = 0;
- public static int POST_UPDATE_COUNT = 0;
- public static int POST_LOAD_COUNT = 0;
-
- public static String PRE_UPDATE_NAME_PREFIX = "PRE_UPDATE_NAME_PREFIX";
-
- @PrePersist
- public void prePersist(Object emp) {
- PRE_PERSIST_COUNT++;
- }
-
- @PreRemove
- public void preRemove(Object emp) {
- PRE_REMOVE_COUNT++;
- }
-
- @PreUpdate
- public void preUpdate(Object emp) {
- PRE_UPDATE_COUNT++;
- Employee employee = (Employee)emp;
- if(employee.getFirstName() != null && employee.getFirstName().startsWith(PRE_UPDATE_NAME_PREFIX)) {
- employee.setFirstName(employee.getFirstName().substring(PRE_UPDATE_NAME_PREFIX.length()));
- }
- if(employee.getLastName() != null && employee.getLastName().startsWith(PRE_UPDATE_NAME_PREFIX)) {
- employee.setLastName(employee.getLastName().substring(PRE_UPDATE_NAME_PREFIX.length()));
- }
- }
-
- @PostLoad
- public void postLoad(Employee emp) {
- POST_LOAD_COUNT++;
- }
-
- @PostPersist
- public void postPersist(Object emp) {
- POST_PERSIST_COUNT++;
- }
-
- @PostRemove
- public void postRemove(Object emp) {
- POST_REMOVE_COUNT++;
- }
-
- @PostUpdate
- public void postUpdate(Object emp) {
- POST_UPDATE_COUNT++;
- }
-}
diff --git a/summit-2010/CanonicalDemo/model/EmploymentPeriod.java b/summit-2010/CanonicalDemo/model/EmploymentPeriod.java
deleted file mode 100644
index 83a7833..0000000
--- a/summit-2010/CanonicalDemo/model/EmploymentPeriod.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package model;
-
-import java.sql.Date;
-import java.io.*;
-import javax.persistence.*;
-
-public class EmploymentPeriod implements Serializable {
- private Date startDate;
- private Date endDate;
-
- public EmploymentPeriod() {}
-
- public Date getEndDate() {
- return endDate;
- }
-
- public Date getStartDate() {
- return startDate;
- }
-
- public void setEndDate(Date date) {
- this.endDate = date;
- }
-
- public void setStartDate(Date date) {
- this.startDate = date;
- }
-}
diff --git a/summit-2010/CanonicalDemo/model/LargeProject.java b/summit-2010/CanonicalDemo/model/LargeProject.java
deleted file mode 100644
index 416317a..0000000
--- a/summit-2010/CanonicalDemo/model/LargeProject.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package model;
-
-import javax.persistence.*;
-
-@Entity(name="LargeProject")
-@Table(name="LPROJECT")
-@DiscriminatorValue("1")
-@NamedQuery(
- name="findWithBudgetLargerThan",
- query="SELECT OBJECT(project) FROM LargeProject project WHERE project.budget >= :amount"
-)
-public class LargeProject extends Project {
- private double budget;
-
- public double getBudget() {
- return budget;
- }
-
- public void setBudget(double budget) {
- this.budget = budget;
- }
-}
diff --git a/summit-2010/CanonicalDemo/model/PhoneNumber.java b/summit-2010/CanonicalDemo/model/PhoneNumber.java
deleted file mode 100644
index 4b74434..0000000
--- a/summit-2010/CanonicalDemo/model/PhoneNumber.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package model;
-
-import java.io.*;
-import javax.persistence.*;
-
-@Table(name="PHONENUMBER")
-public class PhoneNumber implements Serializable {
- private String number;
- private String type;
- private Employee owner;
- private Integer id;
- private String areaCode;
-
- public PhoneNumber() {
- this("", "###", "#######");
- }
-
- public PhoneNumber(String type, String theAreaCode, String theNumber) {
- this.type = type;
- this.areaCode = theAreaCode;
- this.number = theNumber;
- this.owner = null;
- }
-
- public PhoneNumberPK buildPK(){
- PhoneNumberPK pk = new PhoneNumberPK();
- pk.setId(this.getOwner().getId());
- pk.setType(this.getType());
- return pk;
- }
-
- @Column(name="AREA_CODE")
- public String getAreaCode() {
- return areaCode;
- }
-
- public Integer getId() {
- return id;
- }
-
- public String getNumber() {
- return number;
- }
-
- public Employee getOwner() {
- return owner;
- }
-
- public String getType() {
- return type;
- }
-
- public void setAreaCode(String areaCode) {
- this.areaCode = areaCode;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- public void setNumber(String number) {
- this.number = number;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public void setOwner(Employee owner) {
- this.owner = owner;
- }
-}
diff --git a/summit-2010/CanonicalDemo/model/PhoneNumberPK.java b/summit-2010/CanonicalDemo/model/PhoneNumberPK.java
deleted file mode 100644
index 97a35e1..0000000
--- a/summit-2010/CanonicalDemo/model/PhoneNumberPK.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package model;
-
-public class PhoneNumberPK {
- public Integer id;
- public String type;
-
- public PhoneNumberPK() {}
-
- public Integer getId() {
- return id;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public boolean equals(Object anotherPhoneNumber) {
- if (anotherPhoneNumber.getClass() != PhoneNumberPK.class) {
- return false;
- }
- return (getId().equals(((PhoneNumberPK)anotherPhoneNumber).getId()));
- }
-}
diff --git a/summit-2010/CanonicalDemo/model/Project.java b/summit-2010/CanonicalDemo/model/Project.java
deleted file mode 100644
index 5fd6015..0000000
--- a/summit-2010/CanonicalDemo/model/Project.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package model;
-
-import java.util.*;
-import java.io.Serializable;
-import javax.persistence.*;
-import static javax.persistence.GenerationType.*;
-import static javax.persistence.InheritanceType.*;
-import static javax.persistence.DiscriminatorType.*;
-
-
-@Table(name="PROJECT")
-@DiscriminatorColumn(name="PROJ_TYPE", discriminatorType=INTEGER)
-@DiscriminatorValue("0")
-@NamedQuery(
- name="findProjectByName",
- query="SELECT OBJECT(project) FROM Project project WHERE project.name = :name"
-)
-public class Project implements Serializable {
- public int pre_update_count = 0;
- public int post_update_count = 0;
- public int pre_remove_count = 0;
- public int post_remove_count = 0;
- public int pre_persist_count = 0;
- public int post_persist_count = 0;
- public int post_load_count = 0;
-
- private Integer id;
- private int version;
- private String name;
- private String description;
- private Employee teamLeader;
- private Collection<Employee> teamMembers;
-
- public Project () {}
-
- @Column(name="DESCRIP")
- public String getDescription() {
- return description;
- }
-
- public Integer getId() {
- return id;
- }
-
- @Basic
- public String getName() {
- return name;
- }
-
- @Version
- public int getVersion() {
- return version;
- }
-
- public Employee getTeamLeader() {
- return teamLeader;
- }
-
- public Collection<Employee> getTeamMembers() {
- return teamMembers;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- protected void setVersion(int version) {
- this.version = version;
- }
-
- public void setTeamLeader(Employee teamLeader) {
- this.teamLeader = teamLeader;
- }
-
- public void setTeamMembers(Collection<Employee> employees) {
- this.teamMembers = employees;
- }
-
- @PrePersist
- public void prePersist() {
- ++pre_persist_count;
- }
-
- @PreRemove
- public void preRemove() {
- ++pre_remove_count;
- }
-
- @PreUpdate
- public void preUpdate() {
- ++pre_update_count;
- }
-
- @PostLoad
- public void postLoad() {
- ++post_load_count;
- }
-
- @PostPersist
- public void postPersist() {
- ++post_persist_count;
- }
-
- @PostRemove
- public void postRemove() {
- ++post_remove_count;
- }
-
- @PostUpdate
- public void postUpdate() {
- ++post_update_count;
- }
-}
diff --git a/summit-2010/CanonicalDemo/model/SmallProject.java b/summit-2010/CanonicalDemo/model/SmallProject.java
deleted file mode 100644
index 741c0cb..0000000
--- a/summit-2010/CanonicalDemo/model/SmallProject.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package model;
-
-import javax.persistence.*;
-
-@Entity(name="SmallProject")
-@DiscriminatorValue("2")
-public class SmallProject extends Project {
-}
diff --git a/summit-2010/CanonicalDemo/qualifier.jar b/summit-2010/CanonicalDemo/qualifier.jar
deleted file mode 100644
index 18dc44d..0000000
--- a/summit-2010/CanonicalDemo/qualifier.jar
+++ /dev/null
Binary files differ
diff --git a/summit-2010/CanonicalDemo/runDefault.bat b/summit-2010/CanonicalDemo/runDefault.bat
deleted file mode 100644
index d31eeb7..0000000
--- a/summit-2010/CanonicalDemo/runDefault.bat
+++ /dev/null
@@ -1,6 +0,0 @@
-
-REM Demo with no extra settings (default)
-
-javac -classpath .;eclipselink.jar;jpa.jar;qualifier.jar -proc:only -s generated model/*.java
-
-pause
\ No newline at end of file
diff --git a/summit-2010/CanonicalDemo/runDefaultWithProperty.bat b/summit-2010/CanonicalDemo/runDefaultWithProperty.bat
deleted file mode 100644
index 70ee623..0000000
--- a/summit-2010/CanonicalDemo/runDefaultWithProperty.bat
+++ /dev/null
@@ -1,6 +0,0 @@
-
-REM Demo setting the prefix to $
-
-javac -classpath .;eclipselink.jar;jpa.jar;qualifier.jar -s generated -proc:only -Aeclipselink.canonicalmodel.prefix=$ model/*.java
-
-pause
diff --git a/summit-2010/CanonicalDemo/runPersistenceXML.bat b/summit-2010/CanonicalDemo/runPersistenceXML.bat
deleted file mode 100644
index 50c3c6f..0000000
--- a/summit-2010/CanonicalDemo/runPersistenceXML.bat
+++ /dev/null
@@ -1,6 +0,0 @@
-
-REM Demo using different persistence.xml location with properties set in persistence.xml
-
-javac -processor org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor -classpath .;eclipselink.jar;jpa.jar -s generated -Aeclipselink.persistencexml=./xml/persistence.xml model/*.java
-
-pause
\ No newline at end of file
diff --git a/summit-2010/CanonicalDemo/xml/persistence.xml b/summit-2010/CanonicalDemo/xml/persistence.xml
deleted file mode 100644
index ae9e120..0000000
--- a/summit-2010/CanonicalDemo/xml/persistence.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<persistence 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 persistence_1_0.xsd" version="1.0">
- <persistence-unit name="default" transaction-type="RESOURCE_LOCAL">
- <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
- <exclude-unlisted-classes>false</exclude-unlisted-classes>
- <properties>
- <property name="eclipselink.canonicalmodel.prefix" value="_"/>
- <property name="eclipselink.canonicalmodel.suffix" value="$"/>
- <property name="eclipselink.canonicalmodel.subpackage" value="sub"/>
- </properties>
- </persistence-unit>
-</persistence>
\ No newline at end of file
diff --git a/summit-2010/CanonicalModelGen.ppt b/summit-2010/CanonicalModelGen.ppt
deleted file mode 100644
index 5a6616f..0000000
--- a/summit-2010/CanonicalModelGen.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/Customizing.ppt b/summit-2010/Customizing.ppt
deleted file mode 100644
index f3a420a..0000000
--- a/summit-2010/Customizing.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/Diagrams.ppt b/summit-2010/Diagrams.ppt
deleted file mode 100644
index 5bafe4d..0000000
--- a/summit-2010/Diagrams.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/Dynamic Persistence.ppt b/summit-2010/Dynamic Persistence.ppt
deleted file mode 100644
index ac6f0dd..0000000
--- a/summit-2010/Dynamic Persistence.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/EclipseLink-Documentation.odp b/summit-2010/EclipseLink-Documentation.odp
deleted file mode 100644
index 5d7a787..0000000
--- a/summit-2010/EclipseLink-Documentation.odp
+++ /dev/null
Binary files differ
diff --git a/summit-2010/EclipseLink-OSGi.ppt b/summit-2010/EclipseLink-OSGi.ppt
deleted file mode 100644
index 0518d05..0000000
--- a/summit-2010/EclipseLink-OSGi.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/EclipseLink-Testing.ppt b/summit-2010/EclipseLink-Testing.ppt
deleted file mode 100644
index b48e543..0000000
--- a/summit-2010/EclipseLink-Testing.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/EclipseLink-Weaving.ppt b/summit-2010/EclipseLink-Weaving.ppt
deleted file mode 100644
index 10115af..0000000
--- a/summit-2010/EclipseLink-Weaving.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/EclipseLink_Build.ppt b/summit-2010/EclipseLink_Build.ppt
deleted file mode 100644
index 1320ede..0000000
--- a/summit-2010/EclipseLink_Build.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/EclipseLink_Intro_Cache.ppt b/summit-2010/EclipseLink_Intro_Cache.ppt
deleted file mode 100644
index 493d201..0000000
--- a/summit-2010/EclipseLink_Intro_Cache.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/EclipseLink_JPA2_Metamodel.ppt b/summit-2010/EclipseLink_JPA2_Metamodel.ppt
deleted file mode 100644
index 4224ad2..0000000
--- a/summit-2010/EclipseLink_JPA2_Metamodel.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/EclipseLink_Project_Overview.ppt b/summit-2010/EclipseLink_Project_Overview.ppt
deleted file mode 100644
index 9df43c9..0000000
--- a/summit-2010/EclipseLink_Project_Overview.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/EclipseLink_Summit.pot b/summit-2010/EclipseLink_Summit.pot
deleted file mode 100644
index 03e6110..0000000
--- a/summit-2010/EclipseLink_Summit.pot
+++ /dev/null
Binary files differ
diff --git a/summit-2010/MappingsAndMetadata.ppt b/summit-2010/MappingsAndMetadata.ppt
deleted file mode 100644
index 64e8f52..0000000
--- a/summit-2010/MappingsAndMetadata.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/Persistence Tooling.ppt b/summit-2010/Persistence Tooling.ppt
deleted file mode 100644
index 3e5d5be..0000000
--- a/summit-2010/Persistence Tooling.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/Process.ppt b/summit-2010/Process.ppt
deleted file mode 100644
index abd028e..0000000
--- a/summit-2010/Process.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/Queries and Object Building.ppt b/summit-2010/Queries and Object Building.ppt
deleted file mode 100644
index b1e21ee..0000000
--- a/summit-2010/Queries and Object Building.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/RoadMap.ppt b/summit-2010/RoadMap.ppt
deleted file mode 100644
index 66676d8..0000000
--- a/summit-2010/RoadMap.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/Transactions.ppt b/summit-2010/Transactions.ppt
deleted file mode 100644
index 5d686cd..0000000
--- a/summit-2010/Transactions.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/WeavingExamples/PhoneNumber-annotated.java b/summit-2010/WeavingExamples/PhoneNumber-annotated.java
deleted file mode 100644
index 45e51d1..0000000
--- a/summit-2010/WeavingExamples/PhoneNumber-annotated.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation from Oracle TopLink
- ******************************************************************************/
-package org.eclipse.persistence.testing.models.jpa.advanced;
-
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Vector;
-
-
-import org.eclipse.persistence.annotations.CollectionTable;
-import org.eclipse.persistence.annotations.BasicCollection;
-import javax.persistence.*;
-import static javax.persistence.EnumType.STRING;
-/**
- * <p><b>Purpose</b>: Describes an Employee's phone number.
- * <p><b>Description</b>: Used in a 1:M relationship from an employee.
- */
-@IdClass(org.eclipse.persistence.testing.models.jpa.advanced.PhoneNumberPK.class)
-@Entity
-@Table(name="CMP3_PHONENUMBER")
-public class PhoneNumber implements Serializable {
- public enum PhoneStatus { ACTIVE, ASSIGNED, UNASSIGNED, DEAD }
-
- private String number;
- private String type;
- private Employee owner;
- private Integer id;
- private String areaCode;
-
- private Collection<PhoneStatus> status;
-
- public PhoneNumber() {
- this("", "###", "#######");
- }
-
- public PhoneNumber(String type, String theAreaCode, String theNumber) {
- this.type = type;
- this.areaCode = theAreaCode;
- this.number = theNumber;
- this.owner = null;
- this.status = new Vector<PhoneStatus>();
- }
-
- public void addStatus(PhoneStatus status) {
- getStatus().add(status);
- }
-
- @Id
- @Column(name="OWNER_ID", insertable=false, updatable=false)
- public Integer getId() {
- return id;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- @Column(name="NUMB")
- public String getNumber() {
- return number;
- }
-
- public void setNumber(String number) {
- this.number = number;
- }
-
- // Basic collection on an entity that uses a composite primary key.
- // We don't specify any of the primary key join columns on the collection
- // table because they should all default accordingly.
- @BasicCollection
- @CollectionTable(name="CMP3_PHONE_STATUS")
- @Enumerated(STRING)
- public Collection<PhoneStatus> getStatus() {
- return status;
- }
-
- public void setStatus(Collection<PhoneStatus> status) {
- this.status = status;
- }
-
- @Id
- @Column(name="TYPE")
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- @Column(name="AREA_CODE")
- public String getAreaCode() {
- return areaCode;
- }
-
- public void setAreaCode(String areaCode) {
- this.areaCode = areaCode;
- }
-
- @ManyToOne
- @JoinColumn(name="OWNER_ID", referencedColumnName="EMP_ID")
- public Employee getOwner() {
- return owner;
- }
-
- public void setOwner(Employee owner) {
- this.owner = owner;
- }
-
- public void removeStatus(PhoneStatus status) {
- getStatus().remove(status);
- }
-
- /**
- * Example: Phone[Work]: (613) 225-8812
- */
- public String toString() {
- StringWriter writer = new StringWriter();
-
- writer.write("PhoneNumber[");
- writer.write(getType());
- writer.write("]: (");
- writer.write(getAreaCode());
- writer.write(") ");
-
- int numberLength = this.getNumber().length();
- writer.write(getNumber().substring(0, Math.min(3, numberLength)));
- if (numberLength > 3) {
- writer.write("-");
- writer.write(getNumber().substring(3, Math.min(7, numberLength)));
- }
-
- return writer.toString();
- }
-
- /**
- * Builds the PhoneNumberPK for this class
- */
- public PhoneNumberPK buildPK(){
- PhoneNumberPK pk = new PhoneNumberPK();
- pk.setId(this.getOwner().getId());
- pk.setType(this.getType());
- return pk;
- }
-}
diff --git a/summit-2010/WeavingExamples/PhoneNumber-changetracking.java b/summit-2010/WeavingExamples/PhoneNumber-changetracking.java
deleted file mode 100644
index 457f78b..0000000
--- a/summit-2010/WeavingExamples/PhoneNumber-changetracking.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.eclipse.persistence.testing.models.jpa.advanced;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Vector;
-import org.eclipse.persistence.descriptors.changetracking.ChangeTracker;
-import org.eclipse.persistence.internal.weaving.PersistenceWeaved;
-import org.eclipse.persistence.internal.weaving.PersistenceWeavedChangeTracking;
-
-// Referenced classes of package org.eclipse.persistence.testing.models.jpa.advanced:
-// PhoneNumberPK, Employee
-
-public class PhoneNumber
- implements Serializable, PersistenceWeaved, ChangeTracker, PersistenceWeavedChangeTracking
-{
- /* member class not found */
- class PhoneStatus {}
-
-
- private String number;
- private String type;
- private Employee owner;
- private String areaCode;
- private Collection status;
- protected transient PropertyChangeListener _persistence_listener;
-
- public PhoneNumber()
- {
- this("", "###", "#######");
- }
-
- public PhoneNumber(String type, String theAreaCode, String theNumber)
- {
- this.type = type;
- areaCode = theAreaCode;
- number = theNumber;
- owner = null;
- status = new Vector();
- }
-
- public void addStatus(PhoneStatus status)
- {
- getStatus().add(status);
- }
-
- public String getNumber()
- {
- return number;
- }
-
- public void setNumber(String number)
- {
- String s = getNumber();
- this.number = number;
- _persistence_propertyChange("number", s, number);
- }
-
- public Collection getStatus()
- {
- return status;
- }
-
- public void setStatus(Collection status)
- {
- Collection collection = getStatus();
- this.status = status;
- _persistence_propertyChange("status", collection, status);
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- String s = getType();
- this.type = type;
- _persistence_propertyChange("type", s, type);
- }
-
- public String getAreaCode()
- {
- return areaCode;
- }
-
- public void setAreaCode(String areaCode)
- {
- String s = getAreaCode();
- this.areaCode = areaCode;
- _persistence_propertyChange("areaCode", s, areaCode);
- }
-
- public Employee getOwner()
- {
- return owner;
- }
-
- public void setOwner(Employee owner)
- {
- Employee employee = getOwner();
- this.owner = owner;
- _persistence_propertyChange("owner", employee, owner);
- }
-
- public void removeStatus(PhoneStatus status)
- {
- getStatus().remove(status);
- }
-
- public List buildPK()
- {
- List pk = new Vector();
- pk.add(getOwner().getId());
- pk.add(getType());
- return pk;
- }
-
- public String toString()
- {
- StringWriter writer = new StringWriter();
- writer.write("PhoneNumber[");
- writer.write(getType());
- writer.write("]: (");
- writer.write(getAreaCode());
- writer.write(") ");
- int numberLength = getNumber().length();
- writer.write(getNumber().substring(0, Math.min(3, numberLength)));
- if(numberLength > 3)
- {
- writer.write("-");
- writer.write(getNumber().substring(3, Math.min(7, numberLength)));
- }
- return writer.toString();
- }
-
- public PropertyChangeListener _persistence_getPropertyChangeListener()
- {
- return _persistence_listener;
- }
-
- public void _persistence_setPropertyChangeListener(PropertyChangeListener propertychangelistener)
- {
- _persistence_listener = propertychangelistener;
- }
-
- public void _persistence_propertyChange(String s, Object obj, Object obj1)
- {
- if(_persistence_listener != null && obj != obj1)
- {
- _persistence_listener.propertyChange(new PropertyChangeEvent(this, s, obj, obj1));
- }
- }
-}
diff --git a/summit-2010/WeavingExamples/PhoneNumber-fetchgroup.java b/summit-2010/WeavingExamples/PhoneNumber-fetchgroup.java
deleted file mode 100644
index fd8a02b..0000000
--- a/summit-2010/WeavingExamples/PhoneNumber-fetchgroup.java
+++ /dev/null
@@ -1,184 +0,0 @@
-package org.eclipse.persistence.testing.models.jpa.advanced;
-
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Vector;
-import org.eclipse.persistence.internal.weaving.PersistenceWeaved;
-import org.eclipse.persistence.internal.weaving.PersistenceWeavedFetchGroups;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.eclipse.persistence.sessions.Session;
-
-// Referenced classes of package org.eclipse.persistence.testing.models.jpa.advanced:
-// PhoneNumberPK, Employee
-
-public class PhoneNumber
- implements Serializable, PersistenceWeaved, FetchGroupTracker, PersistenceWeavedFetchGroups
-{
- /* member class not found */
- class PhoneStatus {}
-
-
- private String number;
- private String type;
- private Employee owner;
- private String areaCode;
- private Collection status;
- protected transient FetchGroup _persistence_fetchGroup;
- protected transient boolean _persistence_shouldRefreshFetchGroup;
- protected transient Session _persistence_session;
-
- public PhoneNumber()
- {
- this("", "###", "#######");
- }
-
- public PhoneNumber(String type, String theAreaCode, String theNumber)
- {
- this.type = type;
- areaCode = theAreaCode;
- number = theNumber;
- owner = null;
- status = new Vector();
- }
-
- public void addStatus(PhoneStatus status)
- {
- getStatus().add(status);
- }
-
- public String getNumber()
- {
- _persistence_checkFetched("number");
- return number;
- }
-
- public void setNumber(String number)
- {
- this.number = number;
- }
-
- public Collection getStatus()
- {
- _persistence_checkFetched("status");
- return status;
- }
-
- public void setStatus(Collection status)
- {
- this.status = status;
- }
-
- public String getType()
- {
- _persistence_checkFetched("type");
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public String getAreaCode()
- {
- _persistence_checkFetched("areaCode");
- return areaCode;
- }
-
- public void setAreaCode(String areaCode)
- {
- this.areaCode = areaCode;
- }
-
- public Employee getOwner()
- {
- _persistence_checkFetched("owner");
- return owner;
- }
-
- public void setOwner(Employee owner)
- {
- this.owner = owner;
- }
-
- public void removeStatus(PhoneStatus status)
- {
- getStatus().remove(status);
- }
-
- public List buildPK()
- {
- List pk = new Vector();
- pk.add(getOwner().getId());
- pk.add(getType());
- return pk;
- }
-
- public String toString()
- {
- StringWriter writer = new StringWriter();
- writer.write("PhoneNumber[");
- writer.write(getType());
- writer.write("]: (");
- writer.write(getAreaCode());
- writer.write(") ");
- int numberLength = getNumber().length();
- writer.write(getNumber().substring(0, Math.min(3, numberLength)));
- if(numberLength > 3)
- {
- writer.write("-");
- writer.write(getNumber().substring(3, Math.min(7, numberLength)));
- }
- return writer.toString();
- }
-
- public Session _persistence_getSession()
- {
- return _persistence_session;
- }
-
- public void _persistence_setSession(Session session)
- {
- _persistence_session = session;
- }
-
- public FetchGroup _persistence_getFetchGroup()
- {
- return _persistence_fetchGroup;
- }
-
- public void _persistence_setFetchGroup(FetchGroup fetchgroup)
- {
- _persistence_fetchGroup = fetchgroup;
- }
-
- public boolean _persistence_shouldRefreshFetchGroup()
- {
- return _persistence_shouldRefreshFetchGroup;
- }
-
- public void _persistence_setShouldRefreshFetchGroup(boolean flag)
- {
- _persistence_shouldRefreshFetchGroup = flag;
- }
-
- public void _persistence_resetFetchGroup()
- {
- }
-
- public boolean _persistence_isAttributeFetched(String s)
- {
- return _persistence_fetchGroup == null || _persistence_fetchGroup.containsAttribute(s);
- }
-
- public void _persistence_checkFetched(String s)
- {
- if(!_persistence_isAttributeFetched(s))
- {
- JpaHelper.loadUnfetchedObject(this);
- }
- }
-}
diff --git a/summit-2010/WeavingExamples/PhoneNumber-fully-weaved.java b/summit-2010/WeavingExamples/PhoneNumber-fully-weaved.java
deleted file mode 100644
index 027ad56..0000000
--- a/summit-2010/WeavingExamples/PhoneNumber-fully-weaved.java
+++ /dev/null
@@ -1,447 +0,0 @@
-package org.eclipse.persistence.testing.models.jpa.advanced;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Vector;
-import org.eclipse.persistence.descriptors.changetracking.ChangeTracker;
-import org.eclipse.persistence.indirection.ValueHolder;
-import org.eclipse.persistence.indirection.WeavedAttributeValueHolderInterface;
-import org.eclipse.persistence.internal.descriptors.PersistenceEntity;
-import org.eclipse.persistence.internal.descriptors.PersistenceObject;
-import org.eclipse.persistence.internal.weaving.*;
-import org.eclipse.persistence.jpa.JpaHelper;
-import org.eclipse.persistence.queries.FetchGroup;
-import org.eclipse.persistence.queries.FetchGroupTracker;
-import org.eclipse.persistence.sessions.Session;
-
-// Referenced classes of package org.eclipse.persistence.testing.models.jpa.advanced:
-// PhoneNumberPK, Employee
-
-public class PhoneNumber
- implements Serializable, Cloneable, PersistenceWeaved, PersistenceEntity, PersistenceObject, FetchGroupTracker, PersistenceWeavedFetchGroups, PersistenceWeavedLazy, ChangeTracker, PersistenceWeavedChangeTracking
-{
- /* member class not found */
- class PhoneStatus {}
-
-
- private String number;
- private String type;
- private Employee owner;
- private Integer id;
- private String areaCode;
- private Collection status;
- public static final long serialVersionUID = 0x120adfdddd107d7bL;
- protected transient Object _persistence_primaryKey;
- protected WeavedAttributeValueHolderInterface _persistence_owner_vh;
- protected transient PropertyChangeListener _persistence_listener;
- protected transient FetchGroup _persistence_fetchGroup;
- protected transient boolean _persistence_shouldRefreshFetchGroup;
- protected transient Session _persistence_session;
-
- public PhoneNumber()
- {
- this("", "###", "#######");
- }
-
- public PhoneNumber(String type, String theAreaCode, String theNumber)
- {
- this.type = type;
- areaCode = theAreaCode;
- number = theNumber;
- owner = null;
- status = new Vector();
- }
-
- public void addStatus(PhoneStatus status)
- {
- getStatus().add(status);
- }
-
- public Integer getId()
- {
- return _persistence_get_id();
- }
-
- public void setId(Integer id)
- {
- _persistence_set_id(id);
- }
-
- public String getNumber()
- {
- return _persistence_get_number();
- }
-
- public void setNumber(String number)
- {
- _persistence_set_number(number);
- }
-
- public Collection getStatus()
- {
- return _persistence_get_status();
- }
-
- public void setStatus(Collection status)
- {
- _persistence_set_status(status);
- }
-
- public String getType()
- {
- return _persistence_get_type();
- }
-
- public void setType(String type)
- {
- _persistence_set_type(type);
- }
-
- public String getAreaCode()
- {
- return _persistence_get_areaCode();
- }
-
- public void setAreaCode(String areaCode)
- {
- _persistence_set_areaCode(areaCode);
- }
-
- public Employee getOwner()
- {
- return _persistence_get_owner();
- }
-
- public void setOwner(Employee owner)
- {
- _persistence_set_owner(owner);
- }
-
- public void removeStatus(PhoneStatus status)
- {
- getStatus().remove(status);
- }
-
- public String toString()
- {
- StringWriter writer = new StringWriter();
- writer.write("PhoneNumber[");
- writer.write(getType());
- writer.write("]: (");
- writer.write(getAreaCode());
- writer.write(") ");
- int numberLength = getNumber().length();
- writer.write(getNumber().substring(0, Math.min(3, numberLength)));
- if(numberLength > 3)
- {
- writer.write("-");
- writer.write(getNumber().substring(3, Math.min(7, numberLength)));
- }
- return writer.toString();
- }
-
- public PhoneNumberPK buildPK()
- {
- PhoneNumberPK pk = new PhoneNumberPK();
- pk.setId(getOwner().getId());
- pk.setType(getType());
- return pk;
- }
-
- public Object _persistence_post_clone()
- {
- if(_persistence_owner_vh != null)
- {
- _persistence_owner_vh = (WeavedAttributeValueHolderInterface)_persistence_owner_vh.clone();
- }
- _persistence_listener = null;
- _persistence_fetchGroup = null;
- _persistence_session = null;
- _persistence_primaryKey = null;
- return this;
- }
-
- public Object _persistence_shallow_clone()
- {
- return super.clone();
- }
-
- public Object _persistence_getId()
- {
- return _persistence_primaryKey;
- }
-
- public void _persistence_setId(Object obj)
- {
- _persistence_primaryKey = obj;
- }
-
- public Object _persistence_new(PersistenceObject persistenceobject)
- {
- return new PhoneNumber(persistenceobject);
- }
-
- public PhoneNumber(PersistenceObject persistenceobject)
- {
- }
-
- public Object _persistence_get(String s)
- {
- if(s == "id")
- {
- return id;
- }
- if(s == "status")
- {
- return status;
- }
- if(s == "areaCode")
- {
- return areaCode;
- }
- if(s == "owner")
- {
- return owner;
- }
- if(s == "number")
- {
- return number;
- }
- if(s == "type")
- {
- return type;
- } else
- {
- return null;
- }
- }
-
- public void _persistence_set(String s, Object obj)
- {
- if(s == "id")
- {
- id = (Integer)obj;
- return;
- }
- if(s == "status")
- {
- status = (Collection)obj;
- return;
- }
- if(s == "areaCode")
- {
- areaCode = (String)obj;
- return;
- }
- if(s == "owner")
- {
- owner = (Employee)obj;
- return;
- }
- if(s == "number")
- {
- number = (String)obj;
- return;
- }
- if(s == "type")
- {
- type = (String)obj;
- return;
- } else
- {
- return;
- }
- }
-
- public Integer _persistence_get_id()
- {
- _persistence_checkFetched("id");
- return id;
- }
-
- public void _persistence_set_id(Integer integer)
- {
- _persistence_get_id();
- _persistence_propertyChange("id", id, integer);
- id = integer;
- return;
- }
-
- public Collection _persistence_get_status()
- {
- _persistence_checkFetched("status");
- return status;
- }
-
- public void _persistence_set_status(Collection collection)
- {
- _persistence_get_status();
- _persistence_propertyChange("status", status, collection);
- status = collection;
- return;
- }
-
- public String _persistence_get_areaCode()
- {
- _persistence_checkFetched("areaCode");
- return areaCode;
- }
-
- public void _persistence_set_areaCode(String s)
- {
- _persistence_get_areaCode();
- _persistence_propertyChange("areaCode", areaCode, s);
- areaCode = s;
- return;
- }
-
- protected void _persistence_initialize_owner_vh()
- {
- if(_persistence_owner_vh == null)
- {
- _persistence_owner_vh = new ValueHolder(owner);
- _persistence_owner_vh.setIsNewlyWeavedValueHolder(true);
- }
- }
-
- public WeavedAttributeValueHolderInterface _persistence_get_owner_vh()
- {
- _persistence_initialize_owner_vh();
- if(_persistence_owner_vh.isCoordinatedWithProperty() || _persistence_owner_vh.isNewlyWeavedValueHolder())
- {
- Employee employee = (Employee)getOwner();
- if(employee != _persistence_owner_vh.getValue())
- {
- setOwner(employee);
- }
- }
- return _persistence_owner_vh;
- }
-
- public void _persistence_set_owner_vh(WeavedAttributeValueHolderInterface weavedattributevalueholderinterface)
- {
- _persistence_owner_vh = weavedattributevalueholderinterface;
- if(weavedattributevalueholderinterface.isInstantiated())
- {
- Employee employee = getOwner();
- Object obj = weavedattributevalueholderinterface.getValue();
- if(employee != obj)
- {
- setOwner((Employee)obj);
- }
- }
- }
-
- public Employee _persistence_get_owner()
- {
- _persistence_checkFetched("owner");
- _persistence_initialize_owner_vh();
- owner = (Employee)_persistence_owner_vh.getValue();
- return owner;
- }
-
- public void _persistence_set_owner(Employee employee)
- {
- _persistence_get_owner();
- _persistence_propertyChange("owner", owner, employee);
- owner = employee;
- _persistence_owner_vh.setValue(employee);
- return;
- }
-
- public String _persistence_get_number()
- {
- _persistence_checkFetched("number");
- return number;
- }
-
- public void _persistence_set_number(String s)
- {
- _persistence_get_number();
- _persistence_propertyChange("number", number, s);
- number = s;
- return;
- }
-
- public String _persistence_get_type()
- {
- _persistence_checkFetched("type");
- return type;
- }
-
- public void _persistence_set_type(String s)
- {
- _persistence_get_type();
- _persistence_propertyChange("type", type, s);
- type = s;
- return;
- }
-
- public PropertyChangeListener _persistence_getPropertyChangeListener()
- {
- return _persistence_listener;
- }
-
- public void _persistence_setPropertyChangeListener(PropertyChangeListener propertychangelistener)
- {
- _persistence_listener = propertychangelistener;
- }
-
- public void _persistence_propertyChange(String s, Object obj, Object obj1)
- {
- if(_persistence_listener != null && obj != obj1)
- {
- _persistence_listener.propertyChange(new PropertyChangeEvent(this, s, obj, obj1));
- }
- }
-
- public Session _persistence_getSession()
- {
- return _persistence_session;
- }
-
- public void _persistence_setSession(Session session)
- {
- _persistence_session = session;
- }
-
- public FetchGroup _persistence_getFetchGroup()
- {
- return _persistence_fetchGroup;
- }
-
- public void _persistence_setFetchGroup(FetchGroup fetchgroup)
- {
- _persistence_fetchGroup = fetchgroup;
- }
-
- public boolean _persistence_shouldRefreshFetchGroup()
- {
- return _persistence_shouldRefreshFetchGroup;
- }
-
- public void _persistence_setShouldRefreshFetchGroup(boolean flag)
- {
- _persistence_shouldRefreshFetchGroup = flag;
- }
-
- public void _persistence_resetFetchGroup()
- {
- }
-
- public boolean _persistence_isAttributeFetched(String s)
- {
- return _persistence_fetchGroup == null || _persistence_fetchGroup.containsAttribute(s);
- }
-
- public void _persistence_checkFetched(String s)
- {
- if(!_persistence_isAttributeFetched(s))
- {
- JpaHelper.loadUnfetchedObject(this);
- }
- }
-}
diff --git a/summit-2010/WeavingExamples/PhoneNumber-internal.java b/summit-2010/WeavingExamples/PhoneNumber-internal.java
deleted file mode 100644
index cabfec6..0000000
--- a/summit-2010/WeavingExamples/PhoneNumber-internal.java
+++ /dev/null
@@ -1,226 +0,0 @@
-package org.eclipse.persistence.testing.models.jpa.advanced;
-
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Vector;
-import org.eclipse.persistence.internal.descriptors.PersistenceEntity;
-import org.eclipse.persistence.internal.descriptors.PersistenceObject;
-import org.eclipse.persistence.internal.weaving.PersistenceWeaved;
-
-// Referenced classes of package org.eclipse.persistence.testing.models.jpa.advanced:
-// PhoneNumberPK, Employee
-
-public class PhoneNumber
- implements Serializable, Cloneable, PersistenceWeaved, PersistenceEntity, PersistenceObject
-{
- /* member class not found */
- class PhoneStatus {}
-
-
- private String number;
- private String type;
- private Employee owner;
- private String areaCode;
- private Collection status;
- public static final long serialVersionUID = 0x120adfdddd107d7bL;
- protected transient Object _persistence_primaryKey;
-
- public PhoneNumber()
- {
- this("", "###", "#######");
- }
-
- public PhoneNumber(String type, String theAreaCode, String theNumber)
- {
- this.type = type;
- areaCode = theAreaCode;
- number = theNumber;
- owner = null;
- status = new Vector();
- }
-
- public void addStatus(PhoneStatus status)
- {
- getStatus().add(status);
- }
-
- public String getNumber()
- {
- return number;
- }
-
- public void setNumber(String number)
- {
- this.number = number;
- }
-
- public Collection getStatus()
- {
- return status;
- }
-
- public void setStatus(Collection status)
- {
- this.status = status;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public String getAreaCode()
- {
- return areaCode;
- }
-
- public void setAreaCode(String areaCode)
- {
- this.areaCode = areaCode;
- }
-
- public Employee getOwner()
- {
- return owner;
- }
-
- public void setOwner(Employee owner)
- {
- this.owner = owner;
- }
-
- public void removeStatus(PhoneStatus status)
- {
- getStatus().remove(status);
- }
-
- public List buildPK()
- {
- List pk = new Vector();
- pk.add(getOwner().getId());
- pk.add(getType());
- return pk;
- }
-
- public String toString()
- {
- StringWriter writer = new StringWriter();
- writer.write("PhoneNumber[");
- writer.write(getType());
- writer.write("]: (");
- writer.write(getAreaCode());
- writer.write(") ");
- int numberLength = getNumber().length();
- writer.write(getNumber().substring(0, Math.min(3, numberLength)));
- if(numberLength > 3)
- {
- writer.write("-");
- writer.write(getNumber().substring(3, Math.min(7, numberLength)));
- }
- return writer.toString();
- }
-
- public Object _persistence_post_clone()
- {
- _persistence_primaryKey = null;
- return this;
- }
-
- public Object _persistence_shallow_clone()
- {
- return super.clone();
- }
-
- public Object _persistence_getId()
- {
- return _persistence_primaryKey;
- }
-
- public void _persistence_setId(Object obj)
- {
- _persistence_primaryKey = obj;
- }
-
- public Object _persistence_new(PersistenceObject persistenceobject)
- {
- return new PhoneNumber(persistenceobject);
- }
-
- public PhoneNumber(PersistenceObject persistenceobject)
- {
- }
-
- public Object _persistence_get(String s)
- {
- if(s == "id")
- {
- return id;
- }
- if(s == "status")
- {
- return status;
- }
- if(s == "areaCode")
- {
- return areaCode;
- }
- if(s == "owner")
- {
- return owner;
- }
- if(s == "number")
- {
- return number;
- }
- if(s == "type")
- {
- return type;
- } else
- {
- return null;
- }
- }
-
- public void _persistence_set(String s, Object obj)
- {
- if(s == "id")
- {
- id = (Integer)obj;
- return;
- }
- if(s == "status")
- {
- status = (Collection)obj;
- return;
- }
- if(s == "areaCode")
- {
- areaCode = (String)obj;
- return;
- }
- if(s == "owner")
- {
- owner = (Employee)obj;
- return;
- }
- if(s == "number")
- {
- number = (String)obj;
- return;
- }
- if(s == "type")
- {
- type = (String)obj;
- return;
- } else
- {
- return;
- }
- }
-}
diff --git a/summit-2010/WeavingExamples/PhoneNumber-lazy-field.java b/summit-2010/WeavingExamples/PhoneNumber-lazy-field.java
deleted file mode 100644
index 004ebc1..0000000
--- a/summit-2010/WeavingExamples/PhoneNumber-lazy-field.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced;
-
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Vector;
-import org.eclipse.persistence.indirection.ValueHolder;
-import org.eclipse.persistence.indirection.WeavedAttributeValueHolderInterface;
-import org.eclipse.persistence.internal.weaving.PersistenceWeaved;
-import org.eclipse.persistence.internal.weaving.PersistenceWeavedLazy;
-
-// Referenced classes of package org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced:
-// Employee
-
-public class PhoneNumber
- implements Serializable, PersistenceWeaved, PersistenceWeavedLazy
-{
- /* member class not found */
- class PhoneStatus {}
-
-
- private String number;
- private String type;
- private Employee owner;
- private String areaCode;
- private Collection status;
- protected WeavedAttributeValueHolderInterface _persistence_owner_vh;
-
- public PhoneNumber()
- {
- this("", "###", "#######");
- }
-
- public PhoneNumber(String type, String theAreaCode, String theNumber)
- {
- this.type = type;
- areaCode = theAreaCode;
- number = theNumber;
- owner = null;
- status = new Vector();
- }
-
- public void addStatus(PhoneStatus status)
- {
- getStatus().add(status);
- }
-
- public String getNumber()
- {
- return number;
- }
-
- public void setNumber(String number)
- {
- this.number = number;
- }
-
- public Collection getStatus()
- {
- return status;
- }
-
- public void setStatus(Collection status)
- {
- this.status = status;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public String getAreaCode()
- {
- return areaCode;
- }
-
- public void setAreaCode(String areaCode)
- {
- this.areaCode = areaCode;
- }
-
- public Employee getOwner()
- {
- return _persistence_get_owner();
- }
-
- public void setOwner(Employee owner)
- {
- _persistence_set_owner(owner);
- }
-
- public void removeStatus(PhoneStatus status)
- {
- getStatus().remove(status);
- }
-
- public List buildPK()
- {
- List pk = new Vector();
- pk.add(getOwner().getId());
- pk.add(getType());
- return pk;
- }
-
- public String toString()
- {
- StringWriter writer = new StringWriter();
- writer.write("PhoneNumber[");
- writer.write(getType());
- writer.write("]: (");
- writer.write(getAreaCode());
- writer.write(") ");
- int numberLength = getNumber().length();
- writer.write(getNumber().substring(0, Math.min(3, numberLength)));
- if(numberLength > 3)
- {
- writer.write("-");
- writer.write(getNumber().substring(3, Math.min(7, numberLength)));
- }
- return writer.toString();
- }
-
- protected void _persistence_initialize_owner_vh()
- {
- if(_persistence_owner_vh == null)
- {
- _persistence_owner_vh = new ValueHolder(owner);
- _persistence_owner_vh.setIsNewlyWeavedValueHolder(true);
- }
- }
-
- public WeavedAttributeValueHolderInterface _persistence_get_owner_vh()
- {
- _persistence_initialize_owner_vh();
- if(_persistence_owner_vh.isCoordinatedWithProperty() || _persistence_owner_vh.isNewlyWeavedValueHolder())
- {
- Employee employee = _persistence_get_owner();
- if(employee != _persistence_owner_vh.getValue())
- {
- _persistence_set_owner(employee);
- }
- }
- return _persistence_owner_vh;
- }
-
- public void _persistence_set_owner_vh(WeavedAttributeValueHolderInterface weavedattributevalueholderinterface)
- {
- _persistence_owner_vh = weavedattributevalueholderinterface;
- if(weavedattributevalueholderinterface.isInstantiated())
- {
- Employee employee = _persistence_get_owner();
- Object obj = weavedattributevalueholderinterface.getValue();
- if(employee != obj)
- {
- _persistence_set_owner((Employee)obj);
- }
- }
- }
-
- public Employee _persistence_get_owner()
- {
- _persistence_initialize_owner_vh();
- owner = (Employee)_persistence_owner_vh.getValue();
- return owner;
- }
-
- public void _persistence_set_owner(Employee employee)
- {
- _persistence_get_owner();
- owner = employee;
- _persistence_owner_vh.setValue(employee);
- return;
- }
-}
diff --git a/summit-2010/WeavingExamples/PhoneNumber-lazy-property.java b/summit-2010/WeavingExamples/PhoneNumber-lazy-property.java
deleted file mode 100644
index ee7ffc9..0000000
--- a/summit-2010/WeavingExamples/PhoneNumber-lazy-property.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package org.eclipse.persistence.testing.models.jpa.advanced;
-
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Vector;
-import org.eclipse.persistence.indirection.ValueHolder;
-import org.eclipse.persistence.indirection.WeavedAttributeValueHolderInterface;
-import org.eclipse.persistence.internal.weaving.PersistenceWeaved;
-import org.eclipse.persistence.internal.weaving.PersistenceWeavedLazy;
-
-// Referenced classes of package org.eclipse.persistence.testing.models.jpa.advanced:
-// Employee, PhoneNumberPK
-
-public class PhoneNumber
- implements Serializable, PersistenceWeaved, PersistenceWeavedLazy
-{
- /* member class not found */
- class PhoneStatus {}
-
-
- private String number;
- private String type;
- private Employee owner;
- private String areaCode;
- private Collection status;
- protected WeavedAttributeValueHolderInterface _persistence_owner_vh;
-
- public PhoneNumber()
- {
- this("", "###", "#######");
- }
-
- public PhoneNumber(String type, String theAreaCode, String theNumber)
- {
- this.type = type;
- areaCode = theAreaCode;
- number = theNumber;
- owner = null;
- status = new Vector();
- }
-
- public void addStatus(PhoneStatus status)
- {
- getStatus().add(status);
- }
-
- public String getNumber()
- {
- return number;
- }
-
- public void setNumber(String number)
- {
- this.number = number;
- }
-
- public Collection getStatus()
- {
- return status;
- }
-
- public void setStatus(Collection status)
- {
- this.status = status;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public String getAreaCode()
- {
- return areaCode;
- }
-
- public void setAreaCode(String areaCode)
- {
- this.areaCode = areaCode;
- }
-
- public Employee getOwner()
- {
- _persistence_initialize_owner_vh();
- if(!_persistence_owner_vh.isInstantiated())
- {
- setOwner((Employee)_persistence_owner_vh.getValue());
- }
- return owner;
- }
-
- public void setOwner(Employee owner)
- {
- this.owner = owner;
- _persistence_initialize_owner_vh();
- _persistence_owner_vh.setValue(owner);
- _persistence_owner_vh.setIsCoordinatedWithProperty(true);
- }
-
- public void removeStatus(PhoneStatus status)
- {
- getStatus().remove(status);
- }
-
- public List buildPK()
- {
- List pk = new Vector();
- pk.add(getOwner().getId());
- pk.add(getType());
- return pk;
- }
-
- public String toString()
- {
- StringWriter writer = new StringWriter();
- writer.write("PhoneNumber[");
- writer.write(getType());
- writer.write("]: (");
- writer.write(getAreaCode());
- writer.write(") ");
- int numberLength = getNumber().length();
- writer.write(getNumber().substring(0, Math.min(3, numberLength)));
- if(numberLength > 3)
- {
- writer.write("-");
- writer.write(getNumber().substring(3, Math.min(7, numberLength)));
- }
- return writer.toString();
- }
-
- protected void _persistence_initialize_owner_vh()
- {
- if(_persistence_owner_vh == null)
- {
- _persistence_owner_vh = new ValueHolder();
- _persistence_owner_vh.setIsNewlyWeavedValueHolder(true);
- }
- }
-
- public WeavedAttributeValueHolderInterface _persistence_get_owner_vh()
- {
- _persistence_initialize_owner_vh();
- if(_persistence_owner_vh.isCoordinatedWithProperty() || _persistence_owner_vh.isNewlyWeavedValueHolder())
- {
- Employee employee = (Employee)getOwner();
- if(employee != _persistence_owner_vh.getValue())
- {
- setOwner(employee);
- }
- }
- return _persistence_owner_vh;
- }
-
- public void _persistence_set_owner_vh(WeavedAttributeValueHolderInterface weavedattributevalueholderinterface)
- {
- _persistence_owner_vh = weavedattributevalueholderinterface;
- if(weavedattributevalueholderinterface.isInstantiated())
- {
- Employee employee = getOwner();
- Object obj = weavedattributevalueholderinterface.getValue();
- if(employee != obj)
- {
- setOwner((Employee)obj);
- }
- }
- }
-}
diff --git a/summit-2010/WeavingExamples/PhoneNumber-stripped.java b/summit-2010/WeavingExamples/PhoneNumber-stripped.java
deleted file mode 100644
index 2902ad3..0000000
--- a/summit-2010/WeavingExamples/PhoneNumber-stripped.java
+++ /dev/null
@@ -1,120 +0,0 @@
-package org.eclipse.persistence.testing.models.jpa.advanced;
-
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Vector;
-
-public class PhoneNumber
- implements Serializable {
-
- public enum PhoneStatus { ACTIVE, ASSIGNED, UNASSIGNED, DEAD }
-
-
- private String number;
- private String type;
- private Employee owner;
- private String areaCode;
- private Collection status;
-
- public PhoneNumber()
- {
- this("", "###", "#######");
- }
-
- public PhoneNumber(String type, String theAreaCode, String theNumber)
- {
- this.type = type;
- areaCode = theAreaCode;
- number = theNumber;
- owner = null;
- status = new Vector();
- }
-
- public void addStatus(PhoneStatus status)
- {
- getStatus().add(status);
- }
-
- public String getNumber()
- {
- return number;
- }
-
- public void setNumber(String number)
- {
- this.number = number;
- }
-
- public Collection getStatus()
- {
- return status;
- }
-
- public void setStatus(Collection status)
- {
- this.status = status;
- }
-
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public String getAreaCode()
- {
- return areaCode;
- }
-
- public void setAreaCode(String areaCode)
- {
- this.areaCode = areaCode;
- }
-
- public Employee getOwner()
- {
- return owner;
- }
-
- public void setOwner(Employee owner)
- {
- this.owner = owner;
- }
-
- public void removeStatus(PhoneStatus status)
- {
- getStatus().remove(status);
- }
-
- public List buildPK()
- {
- List pk = new Vector();
- pk.add(getOwner().getId());
- pk.add(getType());
- return pk;
- }
-
- public String toString()
- {
- StringWriter writer = new StringWriter();
- writer.write("PhoneNumber[");
- writer.write(getType());
- writer.write("]: (");
- writer.write(getAreaCode());
- writer.write(") ");
- int numberLength = getNumber().length();
- writer.write(getNumber().substring(0, Math.min(3, numberLength)));
- if(numberLength > 3)
- {
- writer.write("-");
- writer.write(getNumber().substring(3, Math.min(7, numberLength)));
- }
- return writer.toString();
- }
-
-}
diff --git a/summit-2010/Welcome.ppt b/summit-2010/Welcome.ppt
deleted file mode 100644
index fcdc879..0000000
--- a/summit-2010/Welcome.ppt
+++ /dev/null
Binary files differ
diff --git a/summit-2010/diagrams/Calls.png b/summit-2010/diagrams/Calls.png
deleted file mode 100644
index 89f4556..0000000
--- a/summit-2010/diagrams/Calls.png
+++ /dev/null
Binary files differ
diff --git a/summit-2010/diagrams/DescriptorPolicies_uml.png b/summit-2010/diagrams/DescriptorPolicies_uml.png
deleted file mode 100644
index ec64547..0000000
--- a/summit-2010/diagrams/DescriptorPolicies_uml.png
+++ /dev/null
Binary files differ
diff --git a/summit-2010/diagrams/JPA Queries.png b/summit-2010/diagrams/JPA Queries.png
deleted file mode 100644
index 3292717..0000000
--- a/summit-2010/diagrams/JPA Queries.png
+++ /dev/null
Binary files differ
diff --git a/summit-2010/diagrams/LockingPolicies_uml.png b/summit-2010/diagrams/LockingPolicies_uml.png
deleted file mode 100644
index 4d86db4..0000000
--- a/summit-2010/diagrams/LockingPolicies_uml.png
+++ /dev/null
Binary files differ
diff --git a/summit-2010/diagrams/Native Queries.png b/summit-2010/diagrams/Native Queries.png
deleted file mode 100644
index b6eb873..0000000
--- a/summit-2010/diagrams/Native Queries.png
+++ /dev/null
Binary files differ
diff --git a/summit-2010/diagrams/Query Mechanisms.png b/summit-2010/diagrams/Query Mechanisms.png
deleted file mode 100644
index 2cee825..0000000
--- a/summit-2010/diagrams/Query Mechanisms.png
+++ /dev/null
Binary files differ
diff --git a/summit-2010/diagrams/descriptor-customzing.png b/summit-2010/diagrams/descriptor-customzing.png
deleted file mode 100644
index a227ea2..0000000
--- a/summit-2010/diagrams/descriptor-customzing.png
+++ /dev/null
Binary files differ
diff --git a/summit-2010/diagrams/dynamic.png b/summit-2010/diagrams/dynamic.png
deleted file mode 100644
index 7613919..0000000
--- a/summit-2010/diagrams/dynamic.png
+++ /dev/null
Binary files differ
diff --git a/summit-2010/diagrams/session-customizing.png b/summit-2010/diagrams/session-customizing.png
deleted file mode 100644
index 2280cac..0000000
--- a/summit-2010/diagrams/session-customizing.png
+++ /dev/null
Binary files differ
diff --git a/summit-2010/diagrams/sessions-api.png b/summit-2010/diagrams/sessions-api.png
deleted file mode 100644
index 865de72..0000000
--- a/summit-2010/diagrams/sessions-api.png
+++ /dev/null
Binary files differ