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
Constructor and Description |
---|
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.
|
void |
executeUpdate(UpdateScript update)
Submits an
UpdateScript for execution on the DataContext . |
protected Schema |
getMainSchema() |
protected String |
getMainSchemaName() |
protected DataSet |
materializeMainSchemaTable(Table table,
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, getMainSchemaInternal, getSchemaByNameInternal, getSchemaNamesInternal, isMainSchemaTable, materializeFromItem, materializeMainSchemaTable, materializeMainSchemaTable, materializeTable
compileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, isQualifiedPathDelim, parseQuery, query, refreshSchemas
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, parseQuery, query, refreshSchemas
public 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)
protected Schema getMainSchema() throws MetaModelException
getMainSchema
in class QueryPostprocessDataContext
MetaModelException
protected String getMainSchemaName() throws MetaModelException
getMainSchemaName
in class QueryPostprocessDataContext
MetaModelException
public DataSet executeQuery(Query query)
DataContext
executeQuery
in interface DataContext
executeQuery
in class QueryPostprocessDataContext
query
- the query object to executeDataSet
produced from executing the queryprotected Number executeCountQuery(Table table, List<FilterItem> whereItems, boolean functionApproximationAllowed)
QueryPostprocessDataContext
executeCountQuery
in class QueryPostprocessDataContext
table
- 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
UnsupportedOperationException
protected DataSet materializeMainSchemaTable(Table table, Column[] columns, int maxRows)
QueryPostprocessDataContext
materializeMainSchemaTable
in class QueryPostprocessDataContext
table
- 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 void executeUpdate(UpdateScript update)
UpdateableDataContext
UpdateScript
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 UpdateableDataContext
update
- the update script to executeCopyright © 2007–2014 The Apache Software Foundation. All rights reserved.