METAMODEL-1115: Fixed by exposing new SalesforceDataContext constructor
authorKasper Sørensen <i.am.kasper.sorensen@gmail.com>
Mon, 22 Aug 2016 04:15:21 +0000 (21:15 -0700)
committerKasper Sørensen <i.am.kasper.sorensen@gmail.com>
Mon, 22 Aug 2016 04:26:06 +0000 (21:26 -0700)
salesforce/pom.xml
salesforce/src/main/java/org/apache/metamodel/salesforce/SalesforceDataContext.java

index c6d5ed7..307833e 100644 (file)
@@ -36,17 +36,7 @@ under the License.
                <dependency>
                        <groupId>com.force.api</groupId>
                        <artifactId>force-partner-api</artifactId>
-                       <version>24.0.0</version>
-                       <exclusions>
-                               <exclusion>
-                                       <artifactId>gson</artifactId>
-                                       <groupId>com.google.code.gson</groupId>
-                               </exclusion>
-                               <exclusion>
-                                       <artifactId>js</artifactId>
-                                       <groupId>rhino</groupId>
-                               </exclusion>
-                       </exclusions>
+                       <version>35.0.1</version>
                </dependency>
 
                <!-- provided -->
index c8add52..e1f95aa 100644 (file)
@@ -94,6 +94,30 @@ public class SalesforceDataContext extends QueryPostprocessDataContext implement
         }
     }
 
+    /**
+     * Creates a {@code SalesforceDataContext} instance , configured with given
+     * salesforce connection.
+     * 
+     * @param connection
+     *            salesforce connection (cannot be {@code null}).
+     * 
+     */
+    public SalesforceDataContext(PartnerConnection connection) {
+        if (connection == null) {
+            throw new IllegalArgumentException("connection cannot be null");
+        }
+        _connection = connection;
+    }
+
+    /**
+     * Returns the Salesforce connection being used by this datacontext.
+     * 
+     * @return the Salesforce connection
+     */
+    public PartnerConnection getConnection() {
+        return _connection;
+    }
+
     @Override
     protected Schema getMainSchema() throws MetaModelException {
         final SalesforceSchema schema = new SalesforceSchema(getMainSchemaName(), _connection);