Bug 529602: Fix failing DBWS/SDO tests

Signed-off-by: Will Dazey <dazeydev.3@gmail.com>
Reviewed-by: Lukas Jungmann <lukas.jungmann@oracle.com>
diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java
index 301a018..f4b1c4c 100644
--- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java
+++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java
@@ -24,8 +24,6 @@
  *       - 458877 : Add national character support
  *     02/23/2015-2.6 Dalia Abo Sheasha
  *       - 460607: Change DatabasePlatform StoredProcedureTerminationToken to be configurable
- *     02/14/2018-2.7 Will Dazey
- *       - 529602: Added support for CLOBs in DELETE statements for Oracle
  ******************************************************************************/
 package org.eclipse.persistence.internal.databaseaccess;
 
@@ -3518,15 +3516,4 @@
      public String getConnectionUserName() {
          throw new UnsupportedOperationException("Connection user name is not supported.");
      }
-
-    /**
-     * INTERNAL:
-     * Override this method if the platform needs to use a custom function based on the DatabaseField
-     * @return An expression for the given field set equal to a parameter matching the field
-     */
-    public Expression createExpressionFor(DatabaseField field, Expression builder) {
-        Expression subExp1 = builder.getField(field);
-        Expression subExp2 = builder.getParameter(field);
-        return subExp1.equal(subExp2);
-    }
 }
diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatasourcePlatform.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatasourcePlatform.java
index b6fb00f..7fbb662 100644
--- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatasourcePlatform.java
+++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess/DatasourcePlatform.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 1998, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018 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.
@@ -12,7 +12,9 @@
  *     09/29/2016-2.7 Tomas Kraus
  *       - 426852: @GeneratedValue(strategy=GenerationType.IDENTITY) support in Oracle 12c
  *     09/14/2017-2.6 Will Dazey
- *       - 522312: Add the eclipselink.sequencing.start-sequence-at-nextval property 
+ *       - 522312: Add the eclipselink.sequencing.start-sequence-at-nextval property
+ *     02/20/2018-2.7 Will Dazey
+ *       - 529602: Added support for CLOBs in DELETE statements for Oracle
  ******************************************************************************/
 package org.eclipse.persistence.internal.databaseaccess;
 
@@ -28,6 +30,7 @@
 import org.eclipse.persistence.descriptors.DescriptorQueryManager;
 import org.eclipse.persistence.exceptions.ConversionException;
 import org.eclipse.persistence.exceptions.ValidationException;
+import org.eclipse.persistence.expressions.Expression;
 import org.eclipse.persistence.expressions.ExpressionOperator;
 import org.eclipse.persistence.internal.helper.ClassConstants;
 import org.eclipse.persistence.internal.helper.ConversionManager;
@@ -1061,4 +1064,14 @@
             final Session session, final String defaultIdentityGenerator, final Set<String> tableNames) {
     }
 
+    /**
+     * INTERNAL:
+     * Override this method if the platform needs to use a custom function based on the DatabaseField
+     * @return An expression for the given field set equal to a parameter matching the field
+     */
+    public Expression createExpressionFor(DatabaseField field, Expression builder) {
+        Expression subExp1 = builder.getField(field);
+        Expression subExp2 = builder.getParameter(field);
+        return subExp1.equal(subExp2);
+    }
 }
diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/descriptors/ObjectBuilder.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/descriptors/ObjectBuilder.java
index c8e6c1a..5bda6a2 100644
--- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/descriptors/ObjectBuilder.java
+++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/descriptors/ObjectBuilder.java
@@ -21,7 +21,7 @@
  *       - 485984: Retrieve FetchGroup info along with getReference() from cache
  *     08/07/2016-2.7 Dalia Abo Sheasha
  *       - 499335: Multiple embeddable fields can't reference same object
- *     02/14/2018-2.7 Will Dazey
+ *     02/20/2018-2.7 Will Dazey
  *       - 529602: Added support for CLOBs in DELETE statements for Oracle
  ******************************************************************************/
 package org.eclipse.persistence.internal.descriptors;
@@ -49,6 +49,7 @@
 import org.eclipse.persistence.internal.core.descriptors.CoreObjectBuilder;
 import org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor;
 import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform;
+import org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform;
 import org.eclipse.persistence.internal.databaseaccess.Platform;
 import org.eclipse.persistence.internal.expressions.*;
 import org.eclipse.persistence.internal.helper.*;
@@ -2918,7 +2919,7 @@
         if(null != primaryKeyFields) {
             for (int index = 0; index < primaryKeyFields.size(); index++) {
                 DatabaseField primaryKeyField = (DatabaseField)primaryKeyFields.get(index);
-                subExpression = session.getPlatform().createExpressionFor(primaryKeyField, builder);
+                subExpression = ((DatasourcePlatform)session.getDatasourcePlatform()).createExpressionFor(primaryKeyField, builder);
 
                 if (expression == null) {
                     expression = subExpression;