Package io.inversion.cosmosdb
Class CosmosDb
java.lang.Object
io.inversion.Db<CosmosDb>
io.inversion.cosmosdb.CosmosDb
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected com.microsoft.azure.documentdb.DocumentClientstatic Stringprotected Stringprotected StringFields inherited from class io.inversion.Db
bootstrap, collections, dryRun, endpointPath, excludeColumns, includeColumns, includeTables, log, name, reservedParams, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.microsoft.azure.documentdb.DocumentClientbuildDocumentClient(String uri, String key)voidprotected voidDeletes a single specific resource.io.inversion.ResultsFinds the resource keys on the other side of the relationshipprotected StringgetCollectionUri(io.inversion.Collection table)getDb()com.microsoft.azure.documentdb.DocumentClientgetKey()getUri()booleanwithAllowCrossPartitionQueries(boolean allowCrossPartitionQueries)withDocumentClient(com.microsoft.azure.documentdb.DocumentClient documentClient)Methods inherited from class io.inversion.Db
beautifyCollectionName, beautifyName, buildCollections, buildRelationships, castDbOutput, castJsonInput, castJsonInput, configApi, configDb, doPatch, doShutdown, doShutdown, doStartup, filterOutJsonProperty, getCollectionByTableName, getCollections, getEndpointPath, getHref, getKey, getName, getProperty, getType, isBootstrap, isDryRun, isRunning, isType, makeRelationshipName, mapTo, mapToColumnNames, mapToJsonNames, patch, removeCollection, select, shutdown, shutdown, startup, upsert, withBootstrap, withCollection, withCollections, withDryRun, withEndpointPath, withExcludeColumns, withIncludeColumns, withIncludeTable, withIncludeTables, withName, withType
-
Field Details
-
INDEX_TYPE_PARTITION_KEY
- See Also:
- Constant Field Values
-
uri
-
db
-
key
-
documentClient
protected transient com.microsoft.azure.documentdb.DocumentClient documentClient
-
-
Constructor Details
-
CosmosDb
public CosmosDb() -
CosmosDb
-
-
Method Details
-
buildDocumentClient
-
doSelect
public io.inversion.Results doSelect(io.inversion.Collection collection, List<io.inversion.rql.Term> columnMappedTerms) throws io.inversion.ApiExceptionFinds the resource keys on the other side of the relationship- Specified by:
doSelectin classio.inversion.Db<CosmosDb>- Parameters:
collection- the collection to querycolumnMappedTerms- the query terms- Returns:
- Map key=sourceResourceKey, value=relatedResourceKey
- Throws:
io.inversion.ApiException- if selection fails for any reason
-
doUpsert
public List<String> doUpsert(io.inversion.Collection table, List<Map<String,Object>> rows) throws io.inversion.ApiException- Specified by:
doUpsertin classio.inversion.Db<CosmosDb>- Throws:
io.inversion.ApiException
-
upsertRow
public String upsertRow(io.inversion.Collection collection, Map<String,Object> row) throws io.inversion.ApiException- Throws:
io.inversion.ApiException
-
delete
public void delete(io.inversion.Collection table, List<Map<String,Object>> indexValues) throws io.inversion.ApiException- Specified by:
deletein classio.inversion.Db<CosmosDb>- Throws:
io.inversion.ApiException
-
deleteRow
protected void deleteRow(io.inversion.Collection collection, Map<String,Object> indexValues) throws io.inversion.ApiExceptionDeletes a single specific resource.Rest url format for Cosmos deletions - https://{databaseaccount}.documents.azure.com/dbs/{db}/colls/{coll}/docs/{doc}
- Parameters:
collection- the collection to deleteindexValues- identifiers for the documents to delete- Throws:
io.inversion.ApiException- See Also:
- CosmosDb Resource URI Syntax
-
getCollectionUri
-
getUri
-
withUri
-
getDb
-
withDb
-
getKey
-
withKey
-
isAllowCrossPartitionQueries
public boolean isAllowCrossPartitionQueries() -
withAllowCrossPartitionQueries
-
withDocumentClient
-
getDocumentClient
public com.microsoft.azure.documentdb.DocumentClient getDocumentClient()
-