Search in sources :

Example 1 with MappingDocumentDbConverter

use of com.microsoft.azure.spring.data.documentdb.core.convert.MappingDocumentDbConverter in project cas by apereo.

the class CosmosDbObjectFactory method createDocumentDbTemplate.

/**
 * Document db template.
 *
 * @param properties the properties
 * @return the document db template
 */
public DocumentDbTemplate createDocumentDbTemplate(final BaseCosmosDbProperties properties) {
    final DocumentDbFactory documentDbFactory = createDocumentDbFactory(properties);
    final DocumentDbMappingContext documentDbMappingContext = createDocumentDbMappingContext();
    final MappingDocumentDbConverter mappingDocumentDbConverter = createMappingDocumentDbConverter(documentDbMappingContext);
    return new DocumentDbTemplate(documentDbFactory, mappingDocumentDbConverter, properties.getDatabase());
}
Also used : MappingDocumentDbConverter(com.microsoft.azure.spring.data.documentdb.core.convert.MappingDocumentDbConverter) DocumentDbFactory(com.microsoft.azure.spring.data.documentdb.DocumentDbFactory) DocumentDbTemplate(com.microsoft.azure.spring.data.documentdb.core.DocumentDbTemplate) DocumentDbMappingContext(com.microsoft.azure.spring.data.documentdb.core.mapping.DocumentDbMappingContext)

Example 2 with MappingDocumentDbConverter

use of com.microsoft.azure.spring.data.documentdb.core.convert.MappingDocumentDbConverter in project cas by apereo.

the class CosmosDbObjectFactory method createDocumentDbTemplate.

/**
 * Create document db template document db template.
 *
 * @param documentDbFactory the document db factory
 * @param properties        the properties
 * @return the document db template
 */
public DocumentDbTemplate createDocumentDbTemplate(final DocumentDbFactory documentDbFactory, final BaseCosmosDbProperties properties) {
    final DocumentDbMappingContext documentDbMappingContext = createDocumentDbMappingContext();
    final MappingDocumentDbConverter mappingDocumentDbConverter = createMappingDocumentDbConverter(documentDbMappingContext);
    return new DocumentDbTemplate(documentDbFactory, mappingDocumentDbConverter, properties.getDatabase());
}
Also used : MappingDocumentDbConverter(com.microsoft.azure.spring.data.documentdb.core.convert.MappingDocumentDbConverter) DocumentDbTemplate(com.microsoft.azure.spring.data.documentdb.core.DocumentDbTemplate) DocumentDbMappingContext(com.microsoft.azure.spring.data.documentdb.core.mapping.DocumentDbMappingContext)

Aggregations

DocumentDbTemplate (com.microsoft.azure.spring.data.documentdb.core.DocumentDbTemplate)2 MappingDocumentDbConverter (com.microsoft.azure.spring.data.documentdb.core.convert.MappingDocumentDbConverter)2 DocumentDbMappingContext (com.microsoft.azure.spring.data.documentdb.core.mapping.DocumentDbMappingContext)2 DocumentDbFactory (com.microsoft.azure.spring.data.documentdb.DocumentDbFactory)1