public class CouchDbDataContext extends QueryPostprocessDataContext implements UpdateableDataContext, DocumentSourceProvider
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT |
static String |
FIELD_ID |
static String |
FIELD_REV |
static String |
SCHEMA_NAME |
INFORMATION_SCHEMA_NAME, SYSTEM_PROPERTY_CREATE_DEFAULT_TABLE_ALIAS| Constructor and Description |
|---|
CouchDbDataContext(org.ektorp.CouchDbInstance couchDbInstance) |
CouchDbDataContext(org.ektorp.CouchDbInstance couchDbInstance,
SimpleTableDef... tableDefs) |
CouchDbDataContext(org.ektorp.CouchDbInstance couchDbInstance,
String... databaseNames) |
CouchDbDataContext(org.ektorp.http.HttpClient httpClient) |
CouchDbDataContext(org.ektorp.http.HttpClient httpClient,
SimpleTableDef... tableDefs) |
CouchDbDataContext(org.ektorp.http.StdHttpClient.Builder httpClientBuilder) |
CouchDbDataContext(org.ektorp.http.StdHttpClient.Builder httpClientBuilder,
SimpleTableDef... tableDefs) |
| Modifier and Type | Method and Description |
|---|---|
protected Number |
executeCountQuery(Table table,
List<FilterItem> whereItems,
boolean functionApproximationAllowed)
Executes a simple count query, if possible.
|
protected Row |
executePrimaryKeyLookupQuery(Table table,
List<SelectItem> selectItems,
Column primaryKeyColumn,
Object keyValue)
Executes a query which obtains a row by primary key (as defined by
Column.isPrimaryKey()). |
UpdateSummary |
executeUpdate(UpdateScript script)
Submits an
UpdateScript for execution on the DataContext. |
org.ektorp.CouchDbInstance |
getCouchDbInstance() |
DocumentSource |
getDocumentSourceForTable(String sourceCollectionName)
Gets a
DocumentSource for a particular source collection. |
protected Schema |
getMainSchema() |
protected String |
getMainSchemaName() |
DocumentSource |
getMixedDocumentSourceForSampling()
Gets a
DocumentSource containing documents of mixed origin and
type. |
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 DataSet |
materializeMainSchemaTable(Table table,
List<Column> columns,
int firstRow,
int maxRows)
Executes a simple one-table query against a table in the main schema of the subclasses of this class.
|
addConverter, executeQuery, getDefaultSchemaName, getSchemaByNameInternal, getSchemaNamesInternal, isMainSchemaTable, isScalarFunctionMaterialized, materializeFromItem, 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, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, parseQuery, query, refreshSchemaspublic static final String SCHEMA_NAME
public static final int DEFAULT_PORT
public static final String FIELD_ID
public static final String FIELD_REV
public CouchDbDataContext(org.ektorp.http.StdHttpClient.Builder httpClientBuilder,
SimpleTableDef... tableDefs)
public CouchDbDataContext(org.ektorp.http.StdHttpClient.Builder httpClientBuilder)
public CouchDbDataContext(org.ektorp.http.HttpClient httpClient,
SimpleTableDef... tableDefs)
public CouchDbDataContext(org.ektorp.http.HttpClient httpClient)
public CouchDbDataContext(org.ektorp.CouchDbInstance couchDbInstance)
public CouchDbDataContext(org.ektorp.CouchDbInstance couchDbInstance,
String... databaseNames)
public CouchDbDataContext(org.ektorp.CouchDbInstance couchDbInstance,
SimpleTableDef... tableDefs)
public org.ektorp.CouchDbInstance getCouchDbInstance()
protected Schema getMainSchema() throws MetaModelException
getMainSchema in class QueryPostprocessDataContextMetaModelExceptionprotected String getMainSchemaName() throws MetaModelException
getMainSchemaName in class QueryPostprocessDataContextMetaModelExceptionprotected DataSet materializeMainSchemaTable(Table table, List<Column> columns, int firstRow, int maxRows)
QueryPostprocessDataContextQueryPostprocessDataContext.materializeMainSchemaTable(Table, List, int) and apply a
FirstRowDataSet if necessary.materializeMainSchemaTable in class QueryPostprocessDataContextprotected 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.protected Row executePrimaryKeyLookupQuery(Table table, List<SelectItem> selectItems, Column primaryKeyColumn, Object keyValue)
QueryPostprocessDataContextColumn.isPrimaryKey()). This method is
provided to allow subclasses to optimize lookup queries since they are quite common and often a datastore can
retrieve the row using some specialized means which is much more performant than scanning all records manually.executePrimaryKeyLookupQuery in class QueryPostprocessDataContexttable - the table on which the lookup is requested.selectItems - the items to select from the lookup query.primaryKeyColumn - the column that is the primary keykeyValue - the primary key value that is specified in the lookup query.protected 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.public UpdateSummary executeUpdate(UpdateScript script)
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 UpdateableDataContextscript - the update script to executepublic DocumentSource getMixedDocumentSourceForSampling()
DocumentSourceProviderDocumentSource containing documents of mixed origin and
type.getMixedDocumentSourceForSampling in interface DocumentSourceProviderpublic DocumentSource getDocumentSourceForTable(String sourceCollectionName)
DocumentSourceProviderDocumentSource for a particular source collection. See
Document.getSourceCollectionName().getDocumentSourceForTable in interface DocumentSourceProviderCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.