public class SalesforceDataContext extends QueryPostprocessDataContext implements UpdateableDataContext
| Modifier and Type | Field and Description |
|---|---|
static String |
SOQL_DATE_FORMAT_IN |
static String |
SOQL_DATE_FORMAT_OUT |
static String |
SOQL_DATE_TIME_FORMAT_IN |
static String |
SOQL_DATE_TIME_FORMAT_OUT |
static String |
SOQL_TIME_FORMAT_IN |
static String |
SOQL_TIME_FORMAT_OUT |
static TimeZone |
SOQL_TIMEZONE |
INFORMATION_SCHEMA_NAME, SYSTEM_PROPERTY_CREATE_DEFAULT_TABLE_ALIAS| Constructor and Description |
|---|
SalesforceDataContext(com.sforce.soap.partner.PartnerConnection connection)
Creates a
SalesforceDataContext instance , configured with given salesforce connection. |
SalesforceDataContext(String username,
String password) |
SalesforceDataContext(String username,
String password,
String securityToken) |
SalesforceDataContext(String endpoint,
String username,
String password,
String securityToken) |
| Modifier and Type | Method and Description |
|---|---|
protected Number |
executeCountQuery(Table table,
List<FilterItem> whereItems,
boolean functionApproximationAllowed)
Executes a simple count query, if possible.
|
DataSet |
executeQuery(Query query)
Executes a query against the DataContext.
|
UpdateSummary |
executeUpdate(UpdateScript update)
Submits an
UpdateScript for execution on the DataContext. |
com.sforce.soap.partner.PartnerConnection |
getConnection()
Returns the Salesforce connection being used by this datacontext.
|
protected Schema |
getMainSchema() |
protected String |
getMainSchemaName() |
protected DataSet |
materializeMainSchemaTable(Table table,
List<Column> columns,
int maxRows)
Executes a simple one-table query against a table in the main schema of the subclasses of this class.
|
protected static void |
rewriteFilterItem(StringBuilder sb,
FilterItem filterItem) |
addConverter, executePrimaryKeyLookupQuery, getDefaultSchemaName, getSchemaByNameInternal, getSchemaNamesInternal, isMainSchemaTable, isScalarFunctionMaterialized, materializeFromItem, materializeMainSchemaTable, materializeMainSchemaTable, materializeMainSchemaTableSelect, materializeTablecompileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, isQualifiedPathDelim, onSchemaCacheRefreshed, parseQuery, query, refreshSchemasclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, parseQuery, query, refreshSchemaspublic static final TimeZone SOQL_TIMEZONE
public static final String SOQL_DATE_FORMAT_IN
public static final String SOQL_DATE_FORMAT_OUT
public static final String SOQL_DATE_TIME_FORMAT_IN
public static final String SOQL_DATE_TIME_FORMAT_OUT
public static final String SOQL_TIME_FORMAT_IN
public static final String SOQL_TIME_FORMAT_OUT
public SalesforceDataContext(String endpoint, String username, String password, String securityToken)
public SalesforceDataContext(String username, String password, String securityToken)
public SalesforceDataContext(com.sforce.soap.partner.PartnerConnection connection)
SalesforceDataContext instance , configured with given salesforce connection.connection - salesforce connection (cannot be null).public com.sforce.soap.partner.PartnerConnection getConnection()
protected Schema getMainSchema() throws MetaModelException
getMainSchema in class QueryPostprocessDataContextMetaModelExceptionprotected String getMainSchemaName() throws MetaModelException
getMainSchemaName in class QueryPostprocessDataContextMetaModelExceptionpublic DataSet executeQuery(Query query)
DataContextexecuteQuery in interface DataContextexecuteQuery in class QueryPostprocessDataContextquery - the query object to executeDataSet produced from executing the queryprotected Number executeCountQuery(Table table, List<FilterItem> whereItems, boolean functionApproximationAllowed)
QueryPostprocessDataContextexecuteCountQuery in class QueryPostprocessDataContexttable - the table on which the count is requested.whereItems - a (sometimes empty) list of WHERE items.functionApproximationAllowed - whether approximation is allowed or not.protected static void rewriteFilterItem(StringBuilder sb, FilterItem filterItem) throws UnsupportedOperationException
UnsupportedOperationExceptionprotected DataSet materializeMainSchemaTable(Table table, List<Column> columns, int maxRows)
QueryPostprocessDataContextmaterializeMainSchemaTable in class QueryPostprocessDataContexttable - the table to querycolumns - the columns of the table to querymaxRows - the maximum amount of rows needed or -1 if all rows are wanted.public UpdateSummary executeUpdate(UpdateScript update)
UpdateableDataContextUpdateScript for execution on the DataContext.
Since implementations of the DataContext vary quite a lot, there
is no golden rule as to how an update script will be executed. But the
implementors should strive towards handling an UpdateScript as a
single transactional change to the data store.executeUpdate in interface UpdateableDataContextupdate - the update script to executeCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.