Updated copyright to some files, updated Ant scripts to run Mapping and Utility tests, did some clean up and wrote more Mapping tests
diff --git a/.gitignore b/.gitignore
index 657d257..6fab01b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,10 @@
-.DS_Store
-*.class
-target/
-classes/
-run/
-build/
+.DS_Store
+*.class
+target/
+classes/
+run/
+build/
+tools/org.eclipse.persistence.tools.mapping.tests/reports/
+tools/org.eclipse.persistence.tools.mapping.tests/run/
+tools/org.eclipse.persistence.tools.utility.tests/reports/
+tools/org.eclipse.persistence.tools.utility.tests/run/
diff --git a/antbuild.xml b/antbuild.xml
index 00020cc..b1b7397 100644
--- a/antbuild.xml
+++ b/antbuild.xml
@@ -53,8 +53,8 @@
-->
<project name="eclipselink.tools.temp" default="build" basedir=".">
- <target name="build" depends="init, build-tools, build-tools-test" description="Default ant target, compiles all components and tests"/>
- <target name="clean" depends="init, clean-tools, clean-tools-test" description="Cleans all build generated files."/>
+ <target name="build" depends="init, build-tools" description="Default ant target, compiles all components and tests"/>
+ <target name="clean" depends="init, clean-tools" description="Cleans all build generated files."/>
<target name="build-distribution" depends="clean, build, build-javadocs, package-installer-zip" description="Builds all jars, generates javadoc, and builds installer."/>
<target name="test-srg" depends="init, test-tools-srg" description="Run the SRG test suites"/>
<target name="test-lrg" depends="init, test-tools-lrg" description="Run the LRG test suites"/>
@@ -159,7 +159,6 @@
<!-- Needed for Maven/Tycho builds -->
<target name="check-maven" description="Verify the Maven tool is installed and configured">
<condition property="M2_HOME" value="${env.M2_HOME}">
- <!-- else="D:/apache-maven-3.0.4" -->
<isset property="env.M2_HOME"/>
</condition>
<echo message="Maven install (M2_HOME) set to: '${M2_HOME}'"/>
@@ -227,13 +226,6 @@
</java>
</target>
- <!-- Placeholder for non-OSGi tools compiles -->
- <!-- Compiles tests (excluding workbench, dbws-util and Oracle extensions). -->
- <target name="build-tools-test">
- <echo message="build-tools-test"/>
- <!-- ant antfile="antbuild.xml" dir="${eclipselink.core.test}" target="build"/ -->
- </target>
-
<!-- ================================================================================= -->
<!-- =========================== Javadoc Targets =================================== -->
<target name="build-javadocs">
@@ -322,25 +314,27 @@
<!-- =========================== Test Targets ====================================== -->
<!-- Run All LRG tests -->
- <target name="test-tools-lrg" description="run all the LRG tests"
+ <target name="test-tools-lrg"
+ description="run all the EclipseLink Tools LRG tests"
depends="test-utility-lrg, test-mapping-lrg" />
<!-- Run Utility LRG tests -->
- <target name="test-utility-lrg" description="run the Utility tests">
- <ant antfile="antbuild.xml" dir="${tools.root}/org.eclipse.persistence.tools.utility.tests" target="run"/>
+ <target name="test-utility-lrg" description="run the EclipseLink Tools Utility LRG tests">
+ <ant antfile="antbuild.xml" dir="${tools.root}/org.eclipse.persistence.tools.utility.tests" target="test"/>
</target>
<!-- Run Mapping LRG tests -->
- <target name="test-mapping-lrg" description="run the Mapping tests">
- <ant antfile="antbuild.xml" dir="${tools.root}/org.eclipse.persistence.tools.mapping.tests" target="run"/>
+ <target name="test-mapping-lrg" description="run the EclipseLink Tools Mapping LRG tests">
+ <ant antfile="antbuild.xml" dir="${tools.root}/org.eclipse.persistence.tools.mapping.tests" target="test"/>
</target>
<!-- Run All SRG tests -->
- <target name="test-tools-srg" description="run all the SRG tests"
+ <target name="test-tools-srg"
+ description="run all the EclipseLink Tools SRG tests"
depends="test-utility-srg, test-mapping-srg" />
<!-- Run Utility SRG tests -->
- <target name="test-utility-srg" description="run the Utility tests">
+ <target name="test-utility-srg" description="run the EclipseLink Tools Utility SRG tests">
<ant antfile="antbuild.xml" dir="${tools.root}/org.eclipse.persistence.tools.utility.tests" target="test-srg"/>
</target>
<!-- Run Mapping SRG tests -->
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkColumn.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkColumn.java
index 0b42793..a43fb76 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkColumn.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkColumn.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkColumnPair.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkColumnPair.java
index 753b92c..64a5529 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkColumnPair.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkColumnPair.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkConnectionProfile.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkConnectionProfile.java
index dbaf224..42a3b41 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkConnectionProfile.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkConnectionProfile.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkDatabase.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkDatabase.java
index 68df9c5..9dac76c 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkDatabase.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkDatabase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkForeignKey.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkForeignKey.java
index 6e5690d..dfdba81 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkForeignKey.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkForeignKey.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkSchema.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkSchema.java
index 4ec6f10..6b4b81a 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkSchema.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkSchema.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkTable.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkTable.java
index 75192c6..0a8f0fe 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkTable.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/EclipseLinkTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/AbstractWorkbenchDriverAdapter.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/AbstractWorkbenchDriverAdapter.java
index 0b70fc4..31be771 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/AbstractWorkbenchDriverAdapter.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/AbstractWorkbenchDriverAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/CatalogStrategy.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/CatalogStrategy.java
index 3fa5fd5..2ec9ad9 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/CatalogStrategy.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/CatalogStrategy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/DB2.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/DB2.java
index 5296508..230be38 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/DB2.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/DB2.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Derby.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Derby.java
index e20a33a..aabc765 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Derby.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Derby.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/FauxCatalogStrategy.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/FauxCatalogStrategy.java
index b9a6505..3f1a438 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/FauxCatalogStrategy.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/FauxCatalogStrategy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/FoldingStrategy.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/FoldingStrategy.java
index e19d68b..f5d82d4 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/FoldingStrategy.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/FoldingStrategy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/HSQLDB.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/HSQLDB.java
index f8add8e..37f0b33 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/HSQLDB.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/HSQLDB.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Informix.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Informix.java
index 024461b..56fe44f 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Informix.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Informix.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/LowerCaseFoldingStrategy.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/LowerCaseFoldingStrategy.java
index b1ea531..f32c6e5 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/LowerCaseFoldingStrategy.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/LowerCaseFoldingStrategy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/MaxDB.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/MaxDB.java
index e4b5756..7834cda 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/MaxDB.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/MaxDB.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/MySQL.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/MySQL.java
index a24c3f7..01ef3f4 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/MySQL.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/MySQL.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/NoCatalogStrategy.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/NoCatalogStrategy.java
index 45af283..b0a5dc8 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/NoCatalogStrategy.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/NoCatalogStrategy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/NonFoldingStrategy.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/NonFoldingStrategy.java
index d90d383..c23e3f1 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/NonFoldingStrategy.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/NonFoldingStrategy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Oracle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Oracle.java
index 5182640..50e68d7 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Oracle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Oracle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/PostgreSQL.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/PostgreSQL.java
index 87c4a70..2f6edfb 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/PostgreSQL.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/PostgreSQL.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/SQLServer.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/SQLServer.java
index 9641bf6..c6cf017 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/SQLServer.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/SQLServer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/SimpleCatalogStrategy.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/SimpleCatalogStrategy.java
index 0ea2d25..cf514c0 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/SimpleCatalogStrategy.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/SimpleCatalogStrategy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Sybase.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Sybase.java
index ce56ba1..e099d1a 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Sybase.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Sybase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Unknown.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Unknown.java
index 6bb7135..46e86e9 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Unknown.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/Unknown.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/UpperCaseFoldingStrategy.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/UpperCaseFoldingStrategy.java
index 88d42a3..95efc82 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/UpperCaseFoldingStrategy.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/UpperCaseFoldingStrategy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/WorkbenchDriverAdapter.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/WorkbenchDriverAdapter.java
index ad958f4..a4ceeca 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/WorkbenchDriverAdapter.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/WorkbenchDriverAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/WorkbenchDriverAdapterManager.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/WorkbenchDriverAdapterManager.java
index 0da89b0..22f7c54 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/WorkbenchDriverAdapterManager.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/driver/WorkbenchDriverAdapterManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/DatabaseTypeHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/DatabaseTypeHandle.java
index 2871db9..74deb98 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/DatabaseTypeHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/DatabaseTypeHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELColumn.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELColumn.java
index efd70de..27cf6c5 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELColumn.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELColumn.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELColumnPair.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELColumnPair.java
index 8bcd865..961dc7c 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELColumnPair.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELColumnPair.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELDatabase.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELDatabase.java
index dd7d507..e7c6abd 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELDatabase.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELDatabase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELLoginSpec.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELLoginSpec.java
index 9afb496..df5dcc5 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELLoginSpec.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELLoginSpec.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELLoginSpecHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELLoginSpecHandle.java
index 56367b6..58edc41 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELLoginSpecHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELLoginSpecHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELModel.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELModel.java
index f72e6dd..163770e 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELModel.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELNode.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELNode.java
index 7a8dee3..566899f 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELNode.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELReference.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELReference.java
index dcef200..f17bc6b 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELReference.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELTable.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELTable.java
index 0b05102..5789b1e 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELTable.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/ELTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/NodeModel.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/NodeModel.java
index fc69396..04e371e 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/NodeModel.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/NodeModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWColumnHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWColumnHandle.java
index 766b35e..5ca47ac 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWColumnHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWColumnHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWColumnPairHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWColumnPairHandle.java
index a68149d..e561bed 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWColumnPairHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWColumnPairHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWHandle.java
index d479901..66565df 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWReferenceHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWReferenceHandle.java
index 53b32c1..22faea3 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWReferenceHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWReferenceHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWTableHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWTableHandle.java
index 8483fa8..7a5da33 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWTableHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/handles/MWTableHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/AbstractJDBCTypeToJavaTypeDeclarationMapping.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/AbstractJDBCTypeToJavaTypeDeclarationMapping.java
index 0efef42..9e51ebb 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/AbstractJDBCTypeToJavaTypeDeclarationMapping.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/AbstractJDBCTypeToJavaTypeDeclarationMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/CorruptXMLException.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/CorruptXMLException.java
index 9069a0b..72100d1 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/CorruptXMLException.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/CorruptXMLException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/DatabasePlatform.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/DatabasePlatform.java
index 45cde42..5107a1a 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/DatabasePlatform.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/DatabasePlatform.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/DatabasePlatformRepository.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/DatabasePlatformRepository.java
index 39ce0cf..d4ea215 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/DatabasePlatformRepository.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/DatabasePlatformRepository.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/DatabaseType.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/DatabaseType.java
index 79ee90a..fd2bab8 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/DatabaseType.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/DatabaseType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCType.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCType.java
index 760d65e..d353cc6 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCType.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCTypeRepository.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCTypeRepository.java
index 3a648ce..026e2ec 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCTypeRepository.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCTypeRepository.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCTypeToDatabaseTypeMapping.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCTypeToDatabaseTypeMapping.java
index 656f3bb..3f3d734 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCTypeToDatabaseTypeMapping.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCTypeToDatabaseTypeMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCTypeToJavaTypeDeclarationMapping.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCTypeToJavaTypeDeclarationMapping.java
index c412f60..d0b767f 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCTypeToJavaTypeDeclarationMapping.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JDBCTypeToJavaTypeDeclarationMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JavaTypeDeclaration.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JavaTypeDeclaration.java
index 8c3362b..0482f2e 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JavaTypeDeclaration.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JavaTypeDeclaration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JavaTypeDeclarationToJDBCTypeMapping.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JavaTypeDeclarationToJDBCTypeMapping.java
index bb40954..48cbdba 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JavaTypeDeclarationToJDBCTypeMapping.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/platformsmodel/JavaTypeDeclarationToJDBCTypeMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalColumn.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalColumn.java
index 7ded908..c3a2aa3 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalColumn.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalColumn.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalDatabase.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalDatabase.java
index 0a485ea..8d9797f 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalDatabase.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalDatabase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalDatabaseFactory.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalDatabaseFactory.java
index c6b0391..a4e321e 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalDatabaseFactory.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalDatabaseFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalForeignKey.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalForeignKey.java
index aa88d88..b8af829 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalForeignKey.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalForeignKey.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalForeignKeyColumnPair.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalForeignKeyColumnPair.java
index a1f96f1..0827647 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalForeignKeyColumnPair.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalForeignKeyColumnPair.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalTable.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalTable.java
index f83d16f..a77f5bd 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalTable.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalTableDescription.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalTableDescription.java
index 61d1037..7f85c09 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalTableDescription.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/ExternalTableDescription.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/TableDescription.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/TableDescription.java
index dbf46c0..f19453d 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/TableDescription.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/TableDescription.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalColumn.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalColumn.java
index ac24a8d..c984ec8 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalColumn.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalColumn.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalDatabase.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalDatabase.java
index 4a28451..c438a89 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalDatabase.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalDatabase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalDatabaseFactory.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalDatabaseFactory.java
index 5e89c96..f94ed5f 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalDatabaseFactory.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalDatabaseFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalForeignKey.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalForeignKey.java
index 4d1adb5..431c1b2 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalForeignKey.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalForeignKey.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalForeignKeyColumnPair.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalForeignKeyColumnPair.java
index c3b9d35..ad5eead 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalForeignKeyColumnPair.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalForeignKeyColumnPair.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalTable.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalTable.java
index 253fc55..040d03a 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalTable.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalTableDescription.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalTableDescription.java
index e4ab4a0..c26c224 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalTableDescription.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/model/spi/jdbc/JDBCExternalTableDescription.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/DatabaseTypeHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/DatabaseTypeHandle.java
index 5d15694..75a5852 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/DatabaseTypeHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/DatabaseTypeHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELColumn.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELColumn.java
index 46d9e1e..f3c894b 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELColumn.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELColumn.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELColumnPair.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELColumnPair.java
index 6a802b7..96696d9 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELColumnPair.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELColumnPair.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELDatabase.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELDatabase.java
index 66565fa..8364548 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELDatabase.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELDatabase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELLoginSpec.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELLoginSpec.java
index 77896be..8f439f2 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELLoginSpec.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELLoginSpec.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELLoginSpecHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELLoginSpecHandle.java
index b15ec4b..ce5f52b 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELLoginSpecHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELLoginSpecHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELModel.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELModel.java
index 037f228..6a69105 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELModel.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELNode.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELNode.java
index aa91288..09118d6 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELNode.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELReference.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELReference.java
index 004f656..e1d371a 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELReference.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELTable.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELTable.java
index 6d8294e..93cb3f3 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELTable.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/ELTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/NodeModel.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/NodeModel.java
index a3dbe3f..cb5474f 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/NodeModel.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/NodeModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWColumnHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWColumnHandle.java
index 22d3878..dfba1ee 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWColumnHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWColumnHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWColumnPairHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWColumnPairHandle.java
index 68a8589..529e40b 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWColumnPairHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWColumnPairHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWHandle.java
index 07e3668..340e57b 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWReferenceHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWReferenceHandle.java
index 9457d0b..da82b73 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWReferenceHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWReferenceHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWTableHandle.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWTableHandle.java
index b37986c..be6cab9 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWTableHandle.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/handles/MWTableHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/AbstractJDBCTypeToJavaTypeDeclarationMapping.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/AbstractJDBCTypeToJavaTypeDeclarationMapping.java
index b0ca437..6b1facc 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/AbstractJDBCTypeToJavaTypeDeclarationMapping.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/AbstractJDBCTypeToJavaTypeDeclarationMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/CorruptXMLException.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/CorruptXMLException.java
index bb47593..4f551db 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/CorruptXMLException.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/CorruptXMLException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/DatabasePlatform.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/DatabasePlatform.java
index d373b21..6fc3ac3 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/DatabasePlatform.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/DatabasePlatform.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/DatabasePlatformRepository.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/DatabasePlatformRepository.java
index 77368b4..416c140 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/DatabasePlatformRepository.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/DatabasePlatformRepository.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/DatabaseType.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/DatabaseType.java
index 812b294..7a15b32 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/DatabaseType.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/DatabaseType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCType.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCType.java
index 5d3abee..e79c61a 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCType.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCTypeRepository.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCTypeRepository.java
index e5bd58f..e409052 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCTypeRepository.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCTypeRepository.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCTypeToDatabaseTypeMapping.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCTypeToDatabaseTypeMapping.java
index 2db633d..f8b8470 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCTypeToDatabaseTypeMapping.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCTypeToDatabaseTypeMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCTypeToJavaTypeDeclarationMapping.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCTypeToJavaTypeDeclarationMapping.java
index eaf7983..d77bd18 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCTypeToJavaTypeDeclarationMapping.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JDBCTypeToJavaTypeDeclarationMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JavaTypeDeclaration.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JavaTypeDeclaration.java
index f1b9c6d..68a8d7d 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JavaTypeDeclaration.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JavaTypeDeclaration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JavaTypeDeclarationToJDBCTypeMapping.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JavaTypeDeclarationToJDBCTypeMapping.java
index 1762a32..3567e5f 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JavaTypeDeclarationToJDBCTypeMapping.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/platformsmodel/JavaTypeDeclarationToJDBCTypeMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalColumn.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalColumn.java
index 533da80..fdb8857 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalColumn.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalColumn.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalDatabase.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalDatabase.java
index a4c6d00..126df8f 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalDatabase.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalDatabase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalDatabaseFactory.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalDatabaseFactory.java
index b60a721..4d1e954 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalDatabaseFactory.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalDatabaseFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalForeignKey.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalForeignKey.java
index c9005b1..c609131 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalForeignKey.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalForeignKey.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalForeignKeyColumnPair.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalForeignKeyColumnPair.java
index 157ab5a..c51477c 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalForeignKeyColumnPair.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalForeignKeyColumnPair.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalTable.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalTable.java
index ba951f4..8bd863f 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalTable.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalTableDescription.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalTableDescription.java
index a318e8c..5e19322 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalTableDescription.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/ExternalTableDescription.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/TableDescription.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/TableDescription.java
index ec8e002..4ea4165 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/TableDescription.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/TableDescription.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalColumn.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalColumn.java
index 62ff19d..4cabe25 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalColumn.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalColumn.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalDatabase.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalDatabase.java
index 139310c..b18883a 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalDatabase.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalDatabase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalDatabaseFactory.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalDatabaseFactory.java
index 42dc0f1..d5d274e 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalDatabaseFactory.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalDatabaseFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalForeignKey.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalForeignKey.java
index 929a2fd..4895623 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalForeignKey.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalForeignKey.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalForeignKeyColumnPair.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalForeignKeyColumnPair.java
index 0c4f055..cdfceb7 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalForeignKeyColumnPair.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalForeignKeyColumnPair.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalTable.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalTable.java
index 88b88c3..d7715b3 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalTable.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalTableDescription.java b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalTableDescription.java
index 6223e31..3458a05 100644
--- a/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalTableDescription.java
+++ b/tools/org.eclipse.persistence.tools.db/src/org/eclipse/persistence/tools/db/relational/spi/jdbc/JDBCExternalTableDescription.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle. All rights reserved.
+ * Copyright (c) 1998, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/MongoEntityGenerator.java b/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/MongoEntityGenerator.java
index b13edd6..380b0a9 100644
--- a/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/MongoEntityGenerator.java
+++ b/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/MongoEntityGenerator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/CollectionDescriptor.java b/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/CollectionDescriptor.java
index 2daf391..e3ff59d 100644
--- a/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/CollectionDescriptor.java
+++ b/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/CollectionDescriptor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle and/or its affiliates. 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.
@@ -18,27 +18,27 @@
/**
* Metadata class that describes a NoSql table which may also be referred
- * to as a Collection or Map depending on the database type.
+ * to as a Collection or Map depending on the database type.
* <p>
* Provisional API: This interface is part of an interim API that is still under development and
* expected to change significantly before reaching stability. It is available at this early stage
* to solicit feedback from pioneering adopters on the understanding that any code that uses this
* API will almost certainly be broken (repeatedly) as the API evolves.<p>
- *
+ *
* @author John Bracken
* @version 2.6
*/
public final class CollectionDescriptor {
-
+
/** Column descriptors associated with this collection */
private Map<String, ColumnDescriptor> columnDescriptors;
-
+
/** Name of this collection. */
private String name;
-
+
/**
* Constructor.
- *
+ *
* @param name name of the Mondgo collection
*/
public CollectionDescriptor(String name) {
@@ -46,73 +46,73 @@
this.name = name;
this.columnDescriptors = new HashMap<String, ColumnDescriptor>();
}
-
+
/**
* Adds a new {@link LeafColumnDescriptor} with the provided name.
- *
+ *
* @param name name of the column to add.
* @return the new {@link LeafColumnDescriptor}.
*/
public LeafColumnDescriptor addLeafColumn(String name) {
LeafColumnDescriptor column = new LeafColumnDescriptor(name);
this.columnDescriptors.put(name, column);
-
+
return column;
}
/**
* Adds a new {@link NestedColumnDescriptor} with the provided name.
- *
+ *
* @param name name of the column to add.
* @return the new {@link NestedColumnDescriptor}.
*/
public NestedColumnDescriptor addNestedColumn(String name) {
NestedColumnDescriptor column = new NestedColumnDescriptor(name);
this.columnDescriptors.put(name, column);
-
+
return column;
}
/**
* Returns the {@link ColumnDescriptor}s associated with this
* collection.
- *
- * @return the {@link CollectionDescriptor}s associated with
+ *
+ * @return the {@link CollectionDescriptor}s associated with
* this collection.
*/
public Iterable<? extends ColumnDescriptor> columns() {
return this.columnDescriptors.values();
}
-
+
/**
* Returns the {@link ColumnDescriptor} with the given name.
- *
+ *
* @param name the name of the {@link ColumnDescriptor}.
* @return the {@link ColumnDescriptor}.
*/
public ColumnDescriptor getColumn(String name) {
return this.columnDescriptors.get(name);
}
-
+
/**
* Returns the name of the Mongo collection represented by
* this descriptor.
- *
+ *
* @return the name of this collection descriptor.
*/
public String getName() {
return this.name;
}
-
+
/**
- * Removes the provided {@link ColumnDescriptor} from this
+ * Removes the provided {@link ColumnDescriptor} from this
* collection.
- *
- * @param columnDescriptor the column descriptor associated with
+ *
+ * @param columnDescriptor the column descriptor associated with
* this collection.
*/
public void removeColumn(ColumnDescriptor columnDescriptor) {
this.columnDescriptors.remove(columnDescriptor.getColumnName());
}
-}
+}
\ No newline at end of file
diff --git a/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/ColumnDescriptor.java b/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/ColumnDescriptor.java
index 602a142..fde6be0 100644
--- a/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/ColumnDescriptor.java
+++ b/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/ColumnDescriptor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/LeafColumnDescriptor.java b/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/LeafColumnDescriptor.java
index 0d20bf6..f631af4 100644
--- a/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/LeafColumnDescriptor.java
+++ b/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/LeafColumnDescriptor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/NestedColumnDescriptor.java b/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/NestedColumnDescriptor.java
index 8d6273e..31ba56c 100644
--- a/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/NestedColumnDescriptor.java
+++ b/tools/org.eclipse.persistence.tools.gen.nosql/src/org/eclipse/persistence/tools/gen/nosql/mongo/meta/NestedColumnDescriptor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle and/or its affiliates. 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.
diff --git a/tools/org.eclipse.persistence.tools.mapping.tests/antbuild.properties b/tools/org.eclipse.persistence.tools.mapping.tests/antbuild.properties
new file mode 100644
index 0000000..8bf469d
--- /dev/null
+++ b/tools/org.eclipse.persistence.tools.mapping.tests/antbuild.properties
@@ -0,0 +1,43 @@
+custom=true
+# Edit this if/when the release number changes
+release.version=2.6.0
+
+# Link to dependencies not in Git, assumes default location, if you store elsewhere you need to edit these.
+junit.lib=${extensions.depend.dir}/junit-4.11.jar
+hamcrest.lib=${extensions.depend.dir}/hamcrest-core-1.3.jar
+persistence.lib=${extensions.depend.dir}/javax.persistence_2.1.0.v201304241213.jar
+eclipselink.lib=${extensions.depend.dir}/eclipselink.jar
+
+# Edit this property to "true" to enable debug attributes like lines, variables and source-filename.
+javac.debug=true
+javac.debuglevel=lines,vars,source
+
+# Edit this property when you would like to override the java version during testing
+javac.version=1.6
+
+# Edit this property to increase the maxMemory heap memory used by the tests if you get an
+# OutOfMemoryException - use JConsole.exe to triage the memory spike at the end of the test
+# The current default is 768m (the LC "m" is required")
+max.heap.memory=768m
+
+# Do not edit the properties below.
+
+# General Infrastructure Definitions
+--------------------------------------
+test.properties=./test.properties
+classes.dir=target/classes
+report.dir=reports
+resource.dir=resource
+resource.source.dir=resource/source
+run.dir=run
+src.dir=src
+
+# Build Artifact Definitions
+-------------------------------
+
+# Mapping Tests Definitions
+----------------------------
+test.class=org.eclipse.persistence.tools.mapping.tests.AllMappingTests
+
+# General 3rd-Party API jar definitions
+-----------------------------------------
diff --git a/tools/org.eclipse.persistence.tools.mapping.tests/antbuild.xml b/tools/org.eclipse.persistence.tools.mapping.tests/antbuild.xml
index 61b441c..321f14b 100644
--- a/tools/org.eclipse.persistence.tools.mapping.tests/antbuild.xml
+++ b/tools/org.eclipse.persistence.tools.mapping.tests/antbuild.xml
@@ -1,51 +1,161 @@
-<?xml version="1.0"?>
-<!--
- Copyright (c) 2007, 2013 Oracle and/or its affiliates. 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.
+<!--/*******************************************************************************
+* 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.
+*
+* Ant naming conventions:
+* - regardless of the actual OS platform,'/' is the directory separator
+* (Ant will convert as appropriate).
+* - multi-word properties use periods '.'
+* - properties ending in .jar define jarfile names only (no path)
+* - properties ending in .lib are fully qualified jars (path and filename)
+* - properties ending in .dir are directory paths
+* - properties ending in .path are path refid names (classpath fragments)
+* - multi-word targets use hyphens '-'
+* - targets beginning with test- are reserved for high level test targets,
+* and are used in test results parsing
+* - targets typically use the form <action>-<object>-<type> (ie. package-bundle-zip)
+* - multi-word macros use underscores '_'
+* - multi-word macro attributes are concatenated
+* e.g. 'runpathref'
+* - multi-word tasks (taskdef) names are concatenated
+* e.g. 'validateconnection'
+* - OS environment variables are in ALLCAPS and have 'env' as a prefix
+* e.g. ${env.XXX}.
+* - Ant properties are lower case.
+*
+* Contributors:
+* pfilion - initial API and implementation
+#******************************************************************************/-->
- Contributors:
- Oracle - initial API and implementation
- -->
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.persistence.tools.mapping.tests"/>
+<!-- This ant project includes the following tasks:
+ - test (default) : runs AllMappingTests
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
+ It requires some configuration of the build.properties and test.properties to run.
+-->
+<project name="eclipselink.mapping.test" default="test" basedir=".">
+ <available file="../${ant.project.name}" type="dir" property="mapping.test.is.local"/>
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.persistence.tools.mapping.tests.AllMappingTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- </ant>
- </target>
+ <dirname property="mapping.test.build.location_temp" file="${ant.file.eclipselink.mapping.test}"/>
+ <pathconvert targetos="unix" property="mapping.test.build.location">
+ <path>
+ <pathelement location="${mapping.test.build.location_temp}"/>
+ </path>
+ </pathconvert>
+ <property name="env" environment="env" value="env"/>
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
+ <!-- Allows a user to overide certain user specific properties. -->
+ <!-- local property overrides -->
+ <condition property="custom.bld.properties.message" value="Loading user-defined overrides from '${user.home}/build.properties'..."
+ else="No user-defined overrides found to load ('${user.home}/build.properties' non-existant).">
+ <available file="${user.home}/build.properties"/>
+ </condition>
+ <echo message="${custom.bld.properties.message}"/>
+ <property file="${user.home}/build.properties"/>
+ <condition property="custom.tst.properties.message" value="Loading user-defined test overrides from '${user.home}/test.properties'..."
+ else="No user-defined test overrides found to load ('${user.home}/test.properties' non-existant).">
+ <available file="${user.home}/test.properties"/>
+ </condition>
+ <echo message="${custom.tst.properties.message}"/>
+ <property file="${user.home}/test.properties"/>
+ <!-- Allows overriding defaults where access to user.home isn't allowed -->
+ <condition property="custom.local.properties.message" value="Loading local overrides from '${basedir}/local.build.properties'..."
+ else="No Local overrides found to load. ('${basedir}/local.build.properties' non-existant).">
+ <available file="${basedir}/local.build.properties"/>
+ </condition>
+ <echo message="${custom.local.properties.message}"/>
+ <property file="${basedir}/local.build.properties"/>
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite, cleanup">
- </target>
+ <!-- Allows override of the build location or "basedir" for specific configurations (can specifically define mapping.test.basedir) -->
+ <property name="mapping.test.basedir" value="${mapping.test.build.location}"/>
+ <property file="${mapping.test.basedir}/antbuild.properties"/>
+ <!-- Allows specific suites/configurations to override defaults and add custom test (runtime) properties -->
+ <property file="${mapping.test.basedir}/${test.properties}"/>
+ <property file="${mapping.test.basedir}/test.properties"/>
+
+ <property name="mapping.test.common.plugins.dir" value="${tools.root}/target"/>
+
+ <property name="version.qualifier" value="qualifier"/>
+ <property name="version.string" value="${release.version}.${version.qualifier}"/>
+
+ <echo message="ant.project.name = '${ant.project.name}'"/>
+ <echo message="mapping.test.build.location = '${mapping.test.build.location}'"/>
+ <echo message="mapping.test.base.dir = '${mapping.test.base.dir}'"/>
+ <echo message="mapping.test.common.plugins.dir = '${mapping.test.common.plugins.dir}'"/>
+
+ <target name="config-classpath">
+ <config-run-path/>
+ </target>
+
+ <macrodef name="config-run-path">
+ <sequential>
+ <echo message="Configuring compile.path to:"/>
+ <echo message=" '${junit.lib}'"/>
+ <echo message=" '${hamcrest.lib}'"/>
+ <echo message=" '${persistence.lib}'"/>
+ <echo message=" '${eclipselink.lib}'"/>
+ <echo message=" '${mapping.test.common.plugins.dir}/org.eclipse.persistence.tools.utility_*.jar'"/>
+ <echo message=" '${mapping.test.common.plugins.dir}/org.eclipse.persistence.tools.mapping_*.jar'"/>
+ <echo message=" '${mapping.test.common.plugins.dir}/org.eclipse.persistence.tools.mapping.tests_*.jar'"/>
+ <echo message=" "/>
+ <path id="run.classpath">
+ <pathelement path="${junit.lib}"/>
+ <pathelement path="${hamcrest.lib}"/>
+ <pathelement path="${persistence.lib}"/>
+ <pathelement path="${eclipselink.lib}"/>
+ <fileset dir="${mapping.test.common.plugins.dir}" includes="org.eclipse.persistence.tools.utility_*.jar"/>
+ <fileset dir="${mapping.test.common.plugins.dir}" includes="org.eclipse.persistence.tools.mapping_*.jar"/>
+ <fileset dir="${mapping.test.common.plugins.dir}" includes="org.eclipse.persistence.tools.mapping.tests_*.jar"/>
+ </path>
+ </sequential>
+ </macrodef>
+
+ <!-- Clean all build generated content. -->
+ <target name="clean-test" description="Clean the test">
+ <delete dir="${mapping.test.basedir}/${report.dir}"/>
+ <delete dir="${mapping.test.basedir}/${run.dir}"/>
+ <mkdir dir="${mapping.test.basedir}/${report.dir}"/>
+ <mkdir dir="${mapping.test.basedir}/${run.dir}"/>
+ </target>
+
+ <!-- Default test target, run the AllMappingTests -->
+ <target name="test" depends="clean-test, config-classpath">
+ <antcall target="run-test" inheritRefs="true">
+ <param name="TEST_CLASS" value="${test.class}"/>
+ <param name="RUN_PATH" value="run.classpath"/>
+ </antcall>
+ <antcall target="generate-report" inheritRefs="true"/>
+ </target>
+
+ <!-- Generic target for running tests -->
+ <target name="run-test" depends="config-classpath">
+
+ <!-- Can be set e.g. in test.properties to add VM options for a particular platform/driver -->
+ <property name="additional.jvmargs" value="-Ddummy2=dummy"/>
+
+ <junit printsummary="yes" haltonfailure="yes" fork="yes" forkmode="once" showoutput="true" maxmemory="${max.heap.memory}" dir="${run.dir}">
+ <jvmarg value="-Declipselink.logging.level=${logging.level}"/>
+ <jvmarg line="${additional.jvmargs}"/>
+ <classpath>
+ <path refid="${RUN_PATH}"/>
+ </classpath>
+ <formatter type="xml"/>
+ <test name="${TEST_CLASS}" haltonfailure="no" outfile="${report.dir}/${TEST_CLASS}-test-results">
+ </test>
+ </junit>
+ </target>
+
+ <!-- Generate the EclipseLink Tools Mapping tests report -->
+ <target name="generate-report">
+ <junitreport todir="${mapping.test.basedir}/${report.dir}">
+ <fileset dir="${mapping.test.basedir}/${report.dir}">
+ <include name="*test-results.xml"/>
+ </fileset>
+ <report format="noframes" todir="${mapping.test.basedir}/${report.dir}"/>
+ </junitreport>
+ </target>
+
</project>
\ No newline at end of file
diff --git a/tools/org.eclipse.persistence.tools.mapping.tests/src/org/eclipse/persistence/tools/mapping/tests/AbstractExternalFormTests.java b/tools/org.eclipse.persistence.tools.mapping.tests/src/org/eclipse/persistence/tools/mapping/tests/AbstractExternalFormTests.java
index 64bfc24..953973c 100644
--- a/tools/org.eclipse.persistence.tools.mapping.tests/src/org/eclipse/persistence/tools/mapping/tests/AbstractExternalFormTests.java
+++ b/tools/org.eclipse.persistence.tools.mapping.tests/src/org/eclipse/persistence/tools/mapping/tests/AbstractExternalFormTests.java
@@ -15,27 +15,35 @@
import java.io.IOException;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import java.util.Random;
import org.eclipse.persistence.tools.mapping.ExternalForm;
+import org.eclipse.persistence.tools.utility.ClassTools;
import org.junit.Test;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
import org.w3c.dom.Node;
import static org.junit.Assert.*;
/**
+ * This test defines the behavior to test the manipulation of an XML document through an SPI.
+ *
* @version 2.6
*/
@SuppressWarnings("nls")
public abstract class AbstractExternalFormTests<T extends ExternalForm> {
/**
- * Populates
+ * Populates the given tester with the appropriate {@link NodeTester}.
*
- * @param tester
+ * @param tester The tester of the node to test
*/
protected abstract void populate(RootNodeTester<T> tester);
+ /**
+ * Performs the actual tests on the document for a particular node that is being manipulated by
+ * an {@link ExternalForm}.
+ */
@Test
public final void test() throws Exception {
DefaultRootNodeTester tester = new DefaultRootNodeTester();
@@ -44,27 +52,26 @@
}
/**
- * An <code>AttributeTester</code> tests setting and retrieving the value associated with
+ * An <code>AttributeNodeTester</code> tests setting and retrieving the value associated with
* an element's attribute.
*/
- public interface AttributeTester<T, VALUE> extends PropertyTester<T, VALUE> {
-
+ public interface AttributeNodeTester<T, VALUE> extends PropertyTester<T, VALUE> {
}
/**
- * An <code>AttributeTesterWrapper</code> tests setting and retrieving the value associated with
- * an element's attribute.
+ * An <code>AttributeNodeTesterRunner</code> tests setting and retrieving the value associated
+ * with an element's attribute.
* <p>
* <div nowrap>Form: <code><b><nodeName attributeName="value"/></b></div>
*/
- private class AttributeTesterWrapper extends NodeTesterWrapper {
+ private class AttributeNodeTesterRunner extends PropertyNodeTesterRunner {
/**
- * Creates a new <code>AttributeTesterWrapper</code>.
+ * Creates a new <code>AttributeNodeTesterRunner</code>.
*
* @param tester This object defines a single node to test an attribute node
*/
- AttributeTesterWrapper(AttributeTester<T, ?> tester) {
+ AttributeNodeTesterRunner(AttributeNodeTester<T, ?> tester) {
super(tester);
}
@@ -73,18 +80,882 @@
*/
@Override
String displayString() {
- return "<element " + tester.getNodeName() + "=\"...\">";
+ return "<" + parentNodeName + " " + getNodeName() + "=\"\">";
}
/**
* {@inheritDoc}
*/
@Override
- Node getNode(Node parent, String nodeName) {
+ int getChildrenCount(Node parentNode) {
+ return parentNode.getAttributes().getLength();
+ }
- if (parent.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element) parent;
- return element.getAttributes().getNamedItem(nodeName);
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ Node getNode(Node parentNode) {
+ return parentNode.getAttributes().getNamedItem(getNodeName());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ String getNodeValue(Node node) {
+ return node.getTextContent();
+ }
+ }
+
+ private class ChildListNodeRunnerAddingController extends Controller {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void log() {
+ System.out.println("<" + runner.parentNodeName + "><" + runner.tester.getNodeName() + "*> : addition");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ void test(T form, Node node) {
+
+ ChildListNodeTesterRunner runner = (ChildListNodeTesterRunner) this.runner;
+
+ // Create a random range within the list of values used to create the child nodes
+ Random random = new Random();
+ int count = runner.getDefaultChildrenCount();
+
+ int startIndex = random.nextInt(count);
+ int endIndex = random.nextInt(count);
+
+ // Make sure the start and end indices are not the same
+ while (endIndex == startIndex) {
+ endIndex = random.nextInt(count);
+ }
+
+ runner.currentChildrenCount = currentChildrenCount;
+ runner.addRange(startIndex, endIndex);
+ runner.rangeIndex = runner.ranges.size() - 1;
+ runner.testInitialState(form, node);
+ runner.testAdding(form, node);
+ runner.testReading(form, node);
+
+ currentChildrenCount = runner.currentChildrenCount;
+ }
+ }
+
+ private class ChildListNodeRunnerReadingController extends Controller {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void log() {
+ System.out.println("<" + runner.parentNodeName + "><" + runner.tester.getNodeName() + "*> : read");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ void test(T form, Node node) {
+
+ ChildListNodeTesterRunner runner = (ChildListNodeTesterRunner) this.runner;
+ int rangesCount = runner.ranges.size();
+
+ // Nothing to read
+ if (rangesCount == 0) {
+ return;
+ }
+
+ // Read a range randomly
+ Random random = new Random();
+ int rangeIndex = random.nextInt(rangesCount);
+ runner.rangeIndex = rangeIndex;
+
+ runner.currentChildrenCount = currentChildrenCount;
+ runner.testInitialState(form, node);
+ runner.testReading(form, node);
+
+ currentChildrenCount = runner.currentChildrenCount;
+ }
+ }
+
+ private class ChildListNodeRunnerRemovingController extends Controller {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void log() {
+ System.out.println("<" + runner.parentNodeName + "><" + runner.tester.getNodeName() + "*> : removal");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ void test(T form, Node node) {
+
+ ChildListNodeTesterRunner runner = (ChildListNodeTesterRunner) this.runner;
+ int rangesCount = runner.ranges.size();
+
+ // Nothing to read
+ if (rangesCount == 0) {
+ return;
+ }
+
+ // Read a range randomly
+ Random random = new Random();
+ int rangeIndex = random.nextInt(rangesCount);
+ runner.rangeIndex = rangeIndex;
+
+ runner.currentChildrenCount = currentChildrenCount;
+ runner.testInitialState(form, node);
+ runner.testRemoving(form, node);
+
+ currentChildrenCount = runner.currentChildrenCount;
+ }
+ }
+
+ /**
+ * This <code>ChildListNodeTester</code> tests a form when the node it represents can have zero
+ * or many child nodes of the same type (i.e. with the same node name).
+ */
+ public interface ChildListNodeTester<T, VALUE, CHILD_VALUE> extends NodeTester<T, VALUE> {
+
+ /**
+ * Adds a new child node to the node represented by the given form.
+ *
+ * @param form The external form being tested
+ * @param value The value used when creating the child node
+ * @return The external form representing the child node that was added to the node represented
+ * by the given form
+ */
+ VALUE addChild(T form, CHILD_VALUE value);
+
+ /**
+ * Returns the child node from the node represented by the given form at the given position.
+ *
+ * @param form The external form being tested
+ * @param index The position of the child node to retrieve
+ * @return The external form representing the child node at the given position
+ */
+ VALUE getChild(T form, int index);
+
+ /**
+ * Returns a list of the children node with the same type (i.e. with the same node name) that
+ * are children of the node represented by the given form.
+ *
+ * @param form The external form being tested
+ * @return An ordered list based on the sequence of children node
+ */
+ List<VALUE> getChildren(T form);
+
+ /**
+ * Returns the number of children of the node represented by the given form with the same type
+ * (i.e. with the same node name).
+ *
+ * @param form The external form being tested
+ * @return The count of children of the same type
+ */
+ int getChildrenSize(T form);
+
+ /**
+ * Returns the value that part of the list ({@link #getChildValues()}) and that was used to
+ * create a child form.
+ *
+ * @param childForm The child form from which the value used to create it should be returned
+ * @return The value retrieved from the child node
+ */
+ CHILD_VALUE getChildValue(VALUE childForm);
+
+ /**
+ * Returns a list of values that will be used to create children of the node represented by
+ * the form being tested. Each value will be used when calling {@link #addChild(Object, Object)}.
+ *
+ * @return A list of values, which should have more than 1 item
+ */
+ List<CHILD_VALUE> getChildValues();
+
+ /**
+ * Removes the child node from the node represented by the given form.
+ *
+ * @param form The external form being tested
+ * @param index The position of the child node within the list of children of the same type
+ * (i.e. with the same node name)
+ */
+ void removeChild(T form, int index);
+ }
+
+ /**
+ * A <code>ChildListNodeTesterRunner</code> TODO.
+ */
+ private class ChildListNodeTesterRunner extends NodeTesterRunner {
+
+ int currentChildListCount;
+ int rangeIndex;
+ List<Integer[]> ranges;
+
+ /**
+ * Creates a new <code>ChildListNodeTesterRunner</code>.
+ *
+ * @param tester This object defines a single child node to test
+ */
+ ChildListNodeTesterRunner(ChildListNodeTester<T, ?, ?> tester) {
+ super(tester);
+ initialize(tester);
+ }
+
+ void addRange(int startIndex, int endIndex) {
+ ranges.add(new Integer[] { Math.min(startIndex, endIndex), Math.max(startIndex, endIndex) });
+ }
+
+ private String displayString() {
+ return "<" + getNodeName() + ">";
+ }
+
+ private List<Node> getChildrenNodes(Node node) {
+
+ node = node.getFirstChild();
+ List<Node> children = new ArrayList<Node>();
+
+ while (node != null) {
+
+ if (getNodeName().equals(node.getNodeName())) {
+ children.add(node);
+ }
+
+ node = node.getNextSibling();
+ }
+
+ return children;
+ }
+
+ @SuppressWarnings("unchecked")
+ int getDefaultChildrenCount() {
+ ChildListNodeTester<T, Object, Object> tester = (ChildListNodeTester<T, Object, Object>) this.tester;
+ return tester.getChildValues().size();
+ }
+
+ private void initialize(ChildListNodeTester<T, ?, ?> tester) {
+
+ ranges = new ArrayList<Integer[]>();
+
+ List<?> childValues = tester.getChildValues();
+
+ if (!childValues.isEmpty()) {
+ assertTrue(
+ "The list of child values should contain at least 10 items for proper testing",
+ childValues.size() >= 10
+ );
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ boolean isMultipleSupported() {
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void test(T form, Node node) {
+ rangeIndex = ranges.size();
+ ranges.add(new Integer[] { 0, getDefaultChildrenCount() });
+ super.test(form, node);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ void testAdding(T form, Node parent) {
+
+ ChildListNodeTester<T, Object, Object> tester = (ChildListNodeTester<T, Object, Object>) this.tester;
+
+ // Retrieve the values that will be used to create the child nodes
+ List<Object> values = tester.getChildValues();
+ Integer[] range = ranges.get(rangeIndex);
+
+ // Create each child node
+ for (int index = range[0]; index < range[1]; index++) {
+
+ Object value = values.get(index);
+ assertNotNull("The child value cannot be null", value);
+
+ // Create the child node
+ Object childForm = tester.addChild(form, value);
+ currentChildrenCount++;
+ currentChildListCount++;
+
+ assertNotNull(
+ displayString() + " : The child form should have been created",
+ childForm
+ );
+
+ // Retrieve the list of child nodes and make sure it matches
+ // the number of child nodes that have been created so far
+ List<Node> childrenNode = getChildrenNodes(parent);
+
+ assertEquals(
+ displayString() + " : The child node was not created correctly",
+ currentChildListCount,
+ childrenNode.size()
+ );
+
+ // Make sure nothing else was created
+ assertEquals(
+ "The child node was not created correctly",
+ currentChildrenCount,
+ parent.getChildNodes().getLength()
+ );
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ void testInitialState(T form, Node parent) {
+
+ ChildListNodeTester<T, Object, Object> tester = (ChildListNodeTester<T, Object, Object>) this.tester;
+
+ assertEquals(
+ displayString() + " : Incorrect number of children was retrieved",
+ currentChildListCount,
+ tester.getChildren(form).size()
+ );
+
+ // Test to make sure the number of child nodes is correctly retrieved
+ assertEquals(
+ displayString() + " : The number of children is inconsistent",
+ currentChildListCount,
+ tester.getChildrenSize(form)
+ );
+
+ // Make sure nothing changed
+ assertEquals(
+ displayString() + " : The number of children is inconsistent",
+ currentChildrenCount,
+ parent.getChildNodes().getLength()
+ );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ void testReading(T form, Node node) {
+
+ ChildListNodeTester<T, Object, Object> tester = (ChildListNodeTester<T, Object, Object>) this.tester;
+ List<Object> values = tester.getChildValues();
+ List<Object> childForms = tester.getChildren(form);
+
+ assertEquals(
+ displayString() + " : The number of children is inconsistent",
+ currentChildListCount,
+ childForms.size()
+ );
+
+ Integer[] range = ranges.get(rangeIndex);
+
+ // Read each child within the range
+ for (int index = range[0]; index < range[1]; index++) {
+
+ // Translate the position to the actual position within the list of children
+ int translatedPosition = translatePosition(rangeIndex, index);
+
+ // Retrieve the child
+ Object childForm = tester.getChild(form, translatedPosition);
+
+ assertNotNull(
+ displayString() + " : The child form cannot be null",
+ childForm
+ );
+
+ // Retrieve the child value from the child form
+ Object childValue = tester.getChildValue(childForm);
+ Object expectedChildValue = values.get(index);
+
+ assertEquals(
+ displayString() + " : The child value was not retrieved correctly",
+ expectedChildValue,
+ childValue
+ );
+
+ // Retrieve the child
+ childForm = childForms.get(translatedPosition);
+
+ assertNotNull(
+ displayString() + " : The child form cannot be null",
+ childForm
+ );
+
+ // Retrieve the child value from the child form
+ childValue = tester.getChildValue(childForm);
+
+ assertEquals(
+ displayString() + " : The child value was not retrieved correctly",
+ expectedChildValue,
+ childValue
+ );
+ }
+
+ // Now test reading each child randomly
+ Random random = new Random();
+ List<Integer> positions = new ArrayList<Integer>();
+
+ for (int index = range[0]; index < range[1]; index++) {
+ positions.add(index);
+ }
+
+ while (!positions.isEmpty()) {
+
+ // Get a new random position
+ int position = (positions.size() == 1) ? 0 : random.nextInt(positions.size());
+ int index = positions.remove(position);
+
+ // Translate the position to the actual position within the list of children
+ int translatedPosition = translatePosition(rangeIndex, index);
+
+ // Retrieve the child form
+ Object childForm = tester.getChild(form, translatedPosition);
+
+ assertNotNull(
+ displayString() + " : The child form cannot be null",
+ childForm
+ );
+
+ // Retrieve the child value from the child form
+ Object childValue = tester.getChildValue(childForm);
+ Object expectedChildValue = values.get(index);
+
+ // Now retrieve the translated position within the list of values
+ assertEquals(
+ displayString() + " : The child value was not retrieved correctly",
+ expectedChildValue,
+ childValue
+ );
+
+ // Retrieve the child
+ childForm = childForms.get(translatedPosition);
+
+ assertNotNull(
+ displayString() + " : The child form cannot be null",
+ childForm
+ );
+
+ // Retrieve the child value from the child form
+ childValue = tester.getChildValue(childForm);
+
+ assertEquals(
+ displayString() + " : The child value was not retrieved correctly",
+ expectedChildValue,
+ childValue
+ );
+ }
+ }
+
+ private void testReadingAfterRemoval(ChildListNodeTester<T, Object, Object> tester,
+ T form,
+ List<Object> childForms,
+ List<Object> values,
+ int rangesIndexToSkip,
+ int offset) {
+
+ // Iterate through all the ranges to make sure every single child is correct
+ for (int rangesIndex = 0; rangesIndex < ranges.size(); rangesIndex++) {
+
+ // Skip the range that is being used to delete children
+ if (rangesIndex == rangesIndexToSkip) {
+ continue;
+ }
+
+ Integer[] range = ranges.get(rangesIndex);
+
+ // Iterate through a single range and check every child is read correctly
+ for (int rangeIndex = range[0]; rangeIndex < range[1]; rangeIndex++) {
+
+ // Translate the position to the actual position within the list of children
+ // but skip the range that is used to delete children, the offset the number
+ // of children contained by that range
+ int translatedPosition = translatePosition(rangesIndex, rangeIndex, rangesIndexToSkip);
+
+ // The position is after the index used to delete children, adjust the translated
+ // position by adding the count of remaining children that have not being deleted yet
+ if (rangesIndex > rangesIndexToSkip) {
+ translatedPosition += offset;
+ }
+
+ // Retrieve the child form
+ Object childForm = tester.getChild(form, translatedPosition);
+
+ assertNotNull(
+ displayString() + " : The child form cannot be null",
+ childForm
+ );
+
+ // Retrieve the child value from the child form
+ Object childValue = tester.getChildValue(childForm);
+ Object expectedChildValue = values.get(rangeIndex);
+
+ assertEquals(
+ displayString() + " : The child value was not retrieved correctly",
+ expectedChildValue,
+ childValue
+ );
+
+ // Retrieve the child
+ childForm = childForms.get(translatedPosition);
+
+ assertNotNull(
+ displayString() + " : The child form cannot be null",
+ childForm
+ );
+
+ // Retrieve the child value from the child form
+ childValue = tester.getChildValue(childForm);
+
+ assertEquals(
+ displayString() + " : The child value was not retrieved correctly",
+ expectedChildValue,
+ childValue
+ );
+ }
+ }
+ }
+
+ private void testReadingAfterRemoval(ChildListNodeTester<T, Object, Object> tester,
+ T form,
+ List<Object> childForms,
+ List<Object> values,
+ List<Integer> positions) {
+
+ int childIndex = 0;
+
+ for (Integer position : positions) {
+
+ // Retrieve the child form
+ Object childForm = tester.getChild(form, childIndex++);
+
+ assertNotNull(
+ displayString() + " : The child form cannot be null",
+ childForm
+ );
+
+ // Retrieve the child value from the child form
+ Object childValue = tester.getChildValue(childForm);
+ Object expectedChildValue = values.get(position);
+
+ assertEquals(
+ displayString() + " : The child value was not retrieved correctly",
+ expectedChildValue,
+ childValue
+ );
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ void testRemoving(T form, Node node) {
+
+ // Nothing to test
+ if (ranges.isEmpty()) {
+ return;
+ }
+
+ ChildListNodeTester<T, Object, Object> tester = (ChildListNodeTester<T, Object, Object>) this.tester;
+ Random random = new Random();
+ List<Object> values = tester.getChildValues();
+ List<Object> readOnlyChildForms = tester.getChildren(form);
+
+ // Now remove all the children at random position and
+ // test reading the remaining between each removal
+ Integer[] range = ranges.get(rangeIndex);
+ int rangeCount = ranges.size();
+
+ // Cache the positions
+ List<Integer> positions = new ArrayList<Integer>();
+
+ for (int index = range[0]; index < range[1]; index++) {
+ positions.add(index);
+ }
+
+ List<Integer> readOnlyPositions = new ArrayList<Integer>();
+ readOnlyPositions.addAll(positions);
+
+ while (!positions.isEmpty()) {
+
+ // Get a new random position
+ int position = (positions.size() == 1) ? 0 : random.nextInt(positions.size());
+ positions.remove(position);
+ readOnlyPositions.remove(position);
+
+ // Translate the position to the actual position within the list of children
+ // plus the position, which the number of items within the range used to delete
+ // children before the child being deleted
+ int translatedPosition = position;
+
+ if (rangeIndex > 0) {
+ int previousRangeIndex = rangeIndex - 1;
+ int lastRangeIndex = ranges.get(previousRangeIndex)[1];
+ translatedPosition += translatePosition(previousRangeIndex, lastRangeIndex);
+ }
+
+ // Retrieve the child form
+ tester.removeChild(form, translatedPosition);
+ currentChildrenCount--;
+ currentChildListCount--;
+
+ // Adjust the cached positions
+ for (int positionIndex = position; positionIndex < positions.size(); positionIndex++) {
+ positions.set(positionIndex, positions.get(positionIndex) - 1);
+ }
+
+ //
+ // Test 1: Make sure only one node was removed
+ //
+ // Test to make sure the parent node has the right amount of children left
+ assertEquals(
+ displayString() + " : The number of children is inconsistent",
+ currentChildListCount,
+ tester.getChildrenSize(form)
+ );
+
+ assertEquals(
+ displayString() + " : The number of children is inconsistent",
+ currentChildrenCount,
+ node.getChildNodes().getLength()
+ );
+
+ // Retrieve the values that will be used to create the child nodes
+ List<Object> childForms = tester.getChildren(form);
+
+ assertEquals(
+ displayString() + " : The number of children is inconsistent",
+ currentChildListCount,
+ childForms.size()
+ );
+
+ //
+ // Test 2: Read the other children to make sure the right one was removed
+ //
+ // Retrieve the child
+ if (rangeCount == 1) {
+ testReadingAfterRemoval(tester, form, readOnlyChildForms, values, readOnlyPositions);
+ }
+ else {
+ testReadingAfterRemoval(tester, form, childForms, values, rangeIndex, positions.size());
+ }
+ }
+
+ // Completed removing the children from the selected range
+ ranges.remove(rangeIndex);
+ }
+
+ private int translatePosition(int endRangesIndex, int rangeIndexToAdjust) {
+ return translatePosition(endRangesIndex, rangeIndexToAdjust, -1);
+ }
+
+ private int translatePosition(final int endRangesIndex,
+ final int rangeIndexToAdjust,
+ final int rangesIndexToSkip) {
+
+ int translatedPosition = 0;
+
+ for (int rangesIndex = 0; rangesIndex <= endRangesIndex; rangesIndex++) {
+
+ // Skip the specified range since work is being done with it
+ if (rangesIndex == rangesIndexToSkip) {
+ continue;
+ }
+
+ Integer[] range = ranges.get(rangesIndex);
+
+ // Quick calculation
+ if (rangesIndex != endRangesIndex) {
+ translatedPosition += (range[1] - range[0]);
+ }
+ // Adjust the index within the range that ends the translation
+ else {
+ translatedPosition += (rangeIndexToAdjust - range[0]);
+ }
+ }
+
+ return translatedPosition;
+ }
+ }
+
+ private class ChildNodeRunnerAddingController extends Controller {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void log() {
+ System.out.println("<" + runner.parentNodeName + "><" + runner.tester.getNodeName() + "> : addition");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ void test(T form, Node node) {
+
+ ChildNodeTesterRunner runner = (ChildNodeTesterRunner) this.runner;
+ runner.currentChildrenCount = currentChildrenCount;
+ runner.testInitialState(form, node);
+ runner.testAdding(form, node);
+
+ currentChildrenCount = runner.currentChildrenCount;
+ }
+ }
+
+ private class ChildNodeRunnerReadingController extends Controller {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void log() {
+ System.out.println("<" + runner.parentNodeName + "><" + runner.tester.getNodeName() + "> : addition");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ void test(T form, Node node) {
+
+ ChildNodeTesterRunner runner = (ChildNodeTesterRunner) this.runner;
+ runner.currentChildrenCount = currentChildrenCount;
+ runner.testInitialState(form, node);
+ runner.testReading(form, node);
+
+ currentChildrenCount = runner.currentChildrenCount;
+ }
+ }
+
+ private class ChildNodeRunnerRemovingController extends Controller {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void log() {
+ System.out.println("<" + runner.parentNodeName + "><" + runner.tester.getNodeName() + "> : addition");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ void test(T form, Node node) {
+
+ ChildNodeTesterRunner runner = (ChildNodeTesterRunner) this.runner;
+ runner.currentChildrenCount = currentChildrenCount;
+ runner.testInitialState(form, node);
+ runner.testRemoving(form, node);
+
+ currentChildrenCount = runner.currentChildrenCount;
+ }
+ }
+
+ /**
+ * This <code>ChildNodeTester</code> tests when a form add or remove a single child node.
+ */
+ public interface ChildNodeTester<T, VALUE extends ExternalForm> extends NodeTester<T, VALUE> {
+
+ /**
+ * Adds the single child node to the node represented by the given form.
+ *
+ * @param form The external form being tested
+ * @return The {@link ExternalForm} of the child node that was added
+ */
+ VALUE addChild(T form);
+
+ /**
+ * Retrieves the {@link ExternalForm} representing the single child node.
+ *
+ * @param form The external form being tested
+ * @return The {@link ExternalForm} representing the child node
+ */
+ VALUE getChild(T form);
+
+ /**
+ * Determines whether the given form has a child node with the specific node name.
+ *
+ * @param form The external form being tested
+ * @return <code>true</code> if the document has the single node as a child node of the node
+ * for which the given form represents; <code>false</code> if the node does not exist
+ */
+ boolean hasChild(T form);
+
+ /**
+ * Removes the single child node from the node represented by the given form.
+ *
+ * @param form The external form being tested
+ */
+ void removeChild(T form);
+ }
+
+ /**
+ * A <code>ChildNodeTesterRunner</code> tests to make sure the single child node is added and
+ * removed correctly from its parent node.
+ */
+ private class ChildNodeTesterRunner extends NodeTesterRunner {
+
+ /**
+ *
+ */
+ private boolean hasChild;
+
+ /**
+ * Creates a new <code>ChildNodeTesterRunner</code>.
+ *
+ * @param tester This object defines a single child node to test
+ */
+ ChildNodeTesterRunner(ChildNodeTester<T, ?> tester) {
+ super(tester);
+ }
+
+ private String displayString() {
+ return "<" + getNodeName() + ">";
+ }
+
+ private Node getChildNode(Node node) {
+
+ node = node.getFirstChild();
+
+ while (node != null) {
+
+ if (getNodeName().equals(node.getNodeName())) {
+ return node;
+ }
+
+ node = node.getNextSibling();
}
return null;
@@ -94,90 +965,245 @@
* {@inheritDoc}
*/
@Override
- String getNodeValue(Node node) {
- return node.getNodeValue();
+ boolean isMultipleSupported() {
+ return false;
}
- }
- public interface ChildNodeTester<T, VALUE> extends NodeTester<T, VALUE> {
- void addChild(T form);
- boolean hasChild(T form);
- void removeChild(T form);
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void testAdding(T form, Node node) {
+
+ // Don't add the child if it's not present
+ if (hasChild) {
+ return;
+ }
+
+ ChildNodeTester<T, ? extends ExternalForm> tester = (ChildNodeTester<T, ?>) this.tester;
+
+ // Add the child node
+ ExternalForm childForm = tester.addChild(form);
+ hasChild = true;
+ currentChildrenCount++;
+
+ assertNotNull(
+ displayString() + " : The child form should exist",
+ childForm
+ );
+
+ // Make sure the child node was indeed added
+ assertEquals(
+ displayString() + " : The number of children is inconsistent",
+ currentChildrenCount,
+ node.getChildNodes().getLength()
+ );
+
+ // Make sure the child node is correctly retrieved
+ assertTrue(
+ displayString() + " : The child node should have been found",
+ tester.hasChild(form)
+ );
+
+ // Make sure the right child node was added and is retrieved by the ExternalForm
+ assertNotNull(
+ displayString() + " : The child node should exist",
+ getChildNode(node)
+ );
+
+ // Make sure nothing changed
+ assertEquals(
+ displayString() + " : The child node should exist",
+ currentChildrenCount,
+ node.getChildNodes().getLength()
+ );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void testInitialState(T form, Node node) {
+
+ ChildNodeTester<T, ?> tester = (ChildNodeTester<T, ?>) this.tester;
+
+ // Make sure the child node does not exist
+ assertEquals(
+ displayString() + " : The child node should not exist",
+ hasChild,
+ tester.hasChild(form)
+ );
+
+ // Make sure nothing changed
+ assertEquals(
+ displayString() + " : The child node should not exist",
+ currentChildrenCount,
+ node.getChildNodes().getLength()
+ );
+
+ // The child node should not exist
+ if (hasChild) {
+ assertNotNull(
+ displayString() + " : The child node should exist",
+ getChildNode(node)
+ );
+ }
+ else {
+ assertNull(
+ displayString() + " : The child node should not exist",
+ getChildNode(node)
+ );
+ }
+
+ // Make sure nothing changed
+ assertEquals(
+ displayString() + " : The child node should not exist",
+ currentChildrenCount,
+ node.getChildNodes().getLength()
+ );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void testReading(T form, Node node) {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void testRemoving(T form, Node node) {
+
+ // Nothing to remove
+ if (!hasChild) {
+ return;
+ }
+
+ ChildNodeTester<T, ?> tester = (ChildNodeTester<T, ?>) this.tester;
+
+ // Make sure the child node exists
+ assertTrue(
+ displayString() + " : The child node should exist",
+ tester.hasChild(form)
+ );
+
+ // Make sure nothing changed with the previous check
+ assertEquals(
+ displayString() + " : The child node should exist",
+ currentChildrenCount,
+ node.getChildNodes().getLength()
+ );
+
+ // Remove the child node
+ tester.removeChild(form);
+ currentChildrenCount--;
+ hasChild = false;
+
+ // Make sure the child node was indeed removed
+ assertEquals(
+ displayString() + " : The child node should have been removed",
+ currentChildrenCount,
+ node.getChildNodes().getLength()
+ );
+
+ // Make sure the right child node was removed
+ assertNull(
+ displayString() + " : The wrong child node was removed",
+ getChildNode(node)
+ );
+
+ // Test to make sure the child node is not found
+ assertFalse(
+ displayString() + " : The child node should not exist",
+ tester.hasChild(form)
+ );
+ }
}
/**
- * A <code>ChildNodeTesterWrapper</code> TODO.
+ * A <code>Controller</code> wraps a {@link NodeTesterRunner} and executes one of the possible
+ * tests, which is either add, read or remove the property from the node being manipulated by
+ * the {@link ExternalForm}.
*/
- private class ChildNodeTesterWrapper extends NodeTesterWrapper {
+ private abstract class Controller {
/**
- * Creates a new <code>NullNodeTester</code>.
+ * The number of children the node currently has, which is required to make sure the runner
+ * tests the accuracy of the {@link ExternalForm} when it manipulates the node.
+ */
+ int currentChildrenCount;
+
+ /**
*
- * @param tester
*/
- ChildNodeTesterWrapper(ChildNodeTester<T, ?> tester) {
- super(tester);
- }
+ NodeTesterRunner runner;
+
+ /**
+ * Outputs what is being executed.
+ */
+ abstract void log();
+
+ /**
+ * Executes one of the operations that can be performed on an node.
+ *
+ * @param form The {@link ExternalForm} to test
+ * @param node The node that is manipulated by the given {@link ExternalForm}
+ */
+ abstract void test(T form, Node node);
/**
* {@inheritDoc}
*/
@Override
- String displayString() {
- return "<" + tester.getNodeName() + ">";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- Node getNode(Node parent, String nodeName) {
- return getChildNode(parent, nodeName);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- String getNodeValue(Node node) {
- return null;
+ public String toString() {
+ return getClass().getSimpleName();
}
}
private class DefaultRootNodeTester implements RootNodeTester<T> {
/**
- * The list of testers that used to test every single attribute nodes of the one represented
- * by this tester.
+ * The list of testers that used to test every single attribute
+ * nodes of the one represented by this tester.
*/
- private List<AttributeTesterWrapper> attributes;
+ private List<AttributeNodeTesterRunner> attributes;
/**
- *
+ * The builder of the {@link ExternalForm} to test.
*/
- private NodeBuilder<T> builder;
+ private ExternalFormBuilder<T> builder;
/**
* The list of testers that used to test every single child nodes of the one represented by
* this tester.
*/
- private List<NodeTesterWrapper> children;
+ private List<NodeTesterRunner> children;
/**
* Creates a new <code>DefaultRootNodeTester</code>.
*/
private DefaultRootNodeTester() {
super();
- attributes = new ArrayList<AttributeTesterWrapper>();
- children = new ArrayList<NodeTesterWrapper>();
+ attributes = new ArrayList<AttributeNodeTesterRunner>();
+ children = new ArrayList<NodeTesterRunner>();
}
/**
* {@inheritDoc}
*/
@Override
- public void addAttribute(AttributeTester<T, ?> tester) {
- attributes.add(new AttributeTesterWrapper(tester));
+ public void addAttribute(AttributeNodeTester<T, ?> tester) {
+ attributes.add(new AttributeNodeTesterRunner(tester));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void addListNodes(ChildListNodeTester<T, ?, ?> tester) {
+ children.add(new ChildListNodeTesterRunner(tester));
}
/**
@@ -185,7 +1211,7 @@
*/
@Override
public void addNode(ChildNodeTester<T, ?> tester) {
- children.add(new ChildNodeTesterWrapper(tester));
+ children.add(new ChildNodeTesterRunner(tester));
}
/**
@@ -193,69 +1219,294 @@
*/
@Override
public void addTextNode(TextNodeTester<T, ?> tester) {
- children.add(new TextNodeTesterWrapper(tester));
- }
-
- private Node getRootNode(Document document) {
- return document.getFirstChild();
+ children.add(new TextNodeTesterRunner(tester));
}
/**
* {@inheritDoc}
*/
@Override
- public void setBuilder(NodeBuilder<T> builder) {
- this.builder = builder;
+ public void addUnsupportedNode(String nodeName) {
+ children.add(new NotSupportedNodeTesterRunner(nodeName));
}
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ private Map<Class<NodeTesterRunner>, Class<Controller>[]> buildControllerTypes() {
+
+ Map classes = new HashMap();
+
+ classes.put(
+ ChildNodeTesterRunner.class,
+ new Class<?>[] {
+ ChildNodeRunnerAddingController.class,
+ ChildNodeRunnerReadingController.class,
+ ChildNodeRunnerRemovingController.class
+ }
+ );
+
+ classes.put(
+ TextNodeTesterRunner.class,
+ new Class<?>[] {
+ TextNodeRunnerAddingController.class,
+ TextNodeRunnerReadingController.class,
+ TextNodeRunnerRemovingController.class
+ }
+ );
+
+ classes.put(
+ ChildListNodeTesterRunner.class,
+ new Class<?>[] {
+ ChildListNodeRunnerAddingController.class,
+ ChildListNodeRunnerReadingController.class,
+ ChildListNodeRunnerRemovingController.class
+ }
+ );
+
+ return classes;
+ }
+
+ private String displayString() {
+ return "<" + builder.getNodeName() + ">";
+ }
+
+ private Node getNode(Node node) {
+
+ // The builder is for the root node
+ if (node.getNodeName().equals(builder.getNodeName())) {
+ return node;
+ }
+
+ // Dig into the DOM tree to find the child node
+ return getNode(node, builder.getTreeNodeNames());
+ }
+
+ private Node getNode(Node node, List<String> nodeNames) {
+
+ String nodeName = nodeNames.get(0);
+ node = node.getFirstChild();
+
+ while (node != null) {
+
+ if (node.getNodeName().equals(nodeName)) {
+
+ if (nodeNames.size() == 1) {
+ return node;
+ }
+
+ return getNode(node, nodeNames.subList(1, nodeName.length()));
+ }
+
+ node = node.getNextSibling();
+ }
+
+ return null;
+ }
+
+ private int getNodePositionOfInsertion(Node node) {
+
+ String nodeName = node.getNodeName();
+
+ for (int index = 0, count = children.size(); index < count; index++) {
+
+ NodeTesterRunner tester = children.get(index);
+
+ if (tester.getNodeName().equals(nodeName)) {
+ return index;
+ }
+ }
+
+ fail("The child node named <" + nodeName + "> is not included into the test");
+ return -1;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ public void setBuilder(ExternalFormBuilder<? extends T> builder) {
+ this.builder = (ExternalFormBuilder<T>) builder;
+ }
+
+ /**
+ * Tests the {@link ExternalForm}, which might have attributes and child nodes.
+ */
void test() throws Exception {
// Creates the ExternalForm
- T form = builder.build();
- assertNotNull("The external form cannot be null", form);
+ T form = builder.buildExternalForm();
- // Retrieve the root node
- Node parent = builder.getRootNode(form);
- assertNotNull("The parent cannot be null", parent);
+ assertNotNull(
+ displayString() + " : The external form cannot be null",
+ form
+ );
- Node expected = getRootNode(parent.getOwnerDocument());
- assertSame("The root node was not retrieved correctly", expected, parent);
+ // Retrieve the node represented by the ExternalForm
+ Node node = builder.getNode(form);
+
+ assertNotNull(
+ displayString() + " : The node cannot be null",
+ node
+ );
+
+ // Retrieve the node directly from the document
+ Node expectedNode = getNode(node.getOwnerDocument());
+
+ assertSame(
+ displayString() + " : The node was not retrieved correctly",
+ expectedNode,
+ node
+ );
// Test each attribute
- for (AttributeTesterWrapper tester : attributes) {
- tester.test(form, parent);
+ int defaultAttributeCount = builder.getDefaultAttributeCount();
+
+ for (AttributeNodeTesterRunner runner : attributes) {
+
+ runner.currentChildrenCount = defaultAttributeCount;
+ runner.parentNodeName = builder.getNodeName();
+ runner.test(form, node);
+
+ assertEquals(
+ displayString() + " : No number of attributes is inconsistent",
+ defaultAttributeCount,
+ node.getAttributes().getLength()
+ );
}
// Test each child node
- for (NodeTesterWrapper tester : children) {
- tester.test(form, parent);
+ for (NodeTesterRunner runner : children) {
+
+ runner.parentNodeName = builder.getNodeName();
+ runner.test(form, node);
+
+ assertEquals(
+ displayString() + " : No child nodes should have been left after a test",
+ 0,
+ node.getChildNodes().getLength()
+ );
+ }
+
+ // Now test manipulating the attributes in random order
+ testAttributesRandomly(form, node);
+
+ // Now test manipulating the child nodes in random order
+ testChildNodesRandomly(form, node);
+ }
+
+ private void testAttributesRandomly(T form, Node node) {
+ }
+
+ private void testChildNodesRandomly(T form, Node parent) throws Exception {
+
+ // The list of controllers is used to execute a single test for a particular,
+ // a list will be generated randomly to test the order
+ Map<Class<NodeTesterRunner>, Class<Controller>[]> controllerClasses = buildControllerTypes();
+ List<Controller> controllers = new ArrayList<Controller>();
+ Random random = new Random();
+
+ int childrenCount = children.size();
+ int controllerTypeCount = controllerClasses.size();
+ int executionCount = childrenCount * controllerTypeCount * 20;
+
+ // Let's run each Runner something like 20 times
+ for (int index = 0; index < executionCount; index++) {
+
+ // Get the runner randomly
+ int childIndex = random.nextInt(childrenCount);
+ NodeTesterRunner runner = children.get(childIndex);
+
+ // Get the controller type randomly
+ int controllerIndex = random.nextInt(controllerTypeCount);
+ Class<Controller>[] controllerTypes = controllerClasses.get(runner.getClass());
+
+ // Happen for unsupported node name
+ if (controllerTypes == null) {
+ continue;
+ }
+
+ Class<Controller> controllerType = controllerTypes[controllerIndex];
+
+ // Create the controller
+ Controller controller = ClassTools.newInstance(
+ controllerType,
+ AbstractExternalFormTests.class,
+ AbstractExternalFormTests.this
+ );
+
+ controller.runner = runner;
+ controllers.add(controller);
+ }
+
+ // Run each controller and keep the child nodes count up to date
+ for (Controller controller : controllers) {
+
+ controller.currentChildrenCount = parent.getChildNodes().getLength();
+// controller.log();
+ controller.test(form, parent);
+
+ // Retrieve the ordinal of each child node
+ Node childNode = parent.getFirstChild();
+
+ if (childNode != null) {
+
+ List<Integer> nodePositions = new ArrayList<Integer>();
+
+ do {
+ int nodePosition = getNodePositionOfInsertion(childNode);
+ nodePositions.add(nodePosition);
+ childNode = childNode.getNextSibling();
+ }
+ while (childNode != null);
+
+ // Make sure the ordinal numbers are from the smaller number to the biggest number
+ int previousPosition = -1;
+
+ for (int nodePosition : nodePositions) {
+
+ if (nodePosition < previousPosition) {
+ fail("The insertion was not performed following the ordering.");
+ }
+ }
+ }
}
}
}
/**
- * A builder creates the document and element tree
+ * A <code>ExternalFormBuilder</code> is responsible to create the {@link ExternalForm} to be tested.
*/
- public interface NodeBuilder<T> {
+ public interface ExternalFormBuilder<T extends ExternalForm> {
/**
- * Creates
+ * Creates the {@link ExternalForm} to test.
*
- * @return
- * @throws IOException
+ * @return The {@link ExternalForm} to test
+ * @throws IOException If an error occurred during the creation process
*/
- T build() throws IOException;
+ T buildExternalForm() throws IOException;
/**
- * Returns
+ * Returns the number of attributes the {@link Node} contains before any manipulation has been performed.
*
- * @param form
- * @return
+ * @return The count of children before any testing has been done
*/
- Node getRootNode(T form);
+ int getDefaultAttributeCount();
+
+ /**
+ * Returns the node represented by the {@link ExternalForm}.
+ *
+ * @param form The {@link ExternalForm} for which to return its node
+ * @return The node from the document that is been manipulated
+ */
+ Node getNode(T form);
+
+ String getNodeName();
+
+ List<String> getTreeNodeNames();
}
- public interface NodeTester<T, Value> {
+ private interface NodeTester<T, Value> {
/**
* Retrieves the name of the node for which retrieving and setting its value is tested.
@@ -265,7 +1516,17 @@
String getNodeName();
}
- private abstract class NodeTesterWrapper {
+ private abstract class NodeTesterRunner {
+
+ /**
+ *
+ */
+ int currentChildrenCount;
+
+ /**
+ *
+ */
+ String parentNodeName;
/**
* This object defines a single node to test (which is either a child element or an attribute).
@@ -275,142 +1536,478 @@
/**
* Creates a new <code>AbstractNodeTester</code>.
*
- * @param tester This object defines a single node to test (which is either a child element
- * or an attribute)
+ * @param tester The bridge between this tester and the document's node being tested
*/
@SuppressWarnings("unchecked")
- NodeTesterWrapper(NodeTester<T, ?> tester) {
+ NodeTesterRunner(NodeTester<T, ?> tester) {
super();
this.tester = (NodeTester<T, Object>) tester;
+ assertNotNull("The tester cannot be null", tester);
+ assertNotNull("The node name cannot be null", tester.getNodeName());
}
- abstract String displayString();
-
- final Node getChildNode(Node parent, String nodeName) {
-
- parent = parent.getFirstChild();
-
- while (parent != null) {
-
- if (nodeName.equals(parent.getNodeName())) {
- return parent;
- }
-
- parent = parent.getNextSibling();
- }
-
- return null;
+ /**
+ * Returns the name of the node for which this runner tests.
+ *
+ * @return The node name
+ */
+ final String getNodeName() {
+ return tester.getNodeName();
}
- abstract Node getNode(Node parent, String nodeName);
+ /**
+ * Determines whether
+ *
+ * @return
+ */
+ abstract boolean isMultipleSupported();
- abstract String getNodeValue(Node node);
+ /**
+ * Tests the given {@link ExternalForm} by manipulating the node for a single property.
+ *
+ * @param form The {@link ExternalForm} to test
+ * @param node The node that is manipulated by the given {@link ExternalForm}
+ */
+ void test(T form, Node node) {
+ testInitialState(form, node);
+ testAdding(form, node);
+ testReading(form, node);
+ testRemoving(form, node);
+ }
- void test(T form, Node parent) {
+ /**
+ * Tests the given {@link ExternalForm} by adding the property to the node.
+ *
+ * @param form The {@link ExternalForm} to test
+ * @param node The node that is manipulated by the given {@link ExternalForm}
+ */
+ abstract void testAdding(T form, Node node);
-// // Node name
-// String nodeName = tester.getNodeName();
-// assertNotNull("The node name cannot be null", nodeName);
-//
-// // The element should be empty
-// assertEquals(displayString() + " : The element should not have any children", 0, parent.getChildNodes().getLength());
-//
-// // The child node should not exist
-// Node childNode = getNode(parent, nodeName);
-// assertNull(displayString() + " : The node name should be null", childNode);
-//
-// // The node value should not exist
-// Object result = tester.getValue(form);
-// assertNull(displayString() + " : The element's value should be null", result);
-// assertEquals(displayString() + " : The element should not have any children", 0, parent.getChildNodes().getLength());
-//
-// // The child node should still not exist
-// childNode = getNode(parent, nodeName);
-// assertNull(displayString() + " : The node name should be null", childNode);
-// assertEquals(displayString() + " : The element should not have any children", 0, parent.getChildNodes().getLength());
-//
-// // Change the node value (null)
-// tester.setValue(form, null);
-// assertEquals(displayString() + " : The element should not have any children", 0, parent.getChildNodes().getLength());
-//
-// // Make sure nothing changed
-// result = tester.getValue(form);
-// assertNull(displayString() + " : The element's value should be null", result);
-//
-// // Change the value to something
-// Object expectedValue1 = tester.getValue1();
-// assertNotNull(displayString() + " : Value 1 cannot be null", expectedValue1);
-// tester.setValue(form, expectedValue1);
-//
-// // The child node should have been added
-// childNode = getNode(parent, nodeName);
-// assertNotNull(displayString() + " : The node cannot be null", childNode);
-// assertEquals(displayString() + " : The element should have a single child", 1, parent.getChildNodes().getLength());
-//
-// // Get the value
-// result = tester.getValue(form);
-// assertEquals(displayString() + "The element's value was not set correctly", expectedValue1, result);
-//
-// // Get the value directly
-// String stringResult = getNodeValue(childNode);
-// String stringNodeValue = tester.toString(expectedValue1);
-// assertEquals(displayString() + " : The value was not set correctly", stringNodeValue, stringResult);
-//
-// // Change the value to something else
-// Object expectedValue2 = tester.getValue2();
-// assertNotSame(displayString() + " : Value 1 and value 2 cannot be the same", expectedValue1, expectedValue2);
-// tester.setValue(form, expectedValue2);
-//
-// // Get the value
-// result = tester.getValue(form);
-// assertEquals(displayString() + " The element's value was not set correctly", expectedValue2, result);
-//
-// // Get the value directly
-// stringResult = getNodeValue(childNode);
-// stringNodeValue = tester.toString(expectedValue2);
-// assertEquals(displayString() + " : The element's value was not set correctly", stringNodeValue, stringResult);
-//
-// // Change the node value (null)
-// tester.setValue(form, null);
-// assertEquals(displayString() + " : The element should not have any children", 0, parent.getChildNodes().getLength());
+ /**
+ * Tests the given {@link ExternalForm} by making sure the given node is in its original state.
+ *
+ * @param form The {@link ExternalForm} to test
+ * @param node The node that is manipulated by the given {@link ExternalForm}
+ */
+ abstract void testInitialState(T form, Node node);
+
+ /**
+ * Tests the given {@link ExternalForm} by reading the property from the node.
+ *
+ * @param form The {@link ExternalForm} to test
+ * @param node The node that is manipulated by the given {@link ExternalForm}
+ */
+ abstract void testReading(T form, Node node);
+
+ /**
+ * Tests the given {@link ExternalForm} by removing the property from the node.
+ *
+ * @param form The {@link ExternalForm} to test
+ * @param node The node that is manipulated by the given {@link ExternalForm}
+ */
+ abstract void testRemoving(T form, Node node);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ return getClass().getSimpleName() + " : " + tester.getNodeName();
}
}
- private abstract class PropertyNodeTesterWrapper extends NodeTesterWrapper {
+ private class NotSupportedNodeTester implements NodeTester<T, Object> {
/**
- * Creates a new <code>PropertyNodeTesterWrapper</code>.
- *
- * @param tester This object defines a single node to test a child text node
+ * The name of the node that is currently not supported by the {@link ExternalForm}.
*/
- PropertyNodeTesterWrapper(PropertyTester<T, ?> tester) {
- super(tester);
+ private String nodeName;
+
+ /**
+ * Creates a new <code>NotSupportedNodeTester</code>.
+ *
+ * @param nodeName The name of the node that is currently not supported by the {@link ExternalForm}
+ */
+ NotSupportedNodeTester(String nodeName) {
+ super();
+ this.nodeName = nodeName;
}
/**
* {@inheritDoc}
*/
@Override
- Node getNode(Node parent, String nodeName) {
-
- parent = parent.getFirstChild();
-
- while (parent != null) {
-
- if (nodeName.equals(parent.getNodeName())) {
- return parent;
- }
-
- parent = parent.getNextSibling();
- }
-
- return null;
+ public String getNodeName() {
+ return nodeName;
}
}
+ private class NotSupportedNodeTesterRunner extends NodeTesterRunner {
+
+ /**
+ * Creates a new <code>NotSupportedNodeTesterRunner</code>.
+ *
+ * @param nodeName The name of the node that is currently not supported by the {@link ExternalForm}
+ */
+ NotSupportedNodeTesterRunner(String nodeName) {
+ super(new NotSupportedNodeTester(nodeName));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ boolean isMultipleSupported() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void testAdding(T form, Node node) {
+ // Nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void testInitialState(T form, Node node) {
+ // Nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void testReading(T form, Node node) {
+ // Nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void testRemoving(T form, Node node) {
+ // Nothing to do
+ }
+ }
+
+ private abstract class PropertyNodeTesterRunner extends NodeTesterRunner {
+
+ /**
+ * Keeps track of the status of the node's existence.
+ */
+ private boolean nodeExists;
+
+ /**
+ * Creates a new <code>PropertyNodeTesterRunner</code>.
+ *
+ * @param tester This object defines a single node to test a child text node
+ */
+ PropertyNodeTesterRunner(PropertyTester<T, ?> tester) {
+ super(tester);
+ }
+
+ /**
+ * Returns
+ *
+ * @return
+ */
+ abstract String displayString();
+
+ /**
+ * Returns the number of children owned by the given parent {@link Node}.
+ *
+ * @param parentNode The owner of the child node being tested
+ * @return The count of children, which could be either attributes or child nodes
+ */
+ abstract int getChildrenCount(Node parentNode);
+
+ /**
+ * Returns
+ *
+ * @param parentNode
+ * @return
+ */
+ abstract Node getNode(Node parentNode);
+
+ /**
+ * Returns
+ *
+ * @param node
+ * @return
+ */
+ abstract String getNodeValue(Node node);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ final boolean isMultipleSupported() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void testAdding(T form, Node parentNode) {
+
+ PropertyTester<T, Object> tester = (PropertyTester<T, Object>) this.tester;
+
+ // Change the node value to null
+ if (tester.isNullAllowed()) {
+
+ tester.setValue(form, null);
+
+ assertEquals(
+ displayString() + " : The element should not have any children",
+ 0,
+ getChildrenCount(parentNode) - currentChildrenCount
+ );
+
+ // Make sure nothing changed
+ Object result = tester.getValue(form);
+
+ assertNull(
+ displayString() + " : The element's value should be null",
+ result
+ );
+
+ // Make sure nothing changed
+ assertEquals(
+ displayString() + " : The element should not have any children",
+ 0,
+ getChildrenCount(parentNode) - currentChildrenCount
+ );
+ }
+
+ // Change the value to something
+ Object expectedValue1 = tester.getValue1();
+
+ assertNotNull(
+ displayString() + " : Value 1 cannot be null",
+ expectedValue1
+ );
+
+ tester.setValue(form, expectedValue1);
+
+ // The child node should have been added
+ Node childNode = getNode(parentNode);
+
+ assertNotNull(
+ displayString() + " : The node cannot be null",
+ childNode
+ );
+
+ assertEquals(
+ displayString() + " : The element should have a " + (nodeExists ? currentChildrenCount : currentChildrenCount + 1) + " children",
+ nodeExists ? 0 : 1,
+ getChildrenCount(parentNode) - currentChildrenCount
+ );
+
+ // Get the value
+ Object result = tester.getValue(form);
+
+ assertEquals(
+ displayString() + "The element's value was not set correctly",
+ expectedValue1,
+ result
+ );
+
+ // Get the value directly
+ String stringResult = getNodeValue(childNode);
+ String stringNodeValue = tester.toString(expectedValue1);
+
+ assertEquals(
+ displayString() + " : The value was not set correctly",
+ stringNodeValue,
+ stringResult
+ );
+
+ // Change the value to something else
+ Object expectedValue2 = tester.getValue2();
+ assertNotNull(displayString() + " : Value 2 cannot be null", expectedValue2);
+
+ assertNotSame(
+ displayString() + " : Value 1 and value 2 cannot be the same",
+ expectedValue1,
+ expectedValue2
+ );
+
+ tester.setValue(form, expectedValue2);
+
+ // Get the value
+ result = tester.getValue(form);
+
+ assertEquals(
+ displayString() + " The element's value was not set correctly",
+ expectedValue2,
+ result
+ );
+
+ // Get the value directly
+ stringResult = getNodeValue(childNode);
+ stringNodeValue = tester.toString(expectedValue2);
+
+ assertEquals(
+ displayString() + " : The element's value was not set correctly",
+ stringNodeValue,
+ stringResult
+ );
+
+ // Change the value back to its original value
+ tester.setValue(form, tester.getDefaultValue());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void testInitialState(T form, Node parent) {
+
+ PropertyTester<T, Object> tester = (PropertyTester<T, Object>) this.tester;
+ nodeExists |= tester.doesNodeExistAlready();
+
+ // Node name
+ String nodeName = getNodeName();
+ assertNotNull("The node name cannot be null", nodeName);
+
+ // Test the initial state of the parent node
+ assertEquals(
+ displayString() + " : The parent node child count is incorrect",
+ 0,
+ getChildrenCount(parent) - currentChildrenCount
+ );
+
+ // The child node should either not exist or already being present
+ Node childNode = getNode(parent);
+
+ if (nodeExists) {
+ assertNotNull(
+ displayString() + " : The node should not be null",
+ childNode
+ );
+ }
+ else {
+ assertNull(
+ displayString() + " : The node should be null",
+ childNode
+ );
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void testReading(T form, Node node) {
+
+ PropertyTester<T, Object> tester = (PropertyTester<T, Object>) this.tester;
+
+ // The node value should either be null or not null
+ Object result = tester.getValue(form);
+
+ // Make sure the node's value is not null
+ if (nodeExists) {
+ assertNotNull(
+ displayString() + " : The element's value should not be null",
+ result
+ );
+ assertSame(
+ displayString() + " : The element's value was not retrived correctly",
+ tester.getDefaultValue(),
+ result
+ );
+ }
+ // The node is not present, make sure reading its value returns null
+ else {
+ assertNull(
+ displayString() + " : The element's value should be null",
+ result
+ );
+ }
+
+ // Make sure nothing changed by reading the node's value
+ assertEquals(
+ displayString() + " : The element should not have any children",
+ 0,
+ getChildrenCount(node) - currentChildrenCount
+ );
+
+ // Retrieve the actual node
+ Node childNode = getNode(node);
+
+ if (nodeExists) {
+ assertNotNull(
+ displayString() + " : The node should not be null",
+ childNode
+ );
+ }
+ else {
+ assertNull(
+ displayString() + " : The node should be null",
+ childNode
+ );
+ }
+
+ // Make sure nothing changed after retrieving the node
+ assertEquals(
+ displayString() + " : The element should not have any children",
+ 0,
+ getChildrenCount(node) - currentChildrenCount
+ );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void testRemoving(T form, Node parentNode) {
+
+ PropertyTester<T, Object> tester = (PropertyTester<T, Object>) this.tester;
+
+ // Change the node value to null, which will remove it from the parent node
+ if (tester.isNullAllowed()) {
+
+ tester.setValue(form, null);
+
+ assertEquals(
+ displayString() + " : The child count does not match the current state",
+ 0,
+ getChildrenCount(parentNode) - currentChildrenCount
+ );
+ }
+ }
+ }
+
+ /**
+ * A <code>PropertyTester</code> handles testing either an attribute or a single child node of
+ * the node being tested.
+ */
private interface PropertyTester<T, VALUE> extends NodeTester<T, VALUE> {
/**
+ * Determines whether the property is by default present in the document.
+ *
+ * @return <code>true</code> if the property exists before any changes is done to the document;
+ * <code>false</code> otherwise
+ */
+ boolean doesNodeExistAlready();
+
+ /**
+ * If {@link #doesNodeExistAlready()} returns <code>true</code>, then this should return the
+ * node value that is already present in the document, which is done before the document is
+ * being changed.
+ *
+ * @return Either a non-<code>null</code> value if the node is present in the document or
+ * <code>null</code> if the node is not by default present in the document
+ */
+ VALUE getDefaultValue();
+
+ /**
* Retrieves the value of the node.
*
* @param form The external form that will retrieve the value
@@ -435,6 +2032,13 @@
VALUE getValue2();
/**
+ * Determines whether the node can receive a <code>null</code> value or not.
+ *
+ * @return <code>true</code> if <code>null</code> is a valid value; <code>false</code> otherwise
+ */
+ boolean isNullAllowed();
+
+ /**
* Sets the value of the node.
*
* @param form The external form that will set the value
@@ -452,37 +2056,133 @@
}
/**
- *
+ * A <code>RootNodeTester</code> is the container of all the testers that will test every single
+ * property of the node to test, i.e. its attributes and child nodes.
*/
public interface RootNodeTester<T extends ExternalForm> {
/**
- * Adds
+ * Adds the given tester when the form has an attribute.
*
- * @param tester
+ * @param tester The tester for a single attribute
*/
- void addAttribute(AttributeTester<T, ?> tester);
+ void addAttribute(AttributeNodeTester<T, ?> tester);
/**
- * Adds
+ * Adds the given tester when the form representing the node it represents can have zero or
+ * many child nodes of the same type (i.e. with the same node name).
*
- * @param tester
+ * @param tester The tester for a list of child nodes with the same type
+ */
+ void addListNodes(ChildListNodeTester<T, ?, ?> tester);
+
+ /**
+ * Adds the given tester when the form representing the node it represents can have one child
+ * node of a certain type.
+ *
+ * @param tester The tester for a single child node
*/
void addNode(ChildNodeTester<T, ?> tester);
/**
- * Adds
+ * Adds the given tester when the form has a single child node that is a text node.
*
- * @param tester
+ * @param tester The tester for a single child text node
*/
void addTextNode(TextNodeTester<T, ?> tester);
/**
- * Sets
+ * Adds the given node name to indicate it is part of the "root" node but it is not supported
+ * by the {@link ExternalForm} yet.
*
- * @param builder
+ * @param nodeName The name of the node not currently supported
*/
- void setBuilder(NodeBuilder<T> builder);
+ void addUnsupportedNode(String nodeName);
+
+ /**
+ * Sets the builder that will create the document and tree node representation down to node to test.
+ *
+ * @param builder The builder of the node to test
+ */
+ void setBuilder(ExternalFormBuilder<? extends T> builder);
+ }
+
+ private class TextNodeRunnerAddingController extends Controller {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void log() {
+ System.out.println("<" + runner.parentNodeName + "><" + runner.tester.getNodeName() + "> : addition");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ void test(T form, Node node) {
+
+ TextNodeTesterRunner runner = (TextNodeTesterRunner) this.runner;
+ runner.currentChildrenCount = currentChildrenCount;
+ runner.testInitialState(form, node);
+ runner.testAdding(form, node);
+
+ currentChildrenCount = runner.currentChildrenCount;
+ }
+ }
+
+ private class TextNodeRunnerReadingController extends Controller {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void log() {
+ System.out.println("<" + runner.parentNodeName + "><" + runner.tester.getNodeName() + "> addition");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ void test(T form, Node node) {
+
+ TextNodeTesterRunner runner = (TextNodeTesterRunner) this.runner;
+ runner.currentChildrenCount = currentChildrenCount;
+ runner.testInitialState(form, node);
+ runner.testReading(form, node);
+
+ currentChildrenCount = runner.currentChildrenCount;
+ }
+ }
+
+ private class TextNodeRunnerRemovingController extends Controller {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ void log() {
+ System.out.println("<" + runner.parentNodeName + "><" + runner.tester.getNodeName() + "> : addition");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ void test(T form, Node node) {
+
+ TextNodeTesterRunner runner = (TextNodeTesterRunner) this.runner;
+ runner.currentChildrenCount = currentChildrenCount;
+ runner.testInitialState(form, node);
+ runner.testRemoving(form, node);
+
+ currentChildrenCount = runner.currentChildrenCount;
+ }
}
/**
@@ -492,18 +2192,18 @@
}
/**
- * <p>A <code>TextNodeTesterWrapper</code> tests setting and retrieving the value associated with
+ * <p>A <code>TextNodeTesterRunner</code> tests setting and retrieving the value associated with
* a text node.</p>
* <div nowrap>Form: <code><b><node_name>text</node_name></b></code>.</div>
*/
- private class TextNodeTesterWrapper extends PropertyNodeTesterWrapper {
+ private class TextNodeTesterRunner extends PropertyNodeTesterRunner {
/**
- * Creates a new <code>TextNodeTesterWrapper</code>.
+ * Creates a new <code>TextNodeTesterRunner</code>.
*
* @param tester This object defines a single node to test a child text node
*/
- TextNodeTesterWrapper(TextNodeTester<T, ?> tester) {
+ TextNodeTesterRunner(TextNodeTester<T, ?> tester) {
super(tester);
}
@@ -512,7 +2212,35 @@
*/
@Override
String displayString() {
- return "<element \"" + tester.getNodeName() + "\">";
+ return "<" + parentNodeName + "><" + getNodeName() + "></>";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ int getChildrenCount(Node parentNode) {
+ return parentNode.getChildNodes().getLength();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ Node getNode(Node node) {
+
+ node = node.getFirstChild();
+
+ while (node != null) {
+
+ if (getNodeName().equals(node.getNodeName())) {
+ return node;
+ }
+
+ node = node.getNextSibling();
+ }
+
+ return null;
}
/**
@@ -520,7 +2248,7 @@
*/
@Override
String getNodeValue(Node node) {
- return null;
+ return node.getTextContent();
}
}
}
\ No newline at end of file
diff --git a/tools/org.eclipse.persistence.tools.mapping.tests/src/org/eclipse/persistence/tools/mapping/tests/dom/orm/ORMConfigurationTests.java b/tools/org.eclipse.persistence.tools.mapping.tests/src/org/eclipse/persistence/tools/mapping/tests/dom/orm/ORMConfigurationTests.java
index 15a5d2c..19bdc48 100644
--- a/tools/org.eclipse.persistence.tools.mapping.tests/src/org/eclipse/persistence/tools/mapping/tests/dom/orm/ORMConfigurationTests.java
+++ b/tools/org.eclipse.persistence.tools.mapping.tests/src/org/eclipse/persistence/tools/mapping/tests/dom/orm/ORMConfigurationTests.java
@@ -14,10 +14,28 @@
package org.eclipse.persistence.tools.mapping.tests.dom.orm;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import java.util.Vector;
import javax.xml.XMLConstants;
+import org.eclipse.persistence.tools.mapping.orm.AccessType;
+import org.eclipse.persistence.tools.mapping.orm.ExternalBasicNamedQuery;
+import org.eclipse.persistence.tools.mapping.orm.ExternalClassConverter;
+import org.eclipse.persistence.tools.mapping.orm.ExternalEmbeddable;
+import org.eclipse.persistence.tools.mapping.orm.ExternalEntity;
+import org.eclipse.persistence.tools.mapping.orm.ExternalMappedSuperClass;
+import org.eclipse.persistence.tools.mapping.orm.ExternalNamedStoredProcedureQuery;
+import org.eclipse.persistence.tools.mapping.orm.ExternalNativeQuery;
import org.eclipse.persistence.tools.mapping.orm.ExternalORMConfiguration;
+import org.eclipse.persistence.tools.mapping.orm.ExternalObjectTypeConverter;
import org.eclipse.persistence.tools.mapping.orm.ExternalPersistenceUnit;
+import org.eclipse.persistence.tools.mapping.orm.ExternalSQLResultSetMapping;
+import org.eclipse.persistence.tools.mapping.orm.ExternalSequenceGenerator;
+import org.eclipse.persistence.tools.mapping.orm.ExternalStructConverter;
+import org.eclipse.persistence.tools.mapping.orm.ExternalTableGenerator;
+import org.eclipse.persistence.tools.mapping.orm.ExternalTenantDiscriminatorColumn;
+import org.eclipse.persistence.tools.mapping.orm.ExternalTypeConverter;
import org.eclipse.persistence.tools.mapping.orm.ORMDocumentType;
import org.eclipse.persistence.tools.mapping.orm.dom.ORMConfiguration;
import org.eclipse.persistence.tools.mapping.orm.dom.ORMRepository;
@@ -25,14 +43,69 @@
import org.w3c.dom.Node;
/**
+ * This unit-tests tests the behavior of {@link ExternalORMConfiguration}.
+ *
* @version 2.6
*/
@SuppressWarnings("nls")
public final class ORMConfigurationTests extends AbstractExternalFormTests<ExternalORMConfiguration> {
+ private String buildAccessMethodsTester() {
+ return "access-methods";
+ }
+
+ private TextNodeTester<ExternalORMConfiguration, AccessType> buildAccessTester() {
+ return new TextNodeTester<ExternalORMConfiguration, AccessType>() {
+ @Override
+ public boolean doesNodeExistAlready() {
+ return false;
+ }
+ @Override
+ public AccessType getDefaultValue() {
+ return null;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalORMConfiguration.ACCESS;
+ }
+ @Override
+ public AccessType getValue(ExternalORMConfiguration form) {
+ return form.getAccessType();
+ }
+ @Override
+ public AccessType getValue1() {
+ return AccessType.PROPERTY;
+ }
+ @Override
+ public AccessType getValue2() {
+ return AccessType.VIRTUAL;
+ }
+ @Override
+ public boolean isNullAllowed() {
+ return true;
+ }
+ @Override
+ public void setValue(ExternalORMConfiguration form, AccessType value) {
+ form.setAccessType(value);
+ }
+ @Override
+ public String toString(AccessType value) {
+ return value.name();
+ }
+ };
+ }
+
private TextNodeTester<ExternalORMConfiguration, String> buildCatalogTester() {
return new TextNodeTester<ExternalORMConfiguration, String>() {
@Override
+ public boolean doesNodeExistAlready() {
+ return false;
+ }
+ @Override
+ public String getDefaultValue() {
+ return null;
+ }
+ @Override
public String getNodeName() {
return ExternalORMConfiguration.CATALOG;
}
@@ -49,6 +122,10 @@
return "EL";
}
@Override
+ public boolean isNullAllowed() {
+ return true;
+ }
+ @Override
public void setValue(ExternalORMConfiguration form, String value) {
form.setCatalogName(value);
}
@@ -59,9 +136,60 @@
};
}
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalClassConverter, String> buildConverterTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalClassConverter, String>() {
+ @Override
+ public ExternalClassConverter addChild(ExternalORMConfiguration form, String value) {
+ ExternalClassConverter converter = form.addConverter();
+ converter.setName(value);
+ return converter;
+ }
+ @Override
+ public ExternalClassConverter getChild(ExternalORMConfiguration form, int index) {
+ return form.getConverter(index);
+ }
+ @Override
+ public List<ExternalClassConverter> getChildren(ExternalORMConfiguration form) {
+ return form.converters();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.convertersSize();
+ }
+ @Override
+ public String getChildValue(ExternalClassConverter childForm) {
+ return childForm.getName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add("CLASS_CONVERTER_" + index);
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalClassConverter.CONVERTER;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeConverter(index);
+ }
+ };
+ }
+
private TextNodeTester<ExternalORMConfiguration, String> buildDescriptionTester() {
return new TextNodeTester<ExternalORMConfiguration, String>() {
@Override
+ public boolean doesNodeExistAlready() {
+ return false;
+ }
+ @Override
+ public String getDefaultValue() {
+ return null;
+ }
+ @Override
public String getNodeName() {
return ExternalORMConfiguration.DESCRIPTION;
}
@@ -78,6 +206,10 @@
return "something";
}
@Override
+ public boolean isNullAllowed() {
+ return true;
+ }
+ @Override
public void setValue(ExternalORMConfiguration form, String value) {
form.setDescription(value);
}
@@ -88,16 +220,341 @@
};
}
- private NodeBuilder<ExternalORMConfiguration> buildORMConfigurationBuilder() {
- return new NodeBuilder<ExternalORMConfiguration>() {
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalEmbeddable, String> buildEmbeddableTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalEmbeddable, String>() {
@Override
- public ExternalORMConfiguration build() throws IOException {
- ORMRepository repository = new ORMRepository();
- return repository.buildORMConfiguration(null, ORMDocumentType.ECLIPELINK_2_6);
+ public ExternalEmbeddable addChild(ExternalORMConfiguration form, String value) {
+ return form.addEmbeddable(value);
}
@Override
- public Node getRootNode(ExternalORMConfiguration form) {
- return ((ORMConfiguration) form).getElement();
+ public ExternalEmbeddable getChild(ExternalORMConfiguration form, int index) {
+ return form.getEmbeddable(index);
+ }
+ @Override
+ public List<ExternalEmbeddable> getChildren(ExternalORMConfiguration form) {
+ return form.embeddables();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.embeddablesSize();
+ }
+ @Override
+ public String getChildValue(ExternalEmbeddable childForm) {
+ return childForm.getClassName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add("org.eclipse.persistence.tools.mappings.Embeddable_" + index);
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalEmbeddable.EMBEDDABLE;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeEmbeddable(index);
+ }
+ };
+ }
+
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalEntity, String> buildEntityTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalEntity, String>() {
+ @Override
+ public ExternalEntity addChild(ExternalORMConfiguration form, String value) {
+ return form.addEntity(value);
+ }
+ @Override
+ public ExternalEntity getChild(ExternalORMConfiguration form, int index) {
+ return form.getEntity(index);
+ }
+ @Override
+ public List<ExternalEntity> getChildren(ExternalORMConfiguration form) {
+ return form.entities();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.entitiesSize();
+ }
+ @Override
+ public String getChildValue(ExternalEntity childForm) {
+ return childForm.getClassName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add("org.eclipse.persistence.tools.mappings.Entity_" + index);
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalEntity.ENTITY;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeEntity(index);
+ }
+ };
+ }
+
+ private String buildHashPartitioningTester() {
+ return "hash-partitioning";
+ }
+
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalMappedSuperClass, String> buildMappedSuperclassTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalMappedSuperClass, String>() {
+ @Override
+ public ExternalMappedSuperClass addChild(ExternalORMConfiguration form, String value) {
+ return form.addMappedSuperClass(value);
+ }
+ @Override
+ public ExternalMappedSuperClass getChild(ExternalORMConfiguration form, int index) {
+ return form.getMappedSuperClass(index);
+ }
+ @Override
+ public List<ExternalMappedSuperClass> getChildren(ExternalORMConfiguration form) {
+ return form.mappedSuperClasses();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.mappedSuperClassesSize();
+ }
+ @Override
+ public String getChildValue(ExternalMappedSuperClass childForm) {
+ return childForm.getClassName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add("org.eclipse.persistence.tools.mappings.MappedSuperclass_" + index);
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalMappedSuperClass.MAPPED_SUPERCLASS;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeMappedSuperClass(index);
+ }
+ };
+ }
+
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalNativeQuery, String> buildNamedNativeQueryTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalNativeQuery, String>() {
+ @Override
+ public ExternalNativeQuery addChild(ExternalORMConfiguration form, String value) {
+ return form.addNamedNativeQuery(value);
+ }
+ @Override
+ public ExternalNativeQuery getChild(ExternalORMConfiguration form, int index) {
+ return form.getNamedNativeQuery(index);
+ }
+ @Override
+ public List<ExternalNativeQuery> getChildren(ExternalORMConfiguration form) {
+ return form.namedNativeQueries();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.namedNativeQueriesSize();
+ }
+ @Override
+ public String getChildValue(ExternalNativeQuery childForm) {
+ return childForm.getName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add("NAMED_NATIVE_QUERY_" + index);
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalNativeQuery.NAMED_NATIVE_QUERY;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeNativeQuery(index);
+ }
+ };
+ }
+
+ private String buildNamedPlsqlStoredFunctionQueryTester() {
+ return "named-plsql-stored-function-query";
+ }
+
+ private String buildNamedPlsqlStoredProcedureQueryTester() {
+ return "named-plsql-stored-procedure-query";
+ }
+
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalBasicNamedQuery, String> buildNamedQueryTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalBasicNamedQuery, String>() {
+ @Override
+ public ExternalBasicNamedQuery addChild(ExternalORMConfiguration form, String value) {
+ return form.addNamedQuery(value);
+ }
+ @Override
+ public ExternalBasicNamedQuery getChild(ExternalORMConfiguration form, int index) {
+ return form.getNamedQuery(index);
+ }
+ @Override
+ public List<ExternalBasicNamedQuery> getChildren(ExternalORMConfiguration form) {
+ return form.namedQueries();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.namedQueriesSize();
+ }
+ @Override
+ public String getChildValue(ExternalBasicNamedQuery childForm) {
+ return childForm.getName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add("NAMED_QUERY_" + index);
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalBasicNamedQuery.NAMED_QUERY;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeNamedQuery(index);
+ }
+ };
+ }
+
+ private String buildNamedStoredFunctionQueryTester() {
+ return "named-stored-function-query";
+ }
+
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalNamedStoredProcedureQuery, String> buildNamedStoredProcedureQueryTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalNamedStoredProcedureQuery, String>() {
+ @Override
+ public ExternalNamedStoredProcedureQuery addChild(ExternalORMConfiguration form, String value) {
+ return form.addNamedStoredProcedureQuery(value);
+ }
+ @Override
+ public ExternalNamedStoredProcedureQuery getChild(ExternalORMConfiguration form, int index) {
+ return form.getNamedStoredProcedureQuery(index);
+ }
+ @Override
+ public List<ExternalNamedStoredProcedureQuery> getChildren(ExternalORMConfiguration form) {
+ return form.storedProcedureQueries();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.storedProcedureQueriesSize();
+ }
+ @Override
+ public String getChildValue(ExternalNamedStoredProcedureQuery childForm) {
+ return childForm.getName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add("NAMED_STORED_PROCEDURE_QUERY_" + index);
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalNamedStoredProcedureQuery.NAMED_STORED_PROCEDURE_QUERY;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeStoredProcedureQuery(index);
+ }
+ };
+ }
+
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalObjectTypeConverter, String> buildObjectTypeConverterTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalObjectTypeConverter, String>() {
+ @Override
+ public ExternalObjectTypeConverter addChild(ExternalORMConfiguration form, String value) {
+ ExternalObjectTypeConverter childForm = form.addObjectTypeConverter();
+ childForm.setName(value);
+ return childForm;
+ }
+ @Override
+ public ExternalObjectTypeConverter getChild(ExternalORMConfiguration form, int index) {
+ return form.getObjectTypeConverter(index);
+ }
+ @Override
+ public List<ExternalObjectTypeConverter> getChildren(ExternalORMConfiguration form) {
+ return form.objectTypeConverters();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.objectTypeConvertersSize();
+ }
+ @Override
+ public String getChildValue(ExternalObjectTypeConverter childForm) {
+ return childForm.getName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add("OBJECT_TYPE_CONVERTER_" + index);
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalObjectTypeConverter.OBJECT_TYPE_CONVERTER;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeObjectTypeConverter(index);
+ }
+ };
+ }
+
+ private String buildOracleArrayTester() {
+ return "oracle-array";
+ }
+
+ private String buildOracleObjectTester() {
+ return "oracle-object";
+ }
+
+ private ExternalFormBuilder<ORMConfiguration> buildORMConfigurationBuilder() {
+ return new ExternalFormBuilder<ORMConfiguration>() {
+ @Override
+ public ORMConfiguration buildExternalForm() throws IOException {
+ ORMRepository repository = new ORMRepository();
+ return repository.buildORMConfiguration(null, defaultVersion());
+ }
+ @Override
+ public int getDefaultAttributeCount() {
+ return 4;
+ }
+ @Override
+ public Node getNode(ORMConfiguration form) {
+ return form.getElement();
+ }
+ @Override
+ public String getNodeName() {
+ return ORMConfiguration.ENTITY_MAPPINGS;
+ }
+ @Override
+ public List<String> getTreeNodeNames() {
+ return Collections.singletonList(getNodeName());
}
};
}
@@ -105,6 +562,14 @@
private TextNodeTester<ExternalORMConfiguration, String> buildPackageTester() {
return new TextNodeTester<ExternalORMConfiguration, String>() {
@Override
+ public boolean doesNodeExistAlready() {
+ return false;
+ }
+ @Override
+ public String getDefaultValue() {
+ return null;
+ }
+ @Override
public String getNodeName() {
return ExternalORMConfiguration.PACKAGE;
}
@@ -121,6 +586,10 @@
return XMLConstants.class.getPackage().getName();
}
@Override
+ public boolean isNullAllowed() {
+ return true;
+ }
+ @Override
public void setValue(ExternalORMConfiguration form, String value) {
form.setPackageName(value);
}
@@ -131,11 +600,19 @@
};
}
- private ChildNodeTester<ExternalORMConfiguration, Object> buildPersistenceUnitMetadataTester() {
- return new ChildNodeTester<ExternalORMConfiguration, Object>() {
+ private String buildPartitioningTester() {
+ return "partitioning";
+ }
+
+ private ChildNodeTester<ExternalORMConfiguration, ExternalPersistenceUnit> buildPersistenceUnitMetadataTester() {
+ return new ChildNodeTester<ExternalORMConfiguration, ExternalPersistenceUnit>() {
@Override
- public void addChild(ExternalORMConfiguration form) {
- form.addPersistenceUnitMetaData();
+ public ExternalPersistenceUnit addChild(ExternalORMConfiguration form) {
+ return form.addPersistenceUnitMetaData();
+ }
+ @Override
+ public ExternalPersistenceUnit getChild(ExternalORMConfiguration form) {
+ return form.getPersistenceUnitMetaData();
}
@Override
public String getNodeName() {
@@ -152,9 +629,41 @@
};
}
+ private String buildPinnedPartitioningTester() {
+ return "pinned-partitioning";
+ }
+
+ private String buildPlsqlRecordTester() {
+ return "plsql-record";
+ }
+
+ private String buildPlsqlTableTester() {
+ return "plsql-table";
+ }
+
+ private String buildRangePartitioningTester() {
+ return "range-partitioning";
+ }
+
+ private String buildReplicationPartitioningTester() {
+ return "replication-partitioning";
+ }
+
+ private String buildRoundRobinPartitioningTester() {
+ return "round-robin-partitioning";
+ }
+
private TextNodeTester<ExternalORMConfiguration, String> buildSchemaTester() {
return new TextNodeTester<ExternalORMConfiguration, String>() {
@Override
+ public boolean doesNodeExistAlready() {
+ return false;
+ }
+ @Override
+ public String getDefaultValue() {
+ return null;
+ }
+ @Override
public String getNodeName() {
return ExternalORMConfiguration.SCHEMA;
}
@@ -171,6 +680,10 @@
return "eclipselink";
}
@Override
+ public boolean isNullAllowed() {
+ return true;
+ }
+ @Override
public void setValue(ExternalORMConfiguration form, String value) {
form.setSchemaName(value);
}
@@ -181,6 +694,319 @@
};
}
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalSequenceGenerator, String> buildSequenceGeneratorTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalSequenceGenerator, String>() {
+ @Override
+ public ExternalSequenceGenerator addChild(ExternalORMConfiguration form, String value) {
+ return form.addSequenceGenerator(value);
+ }
+ @Override
+ public ExternalSequenceGenerator getChild(ExternalORMConfiguration form, int index) {
+ return form.getSequenceGenerator(index);
+ }
+ @Override
+ public List<ExternalSequenceGenerator> getChildren(ExternalORMConfiguration form) {
+ return form.sequenceGenerators();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.sequenceGeneratorsSize();
+ }
+ @Override
+ public String getChildValue(ExternalSequenceGenerator childForm) {
+ return childForm.getName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add("SEQUENCE_GENERATOR_" + index);
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalSequenceGenerator.SEQUENCE_GENERATOR;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeSequenceGenerator(index);
+ }
+ };
+ }
+
+ private String buildSerializedConverterTester() {
+ return "serialized-converter";
+ }
+
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalSQLResultSetMapping, String> buildSqlResultSetMappingTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalSQLResultSetMapping, String>() {
+ @Override
+ public ExternalSQLResultSetMapping addChild(ExternalORMConfiguration form, String value) {
+ return form.addSqlResultSetMapping(value);
+ }
+ @Override
+ public ExternalSQLResultSetMapping getChild(ExternalORMConfiguration form, int index) {
+ return form.getSqlResultSetMapping(index);
+ }
+ @Override
+ public List<ExternalSQLResultSetMapping> getChildren(ExternalORMConfiguration form) {
+ return form.sqlResultSetMappings();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.sqlResultSetMappingsSize();
+ }
+ @Override
+ public String getChildValue(ExternalSQLResultSetMapping childForm) {
+ return childForm.getName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add("SQL_RESULT_SET_MAPPING_" + index);
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalSQLResultSetMapping.SQL_RESULT_SET_MAPPING;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeSqlResultSetMapping(index);
+ }
+ };
+ }
+
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalStructConverter, String> buildStructConverterTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalStructConverter, String>() {
+ @Override
+ public ExternalStructConverter addChild(ExternalORMConfiguration form, String value) {
+ ExternalStructConverter childForm = form.addStructConverter();
+ childForm.setName(value);
+ return childForm;
+ }
+ @Override
+ public ExternalStructConverter getChild(ExternalORMConfiguration form, int index) {
+ return form.getStructConverter(index);
+ }
+ @Override
+ public List<ExternalStructConverter> getChildren(ExternalORMConfiguration form) {
+ return form.structConverters();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.structConvertersSize();
+ }
+ @Override
+ public String getChildValue(ExternalStructConverter childForm) {
+ return childForm.getName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add("STRUCT_CONVERTER_" + index);
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalStructConverter.STRUCT_CONVERTER;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeStructConverter(index);
+ }
+ };
+ }
+
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalTableGenerator, String> buildTableGeneratorTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalTableGenerator, String>() {
+ @Override
+ public ExternalTableGenerator addChild(ExternalORMConfiguration form, String value) {
+ return form.addTableGenerator(value);
+ }
+ @Override
+ public ExternalTableGenerator getChild(ExternalORMConfiguration form, int index) {
+ return form.getTableGenerator(index);
+ }
+ @Override
+ public List<ExternalTableGenerator> getChildren(ExternalORMConfiguration form) {
+ return form.tableGenerators();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.tableGeneratorsSize();
+ }
+ @Override
+ public String getChildValue(ExternalTableGenerator childForm) {
+ return childForm.getName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add("TABLE_GENERATOR_" + index);
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalTableGenerator.TABLE_GENERATOR;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeTableGenerator(index);
+ }
+ };
+ }
+
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalTenantDiscriminatorColumn, String> buildTenantDiscriminatorColumnTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalTenantDiscriminatorColumn, String>() {
+ @Override
+ public ExternalTenantDiscriminatorColumn addChild(ExternalORMConfiguration form, String value) {
+ ExternalTenantDiscriminatorColumn column = form.addDiscriminatorColumn();
+ column.setName(value);
+ return column;
+ }
+ @Override
+ public ExternalTenantDiscriminatorColumn getChild(ExternalORMConfiguration form, int index) {
+ return form.getDiscriminatorColumn(index);
+ }
+ @Override
+ public List<ExternalTenantDiscriminatorColumn> getChildren(ExternalORMConfiguration form) {
+ return form.discriminatorColumns();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.discriminatorColumnSize();
+ }
+ @Override
+ public String getChildValue(ExternalTenantDiscriminatorColumn childForm) {
+ return childForm.getName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add(Integer.toString(index));
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalTenantDiscriminatorColumn.TENANT_DISCRIMINATOR_COLUMN;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeDiscriminatorColumn(index);
+ }
+ };
+ }
+
+ private ChildListNodeTester<ExternalORMConfiguration, ExternalTypeConverter, String> buildTypeConverterTester() {
+ return new ChildListNodeTester<ExternalORMConfiguration, ExternalTypeConverter, String>() {
+ @Override
+ public ExternalTypeConverter addChild(ExternalORMConfiguration form, String value) {
+ ExternalTypeConverter childForm = form.addTypeConverter();
+ childForm.setName(value);
+ return childForm;
+ }
+ @Override
+ public ExternalTypeConverter getChild(ExternalORMConfiguration form, int index) {
+ return form.getTypeConverter(index);
+ }
+ @Override
+ public List<ExternalTypeConverter> getChildren(ExternalORMConfiguration form) {
+ return form.typeConverters();
+ }
+ @Override
+ public int getChildrenSize(ExternalORMConfiguration form) {
+ return form.typeConvertersSize();
+ }
+ @Override
+ public String getChildValue(ExternalTypeConverter childForm) {
+ return childForm.getName();
+ }
+ @Override
+ public List<String> getChildValues() {
+ List<String> values = new ArrayList<String>();
+ for (int index = 0; index < 10; index++) {
+ values.add("TYPE_CONVERTER_" + index);
+ }
+ return values;
+ }
+ @Override
+ public String getNodeName() {
+ return ExternalTypeConverter.TYPE_CONVERTER;
+ }
+ @Override
+ public void removeChild(ExternalORMConfiguration form, int index) {
+ form.removeTypeConverter(index);
+ }
+ };
+ }
+
+ private String buildUnionPartitioningTester() {
+ return "union-partitioning";
+ }
+
+ private String buildUuidGeneratorTester() {
+ return "uuid-generator";
+ }
+
+ private String buildValuePartitioningTester() {
+ return "value-partitioning";
+ }
+
+ private AttributeNodeTester<ExternalORMConfiguration, ORMDocumentType> buildVersionTester() {
+ return new AttributeNodeTester<ExternalORMConfiguration, ORMDocumentType>() {
+ @Override
+ public boolean doesNodeExistAlready() {
+ return true;
+ }
+ @Override
+ public ORMDocumentType getDefaultValue() {
+ return defaultVersion();
+ }
+ @Override
+ public String getNodeName() {
+ return ORMConfiguration.XSD_VERSION;
+ }
+ @Override
+ public ORMDocumentType getValue(ExternalORMConfiguration form) {
+ return form.getDocumentType();
+ }
+ @Override
+ public ORMDocumentType getValue1() {
+ return ORMDocumentType.ECLIPELINK_2_2;
+ }
+ @Override
+ public ORMDocumentType getValue2() {
+ return ORMDocumentType.JPA_1_0;
+ }
+ @Override
+ public boolean isNullAllowed() {
+ return false;
+ }
+ @Override
+ public void setValue(ExternalORMConfiguration form, ORMDocumentType value) {
+ form.setDocumentType(value);
+ }
+ @Override
+ public String toString(ORMDocumentType value) {
+ return value.getVersion();
+ }
+ };
+ }
+
+ private ORMDocumentType defaultVersion() {
+ return ORMDocumentType.ECLIPELINK_2_6;
+ }
+
/**
* {@inheritDoc}
*/
@@ -188,21 +1014,49 @@
protected void populate(RootNodeTester<ExternalORMConfiguration> tester) {
tester.setBuilder(buildORMConfigurationBuilder());
+
+ // Attributes
+ tester.addAttribute(buildVersionTester());
+
+ // Child nodes
tester.addTextNode(buildDescriptionTester());
tester.addNode(buildPersistenceUnitMetadataTester());
tester.addTextNode(buildPackageTester());
tester.addTextNode(buildSchemaTester());
tester.addTextNode(buildCatalogTester());
-// tester.addChild(buildAccessTester());
-// tester.addChild(buildSequenceGeneratorTester());
-// tester.addChild(buildTableGeneratorTester());
-// tester.addChild(buildNamedQueryTester());
-// tester.addChild(buildNamedNativeQueryTester());
-// tester.addChild(buildNamedStoredProcedureQueryTester());
-// tester.addChild(buildSqlResultSetMappingTester());
-// tester.addChild(buildMappedSuperclassTester());
-// tester.addChild(buildEntityTester());
-// tester.addChild(buildEmbeddableTester());
-// tester.addChild(buildConverterTester());
+ tester.addTextNode(buildAccessTester());
+ tester.addUnsupportedNode(buildAccessMethodsTester()); // EclipseLink
+ tester.addListNodes(buildTenantDiscriminatorColumnTester()); // EclipseLink
+// tester.addListNodes(buildConverterTester()); // EclipseLink : mixed converter
+ tester.addListNodes(buildTypeConverterTester()); // EclipseLink
+ tester.addListNodes(buildObjectTypeConverterTester()); // EclipseLink
+ tester.addUnsupportedNode(buildSerializedConverterTester()); // EclipseLink
+ tester.addListNodes(buildStructConverterTester()); // EclipseLink
+ tester.addListNodes(buildSequenceGeneratorTester());
+ tester.addListNodes(buildTableGeneratorTester());
+ tester.addUnsupportedNode(buildUuidGeneratorTester()); // EclipseLink
+ tester.addUnsupportedNode(buildPartitioningTester()); // EclipseLink
+ tester.addUnsupportedNode(buildReplicationPartitioningTester()); // EclipseLink
+ tester.addUnsupportedNode(buildRoundRobinPartitioningTester()); // EclipseLink
+ tester.addUnsupportedNode(buildPinnedPartitioningTester()); // EclipseLink
+ tester.addUnsupportedNode(buildRangePartitioningTester()); // EclipseLink
+ tester.addUnsupportedNode(buildValuePartitioningTester()); // EclipseLink
+ tester.addUnsupportedNode(buildHashPartitioningTester()); // EclipseLink
+ tester.addUnsupportedNode(buildUnionPartitioningTester()); // EclipseLink
+ tester.addListNodes(buildNamedQueryTester());
+ tester.addListNodes(buildNamedNativeQueryTester());
+ tester.addListNodes(buildNamedStoredProcedureQueryTester());
+ tester.addUnsupportedNode(buildNamedStoredFunctionQueryTester()); // EclipseLink
+ tester.addUnsupportedNode(buildNamedPlsqlStoredProcedureQueryTester()); // EclipseLink
+ tester.addUnsupportedNode(buildNamedPlsqlStoredFunctionQueryTester()); // EclipseLink
+ tester.addUnsupportedNode(buildOracleObjectTester()); // EclipseLink
+ tester.addUnsupportedNode(buildOracleArrayTester()); // EclipseLink
+ tester.addUnsupportedNode(buildPlsqlRecordTester()); // EclipseLink
+ tester.addUnsupportedNode(buildPlsqlTableTester()); // EclipseLink
+ tester.addListNodes(buildSqlResultSetMappingTester());
+ tester.addListNodes(buildMappedSuperclassTester());
+ tester.addListNodes(buildEntityTester());
+ tester.addListNodes(buildEmbeddableTester());
+ tester.addListNodes(buildConverterTester());
}
}
\ No newline at end of file
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalBasicMapMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalBasicMapMapping.java
index bb2c611..96d0e10 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalBasicMapMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalBasicMapMapping.java
@@ -82,7 +82,7 @@
/**
* Returns the key converter for this mapping.
*/
- ExternalConverter getKeyConverter();
+ ExternalClassConverter getKeyConverter();
/**
* Returns the {@link TextRange} for the key converter string.
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalClassConverter.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalClassConverter.java
index 89efbcb..34203d7 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalClassConverter.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalClassConverter.java
@@ -13,7 +13,6 @@
******************************************************************************/
package org.eclipse.persistence.tools.mapping.orm;
-import org.eclipse.persistence.tools.mapping.ExternalForm;
import org.eclipse.persistence.tools.utility.TextRange;
/**
@@ -30,43 +29,70 @@
* @version 2.6
*/
@SuppressWarnings("nls")
-public interface ExternalClassConverter extends ExternalForm {
+public interface ExternalClassConverter extends ExternalConverter {
/**
- * The attribute name used to store and retrieve the name property.
+ * The attribute name used to store and retrieve the auto-reply property.
*/
- String NAME = "name";
+ String AUTO_REPLY = "auto-reply";
+
+ /**
+ * The attribute name used to store and retrieve the class property.
+ */
+ String CLASS = "class";
+
+ /**
+ * The node name used to store and retrieve the element encapsulated by this external form.
+ */
+ String CONVERTER = "converter";
+
+ /**
+ * The attribute name used to store and retrieve the description property.
+ */
+ String DESCRIPTION = "description";
+
+ /**
+ * Returns the {@link TextRange} of the auto-reply property.
+ */
+ TextRange getAutoReplyTextRange();
/**
* Returns the class name of the converter class.
*/
- String getConverterClassName();
+ String getClassName();
/**
* Returns the {@link TextRange} for the class name of the converter class.
*/
- TextRange getConverterClassNameTextRange();
-
- @Deprecated
- int getIndex();
+ TextRange getClassNameTextRange();
/**
- * Returns name of converter.
+ * Returns the description property.
*/
- String getName();
+ String getDescription();
/**
- * Returns the {@link TextRange} for the name of this converter.
+ * Returns the {@link TextRange} of the description property.
*/
- TextRange getNameTextRange();
+ TextRange getDescriptionTextRange();
+
+ /**
+ * Returns the auto-reply property.
+ */
+ Boolean isAutoReply();
+
+ /**
+ * Determines whether the auto-reply should be set or not.
+ */
+ void setAutoReply(Boolean autoReply);
/**
* Sets the class name of the converter class.
*/
- void setConverterClassName(String classname);
+ void setClassName(String classname);
/**
- * Sets the name for the converter.
+ * Sets the description property.
*/
- void setName(String name);
+ void setDescription(String description);
}
\ No newline at end of file
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalConverter.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalConverter.java
index 453b388..003757a 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalConverter.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalConverter.java
@@ -13,9 +13,12 @@
******************************************************************************/
package org.eclipse.persistence.tools.mapping.orm;
+import org.eclipse.persistence.tools.mapping.ExternalForm;
+import org.eclipse.persistence.tools.utility.TextRange;
+
/**
- * This interface and inherited behavior describes the configurable properties
- * for an converter. One or more converters can be declared as part of an entity
+ * This interface and inherited behavior describes the configurable properties for an converter. One
+ * or more converters can be declared as part of an entity
* <p>
* Provisional API: This interface is part of an interim API that is still under development and
* expected to change significantly before reaching stability. It is available at this early stage
@@ -27,15 +30,28 @@
* @version 2.6
*/
@SuppressWarnings("nls")
-public interface ExternalConverter extends ExternalClassConverter {
+public interface ExternalConverter extends ExternalForm {
/**
- * The attribute name used to store and retrieve the class property.
+ * The attribute name used to store and retrieve the name property.
*/
- String CLASS = "class";
+ String NAME = "name";
+
+ @Deprecated
+ int getIndex();
/**
- * The attribute name used to store and retrieve the converter property.
+ * Returns name of converter.
*/
- String CONVERTER = "converter";
+ String getName();
+
+ /**
+ * Returns the {@link TextRange} for the name of this converter.
+ */
+ TextRange getNameTextRange();
+
+ /**
+ * Sets the name for the converter.
+ */
+ void setName(String name);
}
\ No newline at end of file
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalConvertibleMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalConvertibleMapping.java
index 42da132..b7bd46f 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalConvertibleMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalConvertibleMapping.java
@@ -62,7 +62,7 @@
/**
* Returns the value converter for this mapping.
*/
- ExternalConverter getValueConverter();
+ ExternalClassConverter getValueConverter();
/**
* Removes the value converter from mapping.
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalElementCollectionMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalElementCollectionMapping.java
index 4653bdc..8abd93f 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalElementCollectionMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalElementCollectionMapping.java
@@ -161,7 +161,7 @@
/**
* Returns the key converter for this mapping.
*/
- ExternalConverter getKeyConverter();
+ ExternalClassConverter getKeyConverter();
/**
* Returns the key object type converter for this mapping.
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalEmbeddable.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalEmbeddable.java
index 122685a..218d288 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalEmbeddable.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalEmbeddable.java
@@ -105,7 +105,7 @@
/**
* Adds a converter to this entity.
*/
- ExternalConverter addConverter(String name);
+ ExternalClassConverter addConverter(String name);
/**
* Adds copy policy to this entity
@@ -180,7 +180,7 @@
/**
* Returns a list of the converters defined for this entity.
*/
- List<ExternalConverter> converters();
+ List<ExternalClassConverter> converters();
/**
* Returns the count of converters defined for this entity.
@@ -225,7 +225,7 @@
/**
* Returns the converter at the given position.
*/
- ExternalConverter getConverter(int index);
+ ExternalClassConverter getConverter(int index);
/**
* Returns the copy policy for this entity.
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalEntity.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalEntity.java
index f507b95..797572f 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalEntity.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalEntity.java
@@ -105,7 +105,7 @@
/**
* Adds a stored procedure query with the given name.
*/
- ExternalStoredProcedureQuery addStoredProcedureQuery(String name, String procedureName);
+ ExternalNamedStoredProcedureQuery addStoredProcedureQuery(String name, String procedureName);
/**
* Returns a list of association overrides defined on this entity.
@@ -225,12 +225,12 @@
/**
* Returns the stored procedure query at the index.
*/
- ExternalStoredProcedureQuery getStoredProcedureQuery(int index);
+ ExternalNamedStoredProcedureQuery getStoredProcedureQuery(int index);
/**
* Returns the stored procedure query with the given name.
*/
- ExternalStoredProcedureQuery getStoredProcedureQuery(int index, String name);
+ ExternalNamedStoredProcedureQuery getStoredProcedureQuery(int index, String name);
/**
* Returns a list of named queries defined for this entity.
@@ -350,7 +350,7 @@
/**
* Returns a list of named stored procedure queries defined for this entity.
*/
- List<ExternalStoredProcedureQuery> storedProcedureQueries();
+ List<ExternalNamedStoredProcedureQuery> storedProcedureQueries();
/**
* Returns the count of named stored procedure queried defined for this entity.
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalStoredProcedureQuery.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalNamedStoredProcedureQuery.java
similarity index 98%
rename from tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalStoredProcedureQuery.java
rename to tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalNamedStoredProcedureQuery.java
index d33c66f..34d0135 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalStoredProcedureQuery.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalNamedStoredProcedureQuery.java
@@ -30,7 +30,7 @@
* @version 2.6
*/
@SuppressWarnings("nls")
-public interface ExternalStoredProcedureQuery extends ExternalNamedQuery {
+public interface ExternalNamedStoredProcedureQuery extends ExternalNamedQuery {
/**
* The node name used to store and retrieve the element encapsulated by this external form.
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalORMConfiguration.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalORMConfiguration.java
index 241851d..4c58849 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalORMConfiguration.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalORMConfiguration.java
@@ -65,7 +65,7 @@
/**
* Adds a new converter.
*/
- ExternalConverter addConverter();
+ ExternalClassConverter addConverter();
/**
* Adds a embedded entity with the given name.
@@ -90,7 +90,12 @@
/**
* Adds a named query with the given name.
*/
- ExternalNamedQuery addNamedQuery(String name);
+ ExternalBasicNamedQuery addNamedQuery(String name);
+
+ /**
+ * Adds a stored procedure query with the given name.
+ */
+ ExternalNamedStoredProcedureQuery addNamedStoredProcedureQuery(String name);
/**
* Adds an object type converter.
@@ -103,21 +108,16 @@
ExternalPersistenceUnit addPersistenceUnitMetaData();
/**
- * Adds a sequence generator with the given name
+ * Adds a sequence generator with the given name.
*/
ExternalSequenceGenerator addSequenceGenerator(String name);
/**
- * Adds a SQL result set mapping with the given name
+ * Adds a SQL result set mapping with the given name.
*/
ExternalSQLResultSetMapping addSqlResultSetMapping(String name);
/**
- * Adds a stored procedure query with the given name
- */
- ExternalStoredProcedureQuery addStoredProcedureQuery(String name, String procedureName);
-
- /**
* Adds a new struct converter.
*/
ExternalStructConverter addStructConverter();
@@ -135,7 +135,7 @@
/**
* Returns a list of all converters defined globally for this ORM configuration.
*/
- List<ExternalConverter> converters();
+ List<ExternalClassConverter> converters();
/**
* Returns the count of all converters defined globally for this ORM configuration.
@@ -182,7 +182,7 @@
/**
* Returns the converter with at the given index.
*/
- ExternalConverter getConverter(int index);
+ ExternalClassConverter getConverter(int index);
/**
* Returns the description noted in the ORM.xml.
@@ -252,6 +252,11 @@
ExternalBasicNamedQuery getNamedQuery(String queryName);
/**
+ * Returns the stored procedure query at the position.
+ */
+ ExternalNamedStoredProcedureQuery getNamedStoredProcedureQuery(int index);
+
+ /**
* Returns the object type converter with at the given index.
*/
ExternalObjectTypeConverter getObjectTypeConverter(int index);
@@ -302,11 +307,6 @@
ExternalSQLResultSetMapping getSqlResultSetMapping(int index);
/**
- * Returns the stored procedure query at the position.
- */
- ExternalStoredProcedureQuery getStoredProcedureQuery(int index);
-
- /**
* Returns the struct converter with at the given position.
*/
ExternalStructConverter getStructConverter(int index);
@@ -354,7 +354,7 @@
/**
* Returns a list of all named queries declared globally for this ORM configuration.
*/
- List<ExternalNamedQuery> namedQueries();
+ List<ExternalBasicNamedQuery> namedQueries();
/**
* Returns the count of all named queries declared globally for this ORM configuration.
@@ -499,7 +499,7 @@
/**
* Returns a list of named stored procedure queries defined for this entity.
*/
- List<ExternalStoredProcedureQuery> storedProcedureQueries();
+ List<ExternalNamedStoredProcedureQuery> storedProcedureQueries();
/**
* Returns the count of named stored procedure queried defined for this entity
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalStructConverter.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalStructConverter.java
index 0784bf1..d5fb351 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalStructConverter.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalStructConverter.java
@@ -13,9 +13,11 @@
******************************************************************************/
package org.eclipse.persistence.tools.mapping.orm;
+import org.eclipse.persistence.tools.utility.TextRange;
+
/**
- * This interface and inherited behavior describes the configurable properties
- * for an struct converter. One or more struct converters can be declared as part of an entity
+ * This interface and inherited behavior describes the configurable properties for an struct
+ * converter. One or more struct converters can be declared as part of an entity.
* <p>
* Provisional API: This interface is part of an interim API that is still under development and
* expected to change significantly before reaching stability. It is available at this early stage
@@ -27,7 +29,7 @@
* @version 2.6
*/
@SuppressWarnings("nls")
-public interface ExternalStructConverter extends ExternalClassConverter {
+public interface ExternalStructConverter extends ExternalConverter {
/**
* The attribute name used to store and retrieve the converter property.
@@ -38,4 +40,19 @@
* The node name used to store and retrieve the element encapsulated by this external form.
*/
String STRUCT_CONVERTER = "struct-converter";
+
+ /**
+ * Returns the class name of the converter class.
+ */
+ String getConverter();
+
+ /**
+ * Returns the {@link TextRange} for the class name of the converter class.
+ */
+ TextRange getConverterTextRange();
+
+ /**
+ * Sets the class name of the converter class.
+ */
+ void setConverter(String classname);
}
\ No newline at end of file
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalTypeConverter.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalTypeConverter.java
index e815190..e3b1aeb 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalTypeConverter.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ExternalTypeConverter.java
@@ -13,7 +13,6 @@
******************************************************************************/
package org.eclipse.persistence.tools.mapping.orm;
-import org.eclipse.persistence.tools.mapping.ExternalForm;
import org.eclipse.persistence.tools.utility.TextRange;
/**
@@ -30,7 +29,7 @@
* @version 2.6
*/
@SuppressWarnings("nls")
-public interface ExternalTypeConverter extends ExternalForm {
+public interface ExternalTypeConverter extends ExternalConverter {
/**
* The attribute name used to store and retrieve the data-type property.
@@ -38,11 +37,6 @@
String DATA_TYPE = "data-type";
/**
- * The attribute name used to store and retrieve the name property.
- */
- String NAME = "name";
-
- /**
* The attribute name used to store and retrieve the object-type property.
*/
String OBJECT_TYPE = "object-type";
@@ -62,19 +56,6 @@
*/
TextRange getDatatypeTextRange();
- @Deprecated
- int getIndex();
-
- /**
- * Returns name of converter.
- */
- String getName();
-
- /**
- * Returns the {@link TextRange} for the name value.
- */
- TextRange getNameTextRange();
-
/**
* Returns the object type name for this converter.
*/
@@ -91,11 +72,6 @@
void setDatatype(String datatypeName);
/**
- * Sets the name for the converter.
- */
- void setName(String name);
-
- /**
* Sets the object type name for this converter.
*/
void setObjecttype(String objecttypeName);
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ORMDocumentType.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ORMDocumentType.java
index 8e00734..38dfefc 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ORMDocumentType.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/ORMDocumentType.java
@@ -29,7 +29,7 @@
*
* @version 2.6
*/
-@SuppressWarnings("unused") // unused used for the import statement: see bug 330740
+@SuppressWarnings({"nls", "unused"}) // unused used for the import statement: see bug 330740
public enum ORMDocumentType {
/**
@@ -155,9 +155,11 @@
for (ORMDocumentType type : types()) {
- if (StringTools.equalsIgnoreCase(schemaURI, type.schemaURI) ||
+ String actualSchemaURI = type.xmlNamespace + " " + type.schemaURI;
+
+ if (StringTools.equalsIgnoreCase(actualSchemaURI, schemaURI) ||
(StringTools.equalsIgnoreCase(type.xmlNamespace, xmlNamespace) &&
- StringTools.equalsIgnoreCase(type.version, version))) {
+ StringTools.equalsIgnoreCase(type.version, version))) {
return type;
}
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/AbstractConverter.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/AbstractConverter.java
new file mode 100644
index 0000000..0555140
--- /dev/null
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/AbstractConverter.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2013 Oracle and/or its affiliates. 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
+ *
+ ******************************************************************************/
+package org.eclipse.persistence.tools.mapping.orm.dom;
+
+import org.eclipse.persistence.tools.mapping.AbstractExternalForm;
+import org.eclipse.persistence.tools.mapping.orm.ExternalConverter;
+import org.eclipse.persistence.tools.utility.TextRange;
+import org.w3c.dom.Element;
+
+/**
+ * The abstract definition of an external class converter.
+ *
+ * @version 2.6
+ */
+abstract class AbstractConverter extends AbstractExternalForm
+ implements ExternalConverter {
+
+ /**
+ * The position of the element within the list of children with the same type owned by the parent.
+ */
+ private int index;
+
+ /**
+ * Creates a new <code>AbstractConverter</code>.
+ *
+ * @param parent The parent of this external form
+ * @param index The position of the element within the list of children with the same type owned by the parent
+ */
+ AbstractConverter(AbstractExternalForm parent, int index) {
+ super(parent);
+ this.index = index;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected final void calculateInsertionIndex(Element parent, Element child, String elementName) {
+ if (elementName == getElementName()) {
+ index = index(parent, child, elementName);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public final Element getElement() {
+
+ if (index == -1) {
+ return super.getElement();
+ }
+
+ return getChild(getParent(), getElementName(), index);
+ }
+
+ @Override
+ @Deprecated
+ public final int getIndex() {
+ return index;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public final String getName() {
+ return getAttribute(NAME);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public final TextRange getNameTextRange() {
+ return getAttributeTextRange(NAME);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public final void removeSelf() {
+
+ if (index == -1) {
+ super.removeSelf();
+ }
+ else {
+ removeChild(getParent(), getElementName(), index);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public final void setName(String name) {
+ setAttribute(NAME, name);
+ }
+}
\ No newline at end of file
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/AbstractQuery.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/AbstractQuery.java
index f8a8b81..0f62efe 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/AbstractQuery.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/AbstractQuery.java
@@ -81,7 +81,9 @@
*/
@Override
protected void calculateInsertionIndex(Element parent, Element child, String elementName) {
- index = index(parent, child, elementName);
+ if (elementName == getElementName()) {
+ index = index(parent, child, elementName);
+ }
}
/**
@@ -161,7 +163,8 @@
List<ExternalQueryHint> queryHints = new ArrayList<ExternalQueryHint>(count);
for (int index = 0; index < count; index++) {
- queryHints.add(buildQueryHint(index));
+ QueryHint queryHint = buildQueryHint(index);
+ queryHints.add(queryHint);
}
return queryHints;
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/AssociationOverride.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/AssociationOverride.java
index 571853c..5bb3b80 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/AssociationOverride.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/AssociationOverride.java
@@ -97,7 +97,9 @@
*/
@Override
protected void calculateInsertionIndex(Element parent, Element child, String elementName) {
- index = index(parent, child, elementName);
+ if (elementName == getElementName()) {
+ index = index(parent, child, elementName);
+ }
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/BasicCollectionMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/BasicCollectionMapping.java
index ebe7d2e..dbf3e81 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/BasicCollectionMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/BasicCollectionMapping.java
@@ -37,11 +37,9 @@
* Creates a new <code>BasicCollectionMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned
- * by the parent
*/
- BasicCollectionMapping(Embeddable parent, int index) {
- super(parent, index);
+ BasicCollectionMapping(Embeddable parent) {
+ super(parent);
}
/**
@@ -104,7 +102,7 @@
List<String> names = new ArrayList<String>();
names.add(VALUE_COLUMN);
names.add(CONVERT);
- names.add(Converter.CONVERTER);
+ names.add(ClassConverter.CONVERTER);
names.add(TypeConverter.TYPE_CONVERTER);
names.add(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
names.add(StructConverter.STRUCT_CONVERTER);
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/BasicMapMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/BasicMapMapping.java
index 574d2e2..72b8889 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/BasicMapMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/BasicMapMapping.java
@@ -19,8 +19,8 @@
import org.eclipse.persistence.annotations.JoinFetchType;
import org.eclipse.persistence.tools.mapping.orm.ExternalBasicMapMapping;
import org.eclipse.persistence.tools.mapping.orm.ExternalBatchFetch;
+import org.eclipse.persistence.tools.mapping.orm.ExternalClassConverter;
import org.eclipse.persistence.tools.mapping.orm.ExternalCollectionTable;
-import org.eclipse.persistence.tools.mapping.orm.ExternalConverter;
import org.eclipse.persistence.tools.mapping.orm.ExternalEntityColumn;
import org.eclipse.persistence.tools.mapping.orm.ExternalObjectTypeConverter;
import org.eclipse.persistence.tools.mapping.orm.ExternalStructConverter;
@@ -41,11 +41,9 @@
* Creates a new <code>BasicMapMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned
- * by the parent
*/
- BasicMapMapping(Embeddable parent, int index) {
- super(parent, index);
+ BasicMapMapping(Embeddable parent) {
+ super(parent);
}
/**
@@ -133,7 +131,7 @@
names.add(KEY_CONVERTER);
names.add(VALUE_COLUMN);
names.add(VALUE_CONVERTER);
- names.add(Converter.CONVERTER);
+ names.add(ClassConverter.CONVERTER);
names.add(TypeConverter.TYPE_CONVERTER);
names.add(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
names.add(StructConverter.STRUCT_CONVERTER);
@@ -145,8 +143,8 @@
return names;
}
- private Converter buildKeyConverter() {
- return new Converter(this, -1);
+ private ClassConverter buildKeyConverter() {
+ return new ClassConverter(this, -1);
}
private ObjectTypeConverter buildKeyObjectTypeConverter() {
@@ -252,7 +250,7 @@
* {@inheritDoc}
*/
@Override
- public ExternalConverter getKeyConverter() {
+ public ExternalClassConverter getKeyConverter() {
if (hasChild(KEY_CONVERTER)) {
return buildKeyConverter();
@@ -352,7 +350,7 @@
*/
@Override
public void removeKeyConverter() {
- removeChild(Converter.CONVERTER);
+ removeChild(ClassConverter.CONVERTER);
}
/**
@@ -407,9 +405,10 @@
removeChild(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
removeChild(StructConverter.STRUCT_CONVERTER);
- Converter valueConverter = buildKeyConverter();
+ ClassConverter valueConverter = buildKeyConverter();
+ valueConverter.addSelf();
valueConverter.setName(name);
- valueConverter.setConverterClassName(className);
+ valueConverter.setClassName(className);
}
/**
@@ -419,10 +418,11 @@
public void setAsKeyObjectTypeConverter(String name) {
removeChild(TypeConverter.TYPE_CONVERTER);
- removeChild(Converter.CONVERTER);
+ removeChild(ClassConverter.CONVERTER);
removeChild(StructConverter.STRUCT_CONVERTER);
ObjectTypeConverter valueConverter = buildKeyObjectTypeConverter();
+ valueConverter.addSelf();
valueConverter.setName(name);
}
@@ -434,11 +434,12 @@
removeChild(TypeConverter.TYPE_CONVERTER);
removeChild(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
- removeChild(Converter.CONVERTER);
+ removeChild(ClassConverter.CONVERTER);
StructConverter valueConverter = buildKeyStructConverter();
+ valueConverter.addSelf();
valueConverter.setName(name);
- valueConverter.setConverterClassName(converter);
+ valueConverter.setConverter(converter);
}
/**
@@ -447,11 +448,12 @@
@Override
public void setAsKeyTypeConverter(String name) {
- removeChild(Converter.CONVERTER);
+ removeChild(ClassConverter.CONVERTER);
removeChild(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
removeChild(StructConverter.STRUCT_CONVERTER);
TypeConverter valueConverter = buildKeyTypeConverter();
+ valueConverter.addSelf();
valueConverter.setName(name);
}
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/BasicMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/BasicMapping.java
index 9147bda..4aaa789 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/BasicMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/BasicMapping.java
@@ -41,10 +41,9 @@
* Creates a new <code>BasicMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the external form of the mapping in the list of children
*/
- BasicMapping(Embeddable parent, int index) {
- super(parent, index);
+ BasicMapping(Embeddable parent) {
+ super(parent);
}
/**
@@ -119,7 +118,7 @@
names.add(TEMPORAL);
names.add(ENUMERATED);
names.add(CONVERT);
- names.add(Converter.CONVERTER);
+ names.add(ClassConverter.CONVERTER);
names.add(TypeConverter.TYPE_CONVERTER);
names.add(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
names.add(StructConverter.STRUCT_CONVERTER);
@@ -486,7 +485,7 @@
if ((element == null) && (returnOnlyOnInsert == null)) {
return;
}
-
+
if ((element != null) && (returnOnlyOnInsert == null)) {
remove(element);
}
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ClassConverter.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ClassConverter.java
index 80d5641..f04124f 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ClassConverter.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ClassConverter.java
@@ -18,20 +18,20 @@
import org.eclipse.persistence.tools.mapping.AbstractExternalForm;
import org.eclipse.persistence.tools.mapping.orm.ExternalClassConverter;
import org.eclipse.persistence.tools.utility.TextRange;
-import org.w3c.dom.Element;
/**
- * The abstract definition of an external class converter.
+ * The external form of a converter.
+ *
+ * @see BasicMapMapping
+ * @see ConvertibleMapping
+ * @see ElementCollectionMapping
+ * @see EmbeddableEntity
+ * @see ORMConfiguration
*
* @version 2.6
*/
-abstract class ClassConverter extends AbstractExternalForm
- implements ExternalClassConverter {
-
- /**
- * The position of the element within the list of children with the same type owned by the parent.
- */
- private int index;
+final class ClassConverter extends AbstractConverter
+ implements ExternalClassConverter {
/**
* Creates a new <code>ClassConverter</code>.
@@ -40,8 +40,7 @@
* @param index The position of the element within the list of children with the same type owned by the parent
*/
ClassConverter(AbstractExternalForm parent, int index) {
- super(parent);
- this.index = index;
+ super(parent, index);
}
/**
@@ -51,6 +50,15 @@
protected List<String> buildAttributeNamesOrder() {
List<String> names = new ArrayList<String>();
names.add(NAME);
+ names.add(CLASS);
+ names.add(AUTO_REPLY);
+ return names;
+ }
+
+ @Override
+ protected List<String> buildElementNamesOrder() {
+ List<String> names = new ArrayList<String>();
+ names.add(DESCRIPTION);
return names;
}
@@ -58,95 +66,79 @@
* {@inheritDoc}
*/
@Override
- protected void calculateInsertionIndex(Element parent, Element child, String elementName) {
- index = index(parent, child, elementName);
- }
-
- /**
- * Returns the element name used to retrieve or store the converter class name.
- *
- * @return The element name of the converter class name
- */
- abstract String getConverterClassElementName();
-
- /**
- * {@inheritDoc}
- */
- @Override
- public final String getConverterClassName() {
- return getAttribute(getConverterClassElementName());
+ public TextRange getAutoReplyTextRange() {
+ return getAttributeTextRange(AUTO_REPLY);
}
/**
* {@inheritDoc}
*/
@Override
- public final TextRange getConverterClassNameTextRange() {
- return getAttributeTextRange(getConverterClassElementName());
+ public String getClassName() {
+ return getAttribute(CLASS);
}
/**
* {@inheritDoc}
*/
@Override
- public final Element getElement() {
-
- if (index == -1) {
- return super.getElement();
- }
-
- return getChild(getParent(), getElementName(), index);
- }
-
- @Override
- @Deprecated
- public int getIndex() {
- return index;
+ public TextRange getClassNameTextRange() {
+ return getAttributeTextRange(CLASS);
}
/**
* {@inheritDoc}
*/
@Override
- public final String getName() {
- return getAttribute(NAME);
+ public String getDescription() {
+ return getChildTextNode(DESCRIPTION);
}
/**
* {@inheritDoc}
*/
@Override
- public final TextRange getNameTextRange() {
- return getAttributeTextRange(NAME);
+ public TextRange getDescriptionTextRange() {
+ return getChildTextNodeTextRange(DESCRIPTION);
}
/**
* {@inheritDoc}
*/
@Override
- public final void removeSelf() {
-
- if (index == -1) {
- super.removeSelf();
- }
- else {
- removeChild(getParent(), getElementName(), index);
- }
+ protected String getElementName() {
+ return CONVERTER;
}
/**
* {@inheritDoc}
*/
@Override
- public final void setConverterClassName(String classname) {
- setAttribute(getConverterClassElementName(), classname);
+ public Boolean isAutoReply() {
+ return getBooleanAttribute(AUTO_REPLY);
}
/**
* {@inheritDoc}
*/
@Override
- public final void setName(String name) {
- setAttribute(NAME, name);
+ public void setAutoReply(Boolean autoReply) {
+ setAttribute(AUTO_REPLY, autoReply);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setClassName(String classname) {
+ setAttribute(CLASS, classname);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setDescription(String description) {
+ updateChildTextNode(DESCRIPTION, description);
}
}
\ No newline at end of file
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Converter.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Converter.java
deleted file mode 100644
index f80ee78..0000000
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Converter.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2013 Oracle and/or its affiliates. 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
- *
- ******************************************************************************/
-package org.eclipse.persistence.tools.mapping.orm.dom;
-
-import java.util.List;
-import org.eclipse.persistence.tools.mapping.AbstractExternalForm;
-import org.eclipse.persistence.tools.mapping.orm.ExternalConverter;
-
-/**
- * The external form of a converter, which is a child of an entity.
- *
- * @see BasicMapMapping
- * @see ConvertibleMapping
- * @see ElementCollectionMapping
- * @see EmbeddableEntity
- * @see ORMConfiguration
- *
- * @version 2.6
- */
-final class Converter extends ClassConverter
- implements ExternalConverter {
-
- /**
- * Creates a new <code>Converter</code>.
- *
- * @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
- */
- Converter(AbstractExternalForm parent, int index) {
- super(parent, index);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected List<String> buildAttributeNamesOrder() {
- List<String> names = super.buildAttributeNamesOrder();
- names.add(CLASS);
- return names;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- String getConverterClassElementName() {
- return CLASS;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getElementName() {
- return CONVERTER;
- }
-}
\ No newline at end of file
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ConvertibleMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ConvertibleMapping.java
index 7a164e8..8f9794d 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ConvertibleMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ConvertibleMapping.java
@@ -15,7 +15,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.persistence.tools.mapping.orm.ExternalConverter;
+import org.eclipse.persistence.tools.mapping.orm.ExternalClassConverter;
import org.eclipse.persistence.tools.mapping.orm.ExternalConvertibleMapping;
import org.eclipse.persistence.tools.mapping.orm.ExternalObjectTypeConverter;
import org.eclipse.persistence.tools.mapping.orm.ExternalStructConverter;
@@ -36,10 +36,9 @@
* Creates a new <code>ConvertibleMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- ConvertibleMapping(Embeddable parent, int index) {
- super(parent, index);
+ ConvertibleMapping(Embeddable parent) {
+ super(parent);
}
/**
@@ -53,8 +52,8 @@
return names;
}
- private Converter buildConverter() {
- return new Converter(this, -1);
+ private ClassConverter buildConverter() {
+ return new ClassConverter(this, -1);
}
/**
@@ -64,7 +63,7 @@
protected List<String> buildElementNamesOrder() {
List<String> names = new ArrayList<String>();
names.add(CONVERT);
- names.add(Converter.CONVERTER);
+ names.add(ClassConverter.CONVERTER);
names.add(TypeConverter.TYPE_CONVERTER);
names.add(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
names.add(StructConverter.STRUCT_CONVERTER);
@@ -144,9 +143,9 @@
* {@inheritDoc}
*/
@Override
- public final ExternalConverter getValueConverter() {
+ public final ExternalClassConverter getValueConverter() {
- if (hasChild(Converter.CONVERTER)) {
+ if (hasChild(ClassConverter.CONVERTER)) {
return buildConverter();
}
@@ -158,7 +157,7 @@
*/
@Override
public final void removeValueConverter() {
- removeChild(Converter.CONVERTER);
+ removeChild(ClassConverter.CONVERTER);
}
/**
@@ -195,7 +194,7 @@
removeChild(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
removeChild(StructConverter.STRUCT_CONVERTER);
- Converter valueConverter = buildConverter();
+ ClassConverter valueConverter = buildConverter();
valueConverter.addSelf();
}
@@ -206,7 +205,7 @@
public final void setAsValueObjectTypeConverter() {
removeChild(TypeConverter.TYPE_CONVERTER);
- removeChild(Converter.CONVERTER);
+ removeChild(ClassConverter.CONVERTER);
removeChild(StructConverter.STRUCT_CONVERTER);
ObjectTypeConverter valueConverter = buildObjectTypeConverter();
@@ -221,7 +220,7 @@
removeChild(TypeConverter.TYPE_CONVERTER);
removeChild(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
- removeChild(Converter.CONVERTER);
+ removeChild(ClassConverter.CONVERTER);
StructConverter valueConverter = buildStructConverter();
valueConverter.addSelf();
@@ -233,7 +232,7 @@
@Override
public final void setAsValueTypeConverter() {
- removeChild(Converter.CONVERTER);
+ removeChild(ClassConverter.CONVERTER);
removeChild(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
removeChild(StructConverter.STRUCT_CONVERTER);
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ElementCollectionMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ElementCollectionMapping.java
index f20487f..adc1598 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ElementCollectionMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ElementCollectionMapping.java
@@ -22,8 +22,8 @@
import org.eclipse.persistence.tools.mapping.orm.ExternalAssociationOverride;
import org.eclipse.persistence.tools.mapping.orm.ExternalAttributeOverride;
import org.eclipse.persistence.tools.mapping.orm.ExternalBatchFetch;
+import org.eclipse.persistence.tools.mapping.orm.ExternalClassConverter;
import org.eclipse.persistence.tools.mapping.orm.ExternalCollectionTable;
-import org.eclipse.persistence.tools.mapping.orm.ExternalConverter;
import org.eclipse.persistence.tools.mapping.orm.ExternalElementCollectionMapping;
import org.eclipse.persistence.tools.mapping.orm.ExternalEntityColumn;
import org.eclipse.persistence.tools.mapping.orm.ExternalJoinColumn;
@@ -49,10 +49,9 @@
* Creates a new <code>ElementCollectionMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- ElementCollectionMapping(Embeddable parent, int index) {
- super(parent, index);
+ ElementCollectionMapping(Embeddable parent) {
+ super(parent);
}
/**
@@ -216,7 +215,7 @@
names.add(CollectionTable.COLLECTION_TABLE);
names.add(BatchFetch.BATCH_FETCH);
names.add(CONVERT);
- names.add(Converter.CONVERTER);
+ names.add(ClassConverter.CONVERTER);
names.add(TypeConverter.TYPE_CONVERTER);
names.add(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
names.add(StructConverter.STRUCT_CONVERTER);
@@ -229,8 +228,8 @@
return new JoinColumn(this, elementName, index);
}
- private Converter buildKeyConverter() {
- return new Converter(this, -1);
+ private ClassConverter buildKeyConverter() {
+ return new ClassConverter(this, -1);
}
private ObjectTypeConverter buildKeyObjectTypeConverter() {
@@ -253,7 +252,7 @@
return new AttributeOverride(this, index);
}
- private ExternalNoSqlField buildNoSqlField() {
+ private NoSqlField buildNoSqlField() {
return new NoSqlField(this);
}
@@ -376,9 +375,9 @@
* {@inheritDoc}
*/
@Override
- public ExternalConverter getKeyConverter() {
+ public ExternalClassConverter getKeyConverter() {
- if (hasChild(Converter.CONVERTER)) {
+ if (hasChild(ClassConverter.CONVERTER)) {
return buildKeyConverter();
}
@@ -777,7 +776,7 @@
*/
@Override
public void removeKeyConverter() {
- removeChild(Converter.CONVERTER);
+ removeChild(ClassConverter.CONVERTER);
}
/**
@@ -859,10 +858,10 @@
removeChild(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
removeChild(StructConverter.STRUCT_CONVERTER);
- Converter valueConverter = buildKeyConverter();
+ ClassConverter valueConverter = buildKeyConverter();
valueConverter.addSelf();
valueConverter.setName(name);
- valueConverter.setConverterClassName(className);
+ valueConverter.setClassName(className);
}
/**
@@ -872,7 +871,7 @@
public void setAsKeyObjectTypeConverter(String name) {
removeChild(TypeConverter.TYPE_CONVERTER);
- removeChild(Converter.CONVERTER);
+ removeChild(ClassConverter.CONVERTER);
removeChild(StructConverter.STRUCT_CONVERTER);
ObjectTypeConverter valueConverter = buildKeyObjectTypeConverter();
@@ -888,12 +887,12 @@
removeChild(TypeConverter.TYPE_CONVERTER);
removeChild(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
- removeChild(Converter.CONVERTER);
+ removeChild(ClassConverter.CONVERTER);
StructConverter valueConverter = buildKeyStructConverter();
valueConverter.addSelf();
valueConverter.setName(name);
- valueConverter.setConverterClassName(converter);
+ valueConverter.setConverter(converter);
}
/**
@@ -902,7 +901,7 @@
@Override
public void setAsKeyTypeConverter(String name) {
- removeChild(Converter.CONVERTER);
+ removeChild(ClassConverter.CONVERTER);
removeChild(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
removeChild(StructConverter.STRUCT_CONVERTER);
@@ -1014,7 +1013,8 @@
*/
@Override
public void setNoSqlField(String field) {
- ExternalNoSqlField noSqlField = buildNoSqlField();
+ NoSqlField noSqlField = buildNoSqlField();
+ noSqlField.addSelf();
noSqlField.setName(field);
}
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Embeddable.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Embeddable.java
index 296cc89..7db8bd1 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Embeddable.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Embeddable.java
@@ -24,8 +24,8 @@
import org.eclipse.persistence.tools.mapping.orm.ExternalBasicCollectionMapping;
import org.eclipse.persistence.tools.mapping.orm.ExternalBasicMapMapping;
import org.eclipse.persistence.tools.mapping.orm.ExternalBasicMapping;
+import org.eclipse.persistence.tools.mapping.orm.ExternalClassConverter;
import org.eclipse.persistence.tools.mapping.orm.ExternalCloneCopyPolicy;
-import org.eclipse.persistence.tools.mapping.orm.ExternalConverter;
import org.eclipse.persistence.tools.mapping.orm.ExternalCopyPolicy;
import org.eclipse.persistence.tools.mapping.orm.ExternalElementCollectionMapping;
import org.eclipse.persistence.tools.mapping.orm.ExternalEmbeddable;
@@ -95,7 +95,7 @@
*/
@Override
public final ExternalBasicCollectionMapping addBasicCollectionMapping(String name) {
- BasicCollectionMapping mapping = buildBasicCollectionMapping(mappingsSize());
+ BasicCollectionMapping mapping = buildBasicCollectionMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -106,7 +106,7 @@
*/
@Override
public final ExternalBasicMapMapping addBasicMapMapping(String name) {
- BasicMapMapping mapping = buildBasicMapMapping(mappingsSize());
+ BasicMapMapping mapping = buildBasicMapMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -117,7 +117,7 @@
*/
@Override
public final ExternalBasicMapping addBasicMapping(String name) {
- BasicMapping mapping = buildBasicMapping(mappingsSize());
+ BasicMapping mapping = buildBasicMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -137,8 +137,8 @@
* {@inheritDoc}
*/
@Override
- public final ExternalConverter addConverter(String name) {
- Converter converter = buildConverter(index);
+ public final ExternalClassConverter addConverter(String name) {
+ ClassConverter converter = buildConverter(-1);
converter.addSelf();
converter.setName(name);
return converter;
@@ -159,7 +159,7 @@
*/
@Override
public final ExternalElementCollectionMapping addElementCollectionMapping(String name) {
- ElementCollectionMapping mapping = buildElementCollectionMapping(mappingsSize());
+ ElementCollectionMapping mapping = buildElementCollectionMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -170,7 +170,7 @@
*/
@Override
public final ExternalEmbeddedMapping addEmbeddedMapping(String name) {
- EmbeddedMapping mapping = buildEmbeddedMapping(mappingsSize());
+ EmbeddedMapping mapping = buildEmbeddedMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -201,7 +201,7 @@
*/
@Override
public final ExternalManyToManyMapping addManyToManyMapping(String name) {
- ManyToManyMapping mapping = buildManyToManyMapping(mappingsSize());
+ ManyToManyMapping mapping = buildManyToManyMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -212,7 +212,7 @@
*/
@Override
public final ExternalManyToOneMapping addManyToOneMapping(String name) {
- ManyToOneMapping mapping = buildManyToOneMapping(mappingsSize());
+ ManyToOneMapping mapping = buildManyToOneMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -233,7 +233,7 @@
*/
@Override
public final ExternalObjectTypeConverter addObjectTypeConverter(String name) {
- ObjectTypeConverter converter = buildObjectTypeConverter(index);
+ ObjectTypeConverter converter = buildObjectTypeConverter(-1);
converter.addSelf();
converter.setName(name);
return converter;
@@ -244,7 +244,7 @@
*/
@Override
public final ExternalOneToManyMapping addOneToManyMapping(String name) {
- OneToManyMapping mapping = buildOneToManyMapping(mappingsSize());
+ OneToManyMapping mapping = buildOneToManyMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -255,7 +255,7 @@
*/
@Override
public final ExternalOneToOneMapping addOneToOneMapping(String name) {
- OneToOneMapping mapping = buildOneToOneMapping(mappingsSize());
+ OneToOneMapping mapping = buildOneToOneMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -266,7 +266,7 @@
*/
@Override
public final ExternalProperty addProperty(String name, String value) {
- Property property = buildProperty(index);
+ Property property = buildProperty(-1);
property.addSelf();
property.setName(name);
property.setValue(value);
@@ -278,7 +278,7 @@
*/
@Override
public final ExternalStructConverter addStructConverter(String name) {
- StructConverter converter = buildStructConverter(index);
+ StructConverter converter = buildStructConverter(-1);
converter.addSelf();
converter.setName(name);
return converter;
@@ -289,7 +289,7 @@
*/
@Override
public final ExternalTransientMapping addTransientMapping(String name) {
- TransientMapping mapping = buildTransientMapping(mappingsSize());
+ TransientMapping mapping = buildTransientMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -300,7 +300,7 @@
*/
@Override
public final ExternalTypeConverter addTypeConverter(String name) {
- TypeConverter converter = buildTypeConverter(index);
+ TypeConverter converter = buildTypeConverter(-1);
converter.addSelf();
converter.setName(name);
return converter;
@@ -323,32 +323,32 @@
return names;
}
- private BasicCollectionMapping buildBasicCollectionMapping(int index) {
- return new BasicCollectionMapping(this, index);
+ private BasicCollectionMapping buildBasicCollectionMapping() {
+ return new BasicCollectionMapping(this);
}
- private BasicMapMapping buildBasicMapMapping(int index) {
- return new BasicMapMapping(this, index);
+ private BasicMapMapping buildBasicMapMapping() {
+ return new BasicMapMapping(this);
}
- private BasicMapping buildBasicMapping(int index) {
- return new BasicMapping(this, index);
+ private BasicMapping buildBasicMapping() {
+ return new BasicMapping(this);
}
private CloneCopyPolicy buildCloneCopyPolicy() {
return new CloneCopyPolicy(this);
}
- private Converter buildConverter(int index) {
- return new Converter(this, index);
+ private ClassConverter buildConverter(int index) {
+ return new ClassConverter(this, index);
}
private CopyPolicy buildCopyPolicy() {
return new CopyPolicy(this);
}
- private ElementCollectionMapping buildElementCollectionMapping(int index) {
- return new ElementCollectionMapping(this, index);
+ private ElementCollectionMapping buildElementCollectionMapping() {
+ return new ElementCollectionMapping(this);
}
/**
@@ -363,7 +363,7 @@
names.add(CUSTOMIZER);
names.add(CHANGE_TRACKING);
names.add(NoSql.NO_SQL);
- names.add(Converter.CONVERTER);
+ names.add(ClassConverter.CONVERTER);
names.add(TypeConverter.TYPE_CONVERTER);
names.add(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
names.add(StructConverter.STRUCT_CONVERTER);
@@ -375,72 +375,72 @@
return names;
}
- private EmbeddedMapping buildEmbeddedMapping(int index) {
- return new EmbeddedMapping(this, index);
+ private EmbeddedMapping buildEmbeddedMapping() {
+ return new EmbeddedMapping(this);
}
private InstantiationCopyPolicy buildInstantiationCopyPolicy() {
return new InstantiationCopyPolicy(this);
}
- private ManyToManyMapping buildManyToManyMapping(int index) {
- return new ManyToManyMapping(this, index);
+ private ManyToManyMapping buildManyToManyMapping() {
+ return new ManyToManyMapping(this);
}
- private ManyToOneMapping buildManyToOneMapping(int index) {
- return new ManyToOneMapping(this, index);
+ private ManyToOneMapping buildManyToOneMapping() {
+ return new ManyToOneMapping(this);
}
- Mapping buildMapping(String elementName, int index) {
+ Mapping buildMapping(String elementName) {
// Basic
if (ObjectTools.equals(elementName, BasicMapping.BASIC)) {
- return buildBasicMapping(index);
+ return buildBasicMapping();
}
// Basic Collection
if (ObjectTools.equals(elementName, BasicCollectionMapping.BASIC_COLLECTION)) {
- return buildBasicCollectionMapping(index);
+ return buildBasicCollectionMapping();
}
// Basic Map
if (ObjectTools.equals(elementName, BasicMapMapping.BASIC_MAP)) {
- return buildBasicMapMapping(index);
+ return buildBasicMapMapping();
}
// Embedded
if (ObjectTools.equals(elementName, EmbeddedMapping.EMBEDDED)) {
- return buildEmbeddedMapping(index);
+ return buildEmbeddedMapping();
}
// Element Collection
if (ObjectTools.equals(elementName, ElementCollectionMapping.ELEMENT_COLLECTION)) {
- return buildElementCollectionMapping(index);
+ return buildElementCollectionMapping();
}
// M:M
if (ObjectTools.equals(elementName, ManyToManyMapping.MANY_TO_MANY)) {
- return buildManyToManyMapping(index);
+ return buildManyToManyMapping();
}
// M:1
if (ObjectTools.equals(elementName, ManyToOneMapping.MANY_TO_ONE)) {
- return buildManyToOneMapping(index);
+ return buildManyToOneMapping();
}
// 1:M
if (ObjectTools.equals(elementName, OneToManyMapping.ONE_TO_MANY)) {
- return buildOneToManyMapping(index);
+ return buildOneToManyMapping();
}
// 1:1
if (ObjectTools.equals(elementName, OneToOneMapping.ONE_TO_ONE)) {
- return buildOneToOneMapping(index);
+ return buildOneToOneMapping();
}
// Transient
if (ObjectTools.equals(elementName, TransientMapping.TRANSIENT)) {
- return buildTransientMapping(index);
+ return buildTransientMapping();
}
return null;
@@ -481,12 +481,12 @@
return new ObjectTypeConverter(this, index);
}
- private OneToManyMapping buildOneToManyMapping(int index) {
- return new OneToManyMapping(this, index);
+ private OneToManyMapping buildOneToManyMapping() {
+ return new OneToManyMapping(this);
}
- private OneToOneMapping buildOneToOneMapping(int index) {
- return new OneToOneMapping(this, index);
+ private OneToOneMapping buildOneToOneMapping() {
+ return new OneToOneMapping(this);
}
private Property buildProperty(int index) {
@@ -497,8 +497,8 @@
return new StructConverter(this, index);
}
- private TransientMapping buildTransientMapping(int index) {
- return new TransientMapping(this, index);
+ private TransientMapping buildTransientMapping() {
+ return new TransientMapping(this);
}
private TypeConverter buildTypeConverter(int index) {
@@ -517,10 +517,10 @@
* {@inheritDoc}
*/
@Override
- public final List<ExternalConverter> converters() {
+ public final List<ExternalClassConverter> converters() {
int count = convertersSize();
- List<ExternalConverter> converters = new ArrayList<ExternalConverter>(count);
+ List<ExternalClassConverter> converters = new ArrayList<ExternalClassConverter>(count);
for (int index = 0; index < count; index++) {
converters.add(buildConverter(index));
@@ -534,7 +534,7 @@
*/
@Override
public final int convertersSize() {
- return getChildrenSize(Converter.CONVERTER);
+ return getChildrenSize(ClassConverter.CONVERTER);
}
/**
@@ -623,9 +623,9 @@
* {@inheritDoc}
*/
@Override
- public final ExternalConverter getConverter(int index) {
+ public final ExternalClassConverter getConverter(int index) {
- if (hasChild(Converter.CONVERTER, index)) {
+ if (hasChild(ClassConverter.CONVERTER, index)) {
return buildConverter(index);
}
@@ -1005,13 +1005,14 @@
private List<ExternalMapping> mappings(Element element) {
List<ExternalMapping> mappings = new ArrayList<ExternalMapping>();
- int index = 0;
for (Element childElement : getChildren(element)) {
+
String elementName = getNodeName(childElement);
- ExternalMapping mapping = buildMapping(elementName, index++);
+ Mapping mapping = buildMapping(elementName);
if (mapping != null) {
+ mapping.calculateInsertionIndex(element, childElement, elementName);
mappings.add(mapping);
}
}
@@ -1121,7 +1122,7 @@
*/
@Override
public final void removeConverter(int index) {
- Converter converter = buildConverter(index);
+ ClassConverter converter = buildConverter(index);
converter.removeSelf();
}
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/EmbeddedIDMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/EmbeddedIDMapping.java
index 13b52ff..2917bfe 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/EmbeddedIDMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/EmbeddedIDMapping.java
@@ -32,10 +32,9 @@
* Creates a new <code>EmbeddedIDMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- EmbeddedIDMapping(MappedSuperClassEntity parent, int index) {
- super(parent, index);
+ EmbeddedIDMapping(MappedSuperClassEntity parent) {
+ super(parent);
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/EmbeddedMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/EmbeddedMapping.java
index 3b848b9..d71fbf5 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/EmbeddedMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/EmbeddedMapping.java
@@ -34,10 +34,9 @@
* Creates a new <code>EmbeddedMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- EmbeddedMapping(Embeddable parent, int index) {
- super(parent, index);
+ EmbeddedMapping(Embeddable parent) {
+ super(parent);
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Entity.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Entity.java
index 7dc30eb..9568fa8 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Entity.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Entity.java
@@ -28,7 +28,7 @@
import org.eclipse.persistence.tools.mapping.orm.ExternalPrimaryKeyJoinColumn;
import org.eclipse.persistence.tools.mapping.orm.ExternalSQLResultSetMapping;
import org.eclipse.persistence.tools.mapping.orm.ExternalSecondaryTable;
-import org.eclipse.persistence.tools.mapping.orm.ExternalStoredProcedureQuery;
+import org.eclipse.persistence.tools.mapping.orm.ExternalNamedStoredProcedureQuery;
import org.eclipse.persistence.tools.utility.ObjectTools;
import org.eclipse.persistence.tools.utility.TextRange;
import org.w3c.dom.Element;
@@ -164,7 +164,7 @@
* {@inheritDoc}
*/
@Override
- public ExternalStoredProcedureQuery addStoredProcedureQuery(String name, String procedureName) {
+ public ExternalNamedStoredProcedureQuery addStoredProcedureQuery(String name, String procedureName) {
NamedStoredProcedureQuery storedProcedureQuery = buildStoredProcedureQuery(-1);
storedProcedureQuery.addSelf();
storedProcedureQuery.setName(name);
@@ -271,7 +271,7 @@
names.add(CLASS_EXTRACTOR);
names.add(OptimisticLocking.OPTIMISTIC_LOCKING);
names.add(Cache.CACHE);
- names.add(Converter.CONVERTER);
+ names.add(ClassConverter.CONVERTER);
names.add(TypeConverter.TYPE_CONVERTER);
names.add(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
names.add(StructConverter.STRUCT_CONVERTER);
@@ -567,7 +567,7 @@
* {@inheritDoc}
*/
@Override
- public ExternalStoredProcedureQuery getStoredProcedureQuery(int index) {
+ public ExternalNamedStoredProcedureQuery getStoredProcedureQuery(int index) {
if (hasChild(NamedStoredProcedureQuery.NAMED_STORED_PROCEDURE_QUERY, index)) {
return buildStoredProcedureQuery(index);
@@ -580,9 +580,9 @@
* {@inheritDoc}
*/
@Override
- public ExternalStoredProcedureQuery getStoredProcedureQuery(int index, String name) {
+ public ExternalNamedStoredProcedureQuery getStoredProcedureQuery(int index, String name) {
- ExternalStoredProcedureQuery storedProcedureQuery = getStoredProcedureQuery(index);
+ ExternalNamedStoredProcedureQuery storedProcedureQuery = getStoredProcedureQuery(index);
if (storedProcedureQuery == null) {
return null;
@@ -832,10 +832,10 @@
* {@inheritDoc}
*/
@Override
- public List<ExternalStoredProcedureQuery> storedProcedureQueries() {
+ public List<ExternalNamedStoredProcedureQuery> storedProcedureQueries() {
int count = storedProcedureQueriesSize();
- List<ExternalStoredProcedureQuery> storedProcedureQueries = new ArrayList<ExternalStoredProcedureQuery>(count);
+ List<ExternalNamedStoredProcedureQuery> storedProcedureQueries = new ArrayList<ExternalNamedStoredProcedureQuery>(count);
for (int index = 0; index < count; index++) {
storedProcedureQueries.add(buildStoredProcedureQuery(index));
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/IdMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/IdMapping.java
index dfe68d9..1f83bec 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/IdMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/IdMapping.java
@@ -38,10 +38,9 @@
* Creates a new <code>IdMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- IdMapping(MappedSuperClassEntity parent, int index) {
- super(parent, index);
+ IdMapping(MappedSuperClassEntity parent) {
+ super(parent);
}
/**
@@ -113,7 +112,7 @@
names.add(EntityIDGeneratedValue.GENERATED_VALUE);
names.add(TEMPORAL);
names.add(CONVERT);
- names.add(Converter.CONVERTER);
+ names.add(ClassConverter.CONVERTER);
names.add(TypeConverter.TYPE_CONVERTER);
names.add(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
names.add(StructConverter.STRUCT_CONVERTER);
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ManyToManyMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ManyToManyMapping.java
index f86bf9b..48f9d76 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ManyToManyMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ManyToManyMapping.java
@@ -33,10 +33,9 @@
* Creates a new <code>ManyToManyMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- ManyToManyMapping(Embeddable parent, int index) {
- super(parent, index);
+ ManyToManyMapping(Embeddable parent) {
+ super(parent);
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ManyToOneMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ManyToOneMapping.java
index 8f1a3d4..d07762b 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ManyToOneMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ManyToOneMapping.java
@@ -34,10 +34,9 @@
* Creates a new <code>ManyToOneMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- ManyToOneMapping(Embeddable parent, int index) {
- super(parent, index);
+ ManyToOneMapping(Embeddable parent) {
+ super(parent);
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/MappedSuperClassEntity.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/MappedSuperClassEntity.java
index 0c76ac6..5482e9c 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/MappedSuperClassEntity.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/MappedSuperClassEntity.java
@@ -70,7 +70,7 @@
*/
@Override
public final ExternalEmbeddedIDMapping addEmbeddedIdMapping(String name) {
- EmbeddedIDMapping mapping = buildEmbeddedIdMapping(mappingsSize());
+ EmbeddedIDMapping mapping = buildEmbeddedIdMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -103,7 +103,7 @@
*/
@Override
public final ExternalIDMapping addIdMapping(String name) {
- IdMapping mapping = buildIdMapping(mappingsSize());
+ IdMapping mapping = buildIdMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -164,7 +164,7 @@
*/
@Override
public final ExternalTransformationMapping addTransformationMapping(String name) {
- TransformationMapping mapping = buildTransformationMapping(mappingsSize());
+ TransformationMapping mapping = buildTransformationMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -175,7 +175,7 @@
*/
@Override
public final ExternalVariableOneToOneMapping addVariableOneToOneMapping(String name) {
- VariableOneToOneMapping mapping = buildVariableOneToOneMapping(mappingsSize());
+ VariableOneToOneMapping mapping = buildVariableOneToOneMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -186,7 +186,7 @@
*/
@Override
public final ExternalVersionMapping addVersionMapping(String name) {
- VersionMapping mapping = buildVersionMapping(mappingsSize());
+ VersionMapping mapping = buildVersionMapping();
mapping.addSelf();
mapping.setName(name);
return mapping;
@@ -228,7 +228,7 @@
names.add(Cache.CACHE);
names.add(CACHE_INTERCEPTOR);
names.add(FetchGroup.FETCH_GROUP);
- names.add(Converter.CONVERTER);
+ names.add(ClassConverter.CONVERTER);
names.add(TypeConverter.TYPE_CONVERTER);
names.add(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
names.add(StructConverter.STRUCT_CONVERTER);
@@ -252,8 +252,8 @@
return names;
}
- private EmbeddedIDMapping buildEmbeddedIdMapping(int index) {
- return new EmbeddedIDMapping(this, index);
+ private EmbeddedIDMapping buildEmbeddedIdMapping() {
+ return new EmbeddedIDMapping(this);
}
private EntityEntityListener buildEntityListener(int index) {
@@ -264,42 +264,42 @@
return new FetchGroup(this, index);
}
- private IdMapping buildIdMapping(int index) {
- return new IdMapping(this, index);
+ private IdMapping buildIdMapping() {
+ return new IdMapping(this);
}
/**
* {@inheritDoc}
*/
@Override
- Mapping buildMapping(String elementName, int index) {
+ Mapping buildMapping(String elementName) {
// Embedded ID
if (ObjectTools.equals(elementName, EmbeddedIDMapping.EMBEDDED_ID)) {
- return buildEmbeddedIdMapping(index);
+ return buildEmbeddedIdMapping();
}
// ID
if (ObjectTools.equals(elementName, IdMapping.ID)) {
- return buildIdMapping(index);
+ return buildIdMapping();
}
// Transformation
if (ObjectTools.equals(elementName, TransformationMapping.TRANSFORMATION)) {
- return buildTransformationMapping(index);
+ return buildTransformationMapping();
}
// Variable 1:1
if (ObjectTools.equals(elementName, VariableOneToOneMapping.VARIABLE_ONE_TO_ONE)) {
- return buildVariableOneToOneMapping(index);
+ return buildVariableOneToOneMapping();
}
// Version
if (ObjectTools.equals(elementName, VersionMapping.VERSION)) {
- return buildVersionMapping(index);
+ return buildVersionMapping();
}
- return super.buildMapping(elementName, index);
+ return super.buildMapping(elementName);
}
private MultitenancyPolicy buildMultitenant() {
@@ -322,16 +322,16 @@
return new TableGenerator(this, -1);
}
- private TransformationMapping buildTransformationMapping(int index) {
- return new TransformationMapping(this, index);
+ private TransformationMapping buildTransformationMapping() {
+ return new TransformationMapping(this);
}
- private VariableOneToOneMapping buildVariableOneToOneMapping(int index) {
- return new VariableOneToOneMapping(this, index);
+ private VariableOneToOneMapping buildVariableOneToOneMapping() {
+ return new VariableOneToOneMapping(this);
}
- private VersionMapping buildVersionMapping(int index) {
- return new VersionMapping(this, index);
+ private VersionMapping buildVersionMapping() {
+ return new VersionMapping(this);
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Mapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Mapping.java
index 503b151..983e822 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Mapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/Mapping.java
@@ -41,11 +41,9 @@
* Creates a new <code>Mapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- Mapping(Embeddable parent, int index) {
+ Mapping(Embeddable parent) {
super(parent);
- this.index = index;
}
/**
@@ -114,7 +112,7 @@
Element element = getChild(getParent(), ATTRIBUTES);
if (element != null) {
- return getChild(element, index);
+ return getChild(element, getElementName(), index);
}
return null;
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/NamedStoredProcedureQuery.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/NamedStoredProcedureQuery.java
index 6a7e602..d8fa029 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/NamedStoredProcedureQuery.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/NamedStoredProcedureQuery.java
@@ -17,7 +17,7 @@
import java.util.List;
import org.eclipse.persistence.tools.mapping.AbstractExternalForm;
import org.eclipse.persistence.tools.mapping.orm.ExternalStoredProcedureParameter;
-import org.eclipse.persistence.tools.mapping.orm.ExternalStoredProcedureQuery;
+import org.eclipse.persistence.tools.mapping.orm.ExternalNamedStoredProcedureQuery;
import org.eclipse.persistence.tools.utility.TextRange;
/**
@@ -29,7 +29,7 @@
* @version 2.6
*/
final class NamedStoredProcedureQuery extends AbstractQuery
- implements ExternalStoredProcedureQuery {
+ implements ExternalNamedStoredProcedureQuery {
/**
* Creates a new <code>NamedStoredProcedureQuery</code>.
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/NonTransientMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/NonTransientMapping.java
index ce701fb..59e964b 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/NonTransientMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/NonTransientMapping.java
@@ -36,10 +36,9 @@
* Creates a new <code>NonTransientMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- NonTransientMapping(Embeddable parent, int index) {
- super(parent, index);
+ NonTransientMapping(Embeddable parent) {
+ super(parent);
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ORMConfiguration.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ORMConfiguration.java
index bce45bb..d32e339 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ORMConfiguration.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ORMConfiguration.java
@@ -25,18 +25,18 @@
import org.eclipse.persistence.tools.mapping.ExternalFormHelper;
import org.eclipse.persistence.tools.mapping.orm.AccessType;
import org.eclipse.persistence.tools.mapping.orm.ExternalBasicNamedQuery;
-import org.eclipse.persistence.tools.mapping.orm.ExternalConverter;
+import org.eclipse.persistence.tools.mapping.orm.ExternalClassConverter;
import org.eclipse.persistence.tools.mapping.orm.ExternalEmbeddable;
import org.eclipse.persistence.tools.mapping.orm.ExternalEntity;
import org.eclipse.persistence.tools.mapping.orm.ExternalMappedSuperClass;
import org.eclipse.persistence.tools.mapping.orm.ExternalNamedQuery;
+import org.eclipse.persistence.tools.mapping.orm.ExternalNamedStoredProcedureQuery;
import org.eclipse.persistence.tools.mapping.orm.ExternalNativeQuery;
import org.eclipse.persistence.tools.mapping.orm.ExternalORMConfiguration;
import org.eclipse.persistence.tools.mapping.orm.ExternalObjectTypeConverter;
import org.eclipse.persistence.tools.mapping.orm.ExternalPersistenceUnit;
import org.eclipse.persistence.tools.mapping.orm.ExternalSQLResultSetMapping;
import org.eclipse.persistence.tools.mapping.orm.ExternalSequenceGenerator;
-import org.eclipse.persistence.tools.mapping.orm.ExternalStoredProcedureQuery;
import org.eclipse.persistence.tools.mapping.orm.ExternalStructConverter;
import org.eclipse.persistence.tools.mapping.orm.ExternalTableGenerator;
import org.eclipse.persistence.tools.mapping.orm.ExternalTenantDiscriminatorColumn;
@@ -75,8 +75,8 @@
* {@inheritDoc}
*/
@Override
- public ExternalConverter addConverter() {
- Converter converter = buildConverter(-1);
+ public ExternalClassConverter addConverter() {
+ ClassConverter converter = buildConverter(-1);
converter.addSelf();
return converter;
}
@@ -139,7 +139,7 @@
* {@inheritDoc}
*/
@Override
- public ExternalNamedQuery addNamedQuery(String name) {
+ public ExternalBasicNamedQuery addNamedQuery(String name) {
NamedQuery query = buildNamedQuery(-1);
query.addSelf();
query.setName(name);
@@ -150,6 +150,17 @@
* {@inheritDoc}
*/
@Override
+ public ExternalNamedStoredProcedureQuery addNamedStoredProcedureQuery(String name) {
+ NamedStoredProcedureQuery query = buildStoredProcedureQuery(-1);
+ query.addSelf();
+ query.setName(name);
+ return query;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public ExternalObjectTypeConverter addObjectTypeConverter() {
ObjectTypeConverter converter = buildObjectTypeConverter(-1);
converter.addSelf();
@@ -208,18 +219,6 @@
* {@inheritDoc}
*/
@Override
- public ExternalStoredProcedureQuery addStoredProcedureQuery(String name, String procedureName) {
- NamedStoredProcedureQuery query = buildStoredProcedureQuery(-1);
- query.addSelf();
- query.setName(name);
- query.setProcedureName(procedureName);
- return query;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public ExternalStructConverter addStructConverter() {
StructConverter converter = buildStructConverter(-1);
converter.addSelf();
@@ -247,8 +246,8 @@
return converter;
}
- private Converter buildConverter(int index) {
- return new Converter(this, index);
+ private ClassConverter buildConverter(int index) {
+ return new ClassConverter(this, index);
}
private TenantDiscriminatorColumn buildDiscriminatorColumn(int index) {
@@ -268,7 +267,7 @@
names.add(SCHEMA);
names.add(CATALOG);
names.add(ACCESS);
- names.add(Converter.CONVERTER);
+ names.add(ClassConverter.CONVERTER);
names.add(TypeConverter.TYPE_CONVERTER);
names.add(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
names.add(StructConverter.STRUCT_CONVERTER);
@@ -350,10 +349,10 @@
* {@inheritDoc}
*/
@Override
- public List<ExternalConverter> converters() {
+ public List<ExternalClassConverter> converters() {
int count = convertersSize();
- List<ExternalConverter> converters = new ArrayList<ExternalConverter>(count);
+ List<ExternalClassConverter> converters = new ArrayList<ExternalClassConverter>(count);
for (int index = 0; index < count; index++) {
converters.add(buildConverter(index));
@@ -367,7 +366,7 @@
*/
@Override
public int convertersSize() {
- return getChildrenSize(Converter.CONVERTER);
+ return getChildrenSize(ClassConverter.CONVERTER);
}
/**
@@ -486,9 +485,9 @@
* {@inheritDoc}
*/
@Override
- public ExternalConverter getConverter(int index) {
+ public ExternalClassConverter getConverter(int index) {
- if (hasChild(Converter.CONVERTER, index)) {
+ if (hasChild(ClassConverter.CONVERTER, index)) {
return buildConverter(index);
}
@@ -700,13 +699,26 @@
* {@inheritDoc}
*/
@Override
+ public ExternalNamedStoredProcedureQuery getNamedStoredProcedureQuery(int index) {
+
+ if (hasChild(NamedStoredProcedureQuery.NAMED_STORED_PROCEDURE_QUERY, index)) {
+ return buildStoredProcedureQuery(index);
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public ExternalObjectTypeConverter getObjectTypeConverter(int index) {
if (hasChild(ObjectTypeConverter.OBJECT_TYPE_CONVERTER, index)) {
- return null;
+ return buildObjectTypeConverter(index);
}
- return buildObjectTypeConverter(index);
+ return null;
}
/**
@@ -800,19 +812,6 @@
* {@inheritDoc}
*/
@Override
- public ExternalStoredProcedureQuery getStoredProcedureQuery(int index) {
-
- if (hasChild(NamedStoredProcedureQuery.NAMED_STORED_PROCEDURE_QUERY, index)) {
- return buildStoredProcedureQuery(index);
- }
-
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public ExternalStructConverter getStructConverter(int index) {
if (hasChild(StructConverter.STRUCT_CONVERTER, index)) {
@@ -938,10 +937,10 @@
* {@inheritDoc}
*/
@Override
- public List<ExternalNamedQuery> namedQueries() {
+ public List<ExternalBasicNamedQuery> namedQueries() {
int count = namedQueriesSize();
- List<ExternalNamedQuery> namedQueries = new ArrayList<ExternalNamedQuery>(count);
+ List<ExternalBasicNamedQuery> namedQueries = new ArrayList<ExternalBasicNamedQuery>(count);
for (int index = 0; index < count; index++) {
namedQueries.add(buildNamedQuery(index));
@@ -987,7 +986,7 @@
*/
@Override
public void removeConverter(int index) {
- Converter converter = buildConverter(index);
+ ClassConverter converter = buildConverter(index);
converter.removeSelf();
}
@@ -1244,10 +1243,10 @@
* {@inheritDoc}
*/
@Override
- public List<ExternalStoredProcedureQuery> storedProcedureQueries() {
+ public List<ExternalNamedStoredProcedureQuery> storedProcedureQueries() {
int count = storedProcedureQueriesSize();
- List<ExternalStoredProcedureQuery> storedProcedureQueries = new ArrayList<ExternalStoredProcedureQuery>(count);
+ List<ExternalNamedStoredProcedureQuery> storedProcedureQueries = new ArrayList<ExternalNamedStoredProcedureQuery>(count);
for (int index = 0; index < count; index++) {
storedProcedureQueries.add(buildStoredProcedureQuery(index));
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ObjectCollectionMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ObjectCollectionMapping.java
index 31b852b..bd307de 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ObjectCollectionMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ObjectCollectionMapping.java
@@ -40,10 +40,9 @@
* Creates a new <code>ObjectCollectionMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- ObjectCollectionMapping(Embeddable parent, int index) {
- super(parent, index);
+ ObjectCollectionMapping(Embeddable parent) {
+ super(parent);
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ObjectTypeConverter.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ObjectTypeConverter.java
index 8fe63d3..da355de 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ObjectTypeConverter.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/ObjectTypeConverter.java
@@ -19,30 +19,23 @@
import org.eclipse.persistence.tools.mapping.orm.ExternalConversionValue;
import org.eclipse.persistence.tools.mapping.orm.ExternalObjectTypeConverter;
import org.eclipse.persistence.tools.utility.TextRange;
-import org.w3c.dom.Element;
/**
* The external form of a object type converter.
*
* @version 2.6
*/
-final class ObjectTypeConverter extends AbstractExternalForm
+final class ObjectTypeConverter extends AbstractConverter
implements ExternalObjectTypeConverter {
/**
- * The position of the element within the list of children with the same type owned by the parent.
- */
- private int index;
-
- /**
* Creates a new <code>ObjectTypeConverter</code>.
*
* @param parent The parent of this external form
* @param index The position of the element within the list of children with the same type owned by the parent
*/
ObjectTypeConverter(AbstractExternalForm parent, int index) {
- super(parent);
- this.index = index;
+ super(parent, index);
}
/**
@@ -86,14 +79,6 @@
* {@inheritDoc}
*/
@Override
- protected void calculateInsertionIndex(Element parent, Element child, String elementName) {
- index = index(parent, child, elementName);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public List<ExternalConversionValue> conversionValues() {
int count = conversionValuesSize();
@@ -163,45 +148,10 @@
* {@inheritDoc}
*/
@Override
- public Element getElement() {
-
- if (index == -1) {
- return super.getElement();
- }
-
- return getChild(getParent(), getElementName(), index);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected String getElementName() {
return OBJECT_TYPE_CONVERTER;
}
- @Override
- @Deprecated
- public int getIndex() {
- return index;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getName() {
- return getAttribute(NAME);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public TextRange getNameTextRange() {
- return getAttributeTextRange(NAME);
- }
-
/**
* {@inheritDoc}
*/
@@ -239,19 +189,6 @@
* {@inheritDoc}
*/
@Override
- public void removeSelf() {
- if (index == -1) {
- super.removeSelf();
- }
- else {
- removeChild(getParent(), getElementName(), index);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public void setDatatype(String datatypeName) {
setAttribute(DATA_TYPE, datatypeName);
}
@@ -268,14 +205,6 @@
* {@inheritDoc}
*/
@Override
- public void setName(String name) {
- setAttribute(NAME, name);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public void setObjecttype(String objecttypeName) {
setAttribute(OBJECT_TYPE, objecttypeName);
}
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/OneToManyMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/OneToManyMapping.java
index 283d0e2..77b544e 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/OneToManyMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/OneToManyMapping.java
@@ -35,11 +35,9 @@
* Creates a new <code>OneToManyMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned
- * by the parent
*/
- OneToManyMapping(Embeddable parent, int index) {
- super(parent, index);
+ OneToManyMapping(Embeddable parent) {
+ super(parent);
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/OneToOneMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/OneToOneMapping.java
index 18b7204..dcf9a7e 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/OneToOneMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/OneToOneMapping.java
@@ -35,10 +35,9 @@
* Creates a new <code>OneToOneMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- OneToOneMapping(Embeddable parent, int index) {
- super(parent, index);
+ OneToOneMapping(Embeddable parent) {
+ super(parent);
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/PrimaryKeyGenerator.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/PrimaryKeyGenerator.java
index 157b020..f50f265 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/PrimaryKeyGenerator.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/PrimaryKeyGenerator.java
@@ -63,7 +63,9 @@
*/
@Override
protected void calculateInsertionIndex(Element parent, Element child, String elementName) {
- index = index(parent, child, elementName);
+ if (elementName == getElementName()) {
+ index = index(parent, child, elementName);
+ }
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/RelationshipMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/RelationshipMapping.java
index a22a7c5..09d24d4 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/RelationshipMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/RelationshipMapping.java
@@ -45,10 +45,9 @@
* Creates a new <code>RelationshipMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- RelationshipMapping(Embeddable parent, int index) {
- super(parent, index);
+ RelationshipMapping(Embeddable parent) {
+ super(parent);
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/StructConverter.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/StructConverter.java
index 7ec7a32..451c443 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/StructConverter.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/StructConverter.java
@@ -13,12 +13,14 @@
******************************************************************************/
package org.eclipse.persistence.tools.mapping.orm.dom;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.persistence.tools.mapping.AbstractExternalForm;
import org.eclipse.persistence.tools.mapping.orm.ExternalStructConverter;
+import org.eclipse.persistence.tools.utility.TextRange;
/**
- * The external form of a struct converter, which is a child of an entity.
+ * The external form of a struct converter.
*
* @see BasicMapMapping
* @see ConvertibleMapping
@@ -28,7 +30,7 @@
*
* @version 2.6
*/
-final class StructConverter extends ClassConverter
+final class StructConverter extends AbstractConverter
implements ExternalStructConverter {
/**
@@ -46,8 +48,9 @@
*/
@Override
protected List<String> buildAttributeNamesOrder() {
- List<String> names = super.buildAttributeNamesOrder();
+ List<String> names = new ArrayList<String>();
names.add(NAME);
+ names.add(CONVERTER);
return names;
}
@@ -55,8 +58,16 @@
* {@inheritDoc}
*/
@Override
- String getConverterClassElementName() {
- return CONVERTER;
+ public String getConverter() {
+ return getAttribute(CONVERTER);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public TextRange getConverterTextRange() {
+ return getAttributeTextRange(CONVERTER);
}
/**
@@ -66,4 +77,12 @@
protected String getElementName() {
return STRUCT_CONVERTER;
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setConverter(String classname) {
+ setAttribute(CONVERTER, classname);
+ }
}
\ No newline at end of file
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/TransformationMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/TransformationMapping.java
index 7e68149..3a53464 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/TransformationMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/TransformationMapping.java
@@ -36,10 +36,9 @@
* Creates a new <code>TransformationMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- TransformationMapping(Embeddable parent, int index) {
- super(parent, index);
+ TransformationMapping(Embeddable parent) {
+ super(parent);
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/TransientMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/TransientMapping.java
index 1ed36ed..bda39ad 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/TransientMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/TransientMapping.java
@@ -29,10 +29,9 @@
* Creates a new <code>TransientMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- TransientMapping(Embeddable parent, int index) {
- super(parent, index);
+ TransientMapping(Embeddable parent) {
+ super(parent);
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/TypeConverter.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/TypeConverter.java
index af695c9..f5c4d8f 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/TypeConverter.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/TypeConverter.java
@@ -18,7 +18,6 @@
import org.eclipse.persistence.tools.mapping.AbstractExternalForm;
import org.eclipse.persistence.tools.mapping.orm.ExternalTypeConverter;
import org.eclipse.persistence.tools.utility.TextRange;
-import org.w3c.dom.Element;
/**
* The external form of a type converter, which is a child of an entity.
@@ -29,23 +28,17 @@
*
* @version 2.6
*/
-final class TypeConverter extends AbstractExternalForm
+final class TypeConverter extends AbstractConverter
implements ExternalTypeConverter {
/**
- * The position of the element within the list of children with the same type owned by the parent.
- */
- private int index;
-
- /**
* Creates a new <code>TypeConverter</code>.
*
* @param parent The parent of this external form
* @param index The position of the element within the list of children with the same type owned by the parent
*/
TypeConverter(AbstractExternalForm parent, int index) {
- super(parent);
- this.index = index;
+ super(parent, index);
}
/**
@@ -64,14 +57,6 @@
* {@inheritDoc}
*/
@Override
- protected void calculateInsertionIndex(Element parent, Element child, String elementName) {
- index = index(parent, child, elementName);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public String getDatatype() {
return getAttribute(DATA_TYPE);
}
@@ -88,45 +73,10 @@
* {@inheritDoc}
*/
@Override
- public Element getElement() {
-
- if (index == -1) {
- return super.getElement();
- }
-
- return getChild(getParent(), getElementName(), index);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected String getElementName() {
return TYPE_CONVERTER;
}
- @Override
- @Deprecated
- public int getIndex() {
- return index;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getName() {
- return getAttribute(NAME);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public TextRange getNameTextRange() {
- return getAttributeTextRange(NAME);
- }
-
/**
* {@inheritDoc}
*/
@@ -147,19 +97,6 @@
* {@inheritDoc}
*/
@Override
- public void removeSelf() {
- if (index == -1) {
- super.removeSelf();
- }
- else {
- removeChild(getParent(), getElementName(), index);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public void setDatatype(String datatypeName) {
setAttribute(DATA_TYPE, datatypeName);
}
@@ -168,14 +105,6 @@
* {@inheritDoc}
*/
@Override
- public void setName(String name) {
- setAttribute(NAME, name);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public void setObjecttype(String objecttypeName) {
setAttribute(OBJECT_TYPE, objecttypeName);
}
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/VariableOneToOneMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/VariableOneToOneMapping.java
index 4d6c8d7..39b7bba 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/VariableOneToOneMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/VariableOneToOneMapping.java
@@ -45,10 +45,9 @@
* Creates a new <code>VariableOneToOneMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- VariableOneToOneMapping(Embeddable parent, int index) {
- super(parent, index);
+ VariableOneToOneMapping(Embeddable parent) {
+ super(parent);
}
/**
diff --git a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/VersionMapping.java b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/VersionMapping.java
index 2fc7a7e..d730fb5 100644
--- a/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/VersionMapping.java
+++ b/tools/org.eclipse.persistence.tools.mapping/src/org/eclipse/persistence/tools/mapping/orm/dom/VersionMapping.java
@@ -34,10 +34,9 @@
* Creates a new <code>VersionMapping</code>.
*
* @param parent The parent of this external form
- * @param index The position of the element within the list of children with the same type owned by the parent
*/
- VersionMapping(MappedSuperClassEntity parent, int index) {
- super(parent, index);
+ VersionMapping(MappedSuperClassEntity parent) {
+ super(parent);
}
/**
@@ -76,7 +75,7 @@
names.add(EntityColumn.COLUMN);
names.add(TEMPORAL);
names.add(CONVERT);
- names.add(Converter.CONVERTER);
+ names.add(ClassConverter.CONVERTER);
names.add(TypeConverter.TYPE_CONVERTER);
names.add(ObjectTypeConverter.OBJECT_TYPE_CONVERTER);
names.add(StructConverter.STRUCT_CONVERTER);
diff --git a/tools/org.eclipse.persistence.tools.utility.tests/CommonUtilityTests.launch b/tools/org.eclipse.persistence.tools.utility.tests/CommonUtilityTests.launch
index 17156e4..f153bff 100644
--- a/tools/org.eclipse.persistence.tools.utility.tests/CommonUtilityTests.launch
+++ b/tools/org.eclipse.persistence.tools.utility.tests/CommonUtilityTests.launch
@@ -7,6 +7,9 @@
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.debug.ui.ATTR_CONSOLE_ENCODING" value="UTF-8"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
diff --git a/tools/org.eclipse.persistence.tools.utility.tests/antbuild.properties b/tools/org.eclipse.persistence.tools.utility.tests/antbuild.properties
new file mode 100644
index 0000000..39d8ff0
--- /dev/null
+++ b/tools/org.eclipse.persistence.tools.utility.tests/antbuild.properties
@@ -0,0 +1,43 @@
+custom=true
+# Edit this if/when the release number changes
+release.version=2.6.0
+
+# Link to dependencies not in Git, assumes default location, if you store elsewhere you need to edit these.
+junit.lib=${extensions.depend.dir}/junit-4.11.jar
+hamcrest.lib=${extensions.depend.dir}/hamcrest-core-1.3.jar
+persistence.lib=${extensions.depend.dir}/javax.persistence_2.1.0.v201304241213.jar
+eclipselink.lib=${extensions.depend.dir}/eclipselink.jar
+
+# Edit this property to "true" to enable debug attributes like lines, variables and source-filename.
+javac.debug=true
+javac.debuglevel=lines,vars,source
+
+# Edit this property when you would like to override the java version during testing
+javac.version=1.6
+
+# Edit this property to increase the maxMemory heap memory used by the tests if you get an
+# OutOfMemoryException - use JConsole.exe to triage the memory spike at the end of the test
+# The current default is 768m (the LC "m" is required")
+max.heap.memory=768m
+
+# Do not edit the properties below.
+
+# General Infrastructure Definitions
+--------------------------------------
+test.properties=./test.properties
+classes.dir=target/classes
+report.dir=reports
+resource.dir=resource
+resource.source.dir=resource/source
+run.dir=run
+src.dir=src
+
+# Build Artifact Definitions
+-------------------------------
+
+# Mapping Tests Definitions
+----------------------------
+test.class=org.eclipse.persistence.tools.utility.tests.CommonUtilityTests
+
+# General 3rd-Party API jar definitions
+-----------------------------------------
diff --git a/tools/org.eclipse.persistence.tools.utility.tests/antbuild.xml b/tools/org.eclipse.persistence.tools.utility.tests/antbuild.xml
index 4af0fc1..0bb9c98 100644
--- a/tools/org.eclipse.persistence.tools.utility.tests/antbuild.xml
+++ b/tools/org.eclipse.persistence.tools.utility.tests/antbuild.xml
@@ -1,51 +1,155 @@
-<?xml version="1.0"?>
-<!--
- Copyright (c) 2007, 2013 Oracle and/or its affiliates. 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
- -->
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.persistence.tools.utility.tests"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.persistence.tools.utility.tests.internal.CommonUtilityTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite, cleanup">
- </target>
+<!--/*******************************************************************************
+* 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.
+*
+* Ant naming conventions:
+* - regardless of the actual OS platform,'/' is the directory separator
+* (Ant will convert as appropriate).
+* - multi-word properties use periods '.'
+* - properties ending in .jar define jarfile names only (no path)
+* - properties ending in .lib are fully qualified jars (path and filename)
+* - properties ending in .dir are directory paths
+* - properties ending in .path are path refid names (classpath fragments)
+* - multi-word targets use hyphens '-'
+* - targets beginning with test- are reserved for high level test targets,
+* and are used in test results parsing
+* - targets typically use the form <action>-<object>-<type> (ie. package-bundle-zip)
+* - multi-word macros use underscores '_'
+* - multi-word macro attributes are concatenated
+* e.g. 'runpathref'
+* - multi-word tasks (taskdef) names are concatenated
+* e.g. 'validateconnection'
+* - OS environment variables are in ALLCAPS and have 'env' as a prefix
+* e.g. ${env.XXX}.
+* - Ant properties are lower case.
+*
+* Contributors:
+* pfilion - initial API and implementation
+#******************************************************************************/-->
+
+<!-- This ant project includes the following tasks:
+ - test (default) : runs CommonUtilityTests
+
+ It requires some configuration of the build.properties and test.properties to run.
+-->
+<project name="eclipselink.utility.test" default="test" basedir=".">
+ <available file="../${ant.project.name}" type="dir" property="utility.test.is.local"/>
+
+ <dirname property="utility.test.build.location_temp" file="${ant.file.eclipselink.utility.test}"/>
+ <pathconvert targetos="unix" property="utility.test.build.location">
+ <path>
+ <pathelement location="${utility.test.build.location_temp}"/>
+ </path>
+ </pathconvert>
+ <property name="env" environment="env" value="env"/>
+
+ <!-- Allows a user to overide certain user specific properties. -->
+ <!-- local property overrides -->
+ <condition property="custom.bld.properties.message" value="Loading user-defined overrides from '${user.home}/build.properties'..."
+ else="No user-defined overrides found to load ('${user.home}/build.properties' non-existant).">
+ <available file="${user.home}/build.properties"/>
+ </condition>
+ <echo message="${custom.bld.properties.message}"/>
+ <property file="${user.home}/build.properties"/>
+ <condition property="custom.tst.properties.message" value="Loading user-defined test overrides from '${user.home}/test.properties'..."
+ else="No user-defined test overrides found to load ('${user.home}/test.properties' non-existant).">
+ <available file="${user.home}/test.properties"/>
+ </condition>
+ <echo message="${custom.tst.properties.message}"/>
+ <property file="${user.home}/test.properties"/>
+ <!-- Allows overriding defaults where access to user.home isn't allowed -->
+ <condition property="custom.local.properties.message" value="Loading local overrides from '${basedir}/local.build.properties'..."
+ else="No Local overrides found to load. ('${basedir}/local.build.properties' non-existant).">
+ <available file="${basedir}/local.build.properties"/>
+ </condition>
+ <echo message="${custom.local.properties.message}"/>
+ <property file="${basedir}/local.build.properties"/>
+
+ <!-- Allows override of the build location or "basedir" for specific configurations (can specifically define utility.test.basedir) -->
+ <property name="utility.test.basedir" value="${utility.test.build.location}"/>
+ <property file="${utility.test.basedir}/antbuild.properties"/>
+ <!-- Allows specific suites/configurations to override defaults and add custom test (runtime) properties -->
+ <property file="${utility.test.basedir}/${test.properties}"/>
+ <property file="${utility.test.basedir}/test.properties"/>
+
+ <property name="utility.test.common.plugins.dir" value="${tools.root}/target"/>
+
+ <property name="version.qualifier" value="qualifier"/>
+ <property name="version.string" value="${release.version}.${version.qualifier}"/>
+
+ <echo message="ant.project.name = '${ant.project.name}'"/>
+ <echo message="utility.test.build.location = '${utility.test.build.location}'"/>
+ <echo message="utility.test.base.dir = '${utility.test.base.dir}'"/>
+ <echo message="utility.test.common.plugins.dir = '${utility.test.common.plugins.dir}'"/>
+
+ <target name="config-classpath">
+ <config-run-path/>
+ </target>
+
+ <macrodef name="config-run-path">
+ <sequential>
+ <echo message="Configuring compile.path to:"/>
+ <echo message=" '${junit.lib}'"/>
+ <echo message=" '${hamcrest.lib}'"/>
+ <echo message=" '${utility.test.common.plugins.dir}/org.eclipse.persistence.tools.utility_*.jar'"/>
+ <echo message=" '${utility.test.common.plugins.dir}/org.eclipse.persistence.tools.utility.tests_*.jar'"/>
+ <echo message=" "/>
+ <path id="run.classpath">
+ <pathelement path="${junit.lib}"/>
+ <pathelement path="${hamcrest.lib}"/>
+ <fileset dir="${utility.test.common.plugins.dir}" includes="org.eclipse.persistence.tools.utility_*.jar"/>
+ <fileset dir="${utility.test.common.plugins.dir}" includes="org.eclipse.persistence.tools.utility.tests_*.jar"/>
+ </path>
+ </sequential>
+ </macrodef>
+
+ <!-- Clean all build generated content. -->
+ <target name="clean-test" description="Clean the test">
+ <delete dir="${utility.test.basedir}/${report.dir}"/>
+ <delete dir="${utility.test.basedir}/${run.dir}"/>
+ <mkdir dir="${utility.test.basedir}/${report.dir}"/>
+ <mkdir dir="${utility.test.basedir}/${run.dir}"/>
+ </target>
+
+ <!-- Default test target, run the CommonUtilityTests -->
+ <target name="test" depends="clean-test, config-classpath">
+ <antcall target="run-test" inheritRefs="true">
+ <param name="TEST_CLASS" value="${test.class}"/>
+ <param name="RUN_PATH" value="run.classpath"/>
+ </antcall>
+ <antcall target="generate-report" inheritRefs="true"/>
+ </target>
+
+ <!-- Generic target for running tests -->
+ <target name="run-test" depends="config-classpath">
+
+ <!-- Can be set e.g. in test.properties to add VM options for a particular platform/driver -->
+ <property name="additional.jvmargs" value="-Ddummy2=dummy"/>
+
+ <junit printsummary="yes" haltonfailure="yes" fork="yes" forkmode="once" showoutput="true" maxmemory="${max.heap.memory}" dir="${run.dir}">
+ <jvmarg value="-Declipselink.logging.level=${logging.level}"/>
+ <jvmarg line="${additional.jvmargs}"/>
+ <classpath>
+ <path refid="${RUN_PATH}"/>
+ </classpath>
+ <formatter type="xml"/>
+ <test name="${TEST_CLASS}" haltonfailure="no" outfile="${report.dir}/${TEST_CLASS}-test-results">
+ </test>
+ </junit>
+ </target>
+
+ <!-- Generate the EclipseLink Tools Utility tests report -->
+ <target name="generate-report">
+ <junitreport todir="${utility.test.basedir}/${report.dir}">
+ <fileset dir="${utility.test.basedir}/${report.dir}">
+ <include name="*test-results.xml"/>
+ </fileset>
+ <report format="noframes" todir="${utility.test.basedir}/${report.dir}"/>
+ </junitreport>
+ </target>
+
</project>
\ No newline at end of file
diff --git a/tools/org.eclipse.persistence.tools.utility.tests/src/org/eclipse/persistence/tools/utility/tests/ClasspathTests.java b/tools/org.eclipse.persistence.tools.utility.tests/src/org/eclipse/persistence/tools/utility/tests/ClasspathTests.java
index da43e7d..b3d5ef7 100644
--- a/tools/org.eclipse.persistence.tools.utility.tests/src/org/eclipse/persistence/tools/utility/tests/ClasspathTests.java
+++ b/tools/org.eclipse.persistence.tools.utility.tests/src/org/eclipse/persistence/tools/utility/tests/ClasspathTests.java
@@ -25,6 +25,7 @@
import org.eclipse.persistence.tools.utility.ArrayTools;
import org.eclipse.persistence.tools.utility.Classpath;
import org.eclipse.persistence.tools.utility.SystemTools;
+import org.eclipse.persistence.tools.utility.io.FileTools;
import org.eclipse.persistence.tools.utility.iterable.IterableTools;
import org.eclipse.persistence.tools.utility.iterator.IteratorTools;
@@ -281,6 +282,7 @@
}
char sep = File.separatorChar;
String stdExtJarName = JAVA_HOME + sep + "lib" + sep + "ext" + sep + "dnsns.jar";
+ stdExtJarName = FileTools.canonicalFileName(stdExtJarName);
String msg = "JDK standard extension jar missing: " + stdExtJarName;
boolean jarPresent = jarNames.contains(stdExtJarName);
if (SystemTools.jvmIsSun() || (SystemTools.jvmIsIBM() && SystemTools.javaSpecificationVersionIsGreaterThan("1.5"))) {