public class ShardedDocumentSession extends BaseShardedDocumentSession<IDatabaseCommands> implements IDocumentQueryGenerator, IDocumentSessionImpl, ISyncAdvancedSessionOperation
BaseShardedDocumentSession.DbCmdsListComparer<TDatabaseCommands>, BaseShardedDocumentSession.IdToLoad<TDatabaseCommands>
deferredCommandsByShard, onEvaluateLazy, pendingLazyOperations, shardDbCommands
_databaseName, dbName, deletedEntities, entitiesAndMetadata, entitiesByKey, entityToJson, generateDocumentKeysOnStore, includedDocumentsByKey, knownMissingIds, log, theListeners
Constructor and Description |
---|
ShardedDocumentSession(String dbName,
ShardedDocumentStore documentStore,
DocumentSessionListeners listeners,
UUID id,
ShardStrategy shardStrategy,
Map<String,IDatabaseCommands> shardDbCommands)
Initializes a new instance of the ShardedDocumentSession class.
|
Modifier and Type | Method and Description |
---|---|
protected Lazy<Integer> |
addLazyCountOperation(ILazyOperation operation,
List<IDatabaseCommands> cmds) |
<T> Lazy<T> |
addLazyOperation(ILazyOperation operation,
Action1<T> onEval,
List<IDatabaseCommands> cmds) |
ISyncAdvancedSessionOperation |
advanced()
Get the accessor for advanced operations
Those operations are rarely needed, and have been moved to a separate
property to avoid cluttering the API
|
<T> RavenQueryInspector<T> |
createRavenQueryInspector()
Generates a query inspector
|
<T> IDocumentQuery<T> |
documentQuery(Class<T> clazz)
Dynamically query RavenDB using Lucene syntax
|
<T,TIndexCreator extends AbstractIndexCreationTask> |
documentQuery(Class<T> clazz,
Class<TIndexCreator> indexClazz)
Queries the index specified by
|
<T> IDocumentQuery<T> |
documentQuery(Class<T> clazz,
String indexName)
Query the specified index using Lucene syntax
|
<T> IDocumentQuery<T> |
documentQuery(Class<T> clazz,
String indexName,
boolean isMapReduce)
Create a new query for
|
IEagerSessionOperations |
eagerly()
Access the eager operations
|
ResponseTimeInformation |
executeAllPendingLazyOperations()
Execute all the lazy requests pending within this session
|
protected String |
generateKey(Object entity) |
protected Map<String,SaveChangesData> |
getChangesToSavePerShard(SaveChangesData data) |
String |
getDocumentUrl(Object entity)
Returns full document url for a given entity
|
protected JsonDocument |
getJsonDocument(String documentKey)
Get the json document by key from the store
|
ILoaderWithInclude |
include(Class<?> targetClass,
com.mysema.query.types.Expression<?> path)
Begin a load while include the specified path
|
ILoaderWithInclude |
include(com.mysema.query.types.Expression<?> path)
Begin a load while including the specified path
|
ILoaderWithInclude |
include(String path)
Begin a load while including the specified path
|
ILazySessionOperations |
lazily()
Access the lazy operations
|
<T> Lazy<T[]> |
lazyLoadInternal(Class<T> clazz,
String[] ids,
Tuple<String,Class<?>>[] includes,
Action1<T[]> onEval) |
<T> T[] |
load(Class<T> clazz,
Collection<String> ids)
Loads the specified entities with the specified ids.
|
<T> T[] |
load(Class<T> clazz,
Number... ids)
Loads the specified entities with the specified id after applying
conventions on the provided id to get the real document id.
|
<T> T |
load(Class<T> clazz,
Number id)
Loads the specified entity with the specified id after applying
conventions on the provided id to get the real document id.
|
<T> T[] |
load(Class<T> clazz,
String... ids)
Loads the specified entities with the specified ids.
|
<T> T |
load(Class<T> clazz,
String id)
Loads the specified entity with the specified id.
|
<T> T[] |
load(Class<T> clazz,
UUID... ids)
Loads the specified entities with the specified id after applying
conventions on the provided id to get the real document id.
|
<T> T |
load(Class<T> clazz,
UUID id)
Loads the specified entity with the specified id after applying
conventions on the provided id to get the real document id.
|
<TResult> TResult[] |
load(Class<TResult> clazz,
String transformer,
Collection<String> ids)
Performs a load that will use the specified results transformer against the specified id
|
<TResult> TResult[] |
load(Class<TResult> clazz,
String transformer,
Collection<String> ids,
LoadConfigurationFactory configure)
Performs a load that will use the specified results transformer against the specified id
|
<TResult> TResult |
load(Class<TResult> clazz,
String transformer,
String id)
Performs a load that will use the specified results transformer against the specified id
|
<TResult> TResult |
load(Class<TResult> clazz,
String transformer,
String id,
LoadConfigurationFactory configure)
Performs a load that will use the specified results transformer against the specified id
|
<TResult,TTransformer extends AbstractTransformerCreationTask> |
load(Class<TTransformer> tranformerClass,
Class<TResult> clazz,
List<String> ids,
LoadConfigurationFactory configureFactory)
Performs a load that will use the specified results transformer against the specified id
|
<TResult,TTransformer extends AbstractTransformerCreationTask> |
load(Class<TTransformer> tranformerClass,
Class<TResult> clazz,
String... ids)
Performs a load that will use the specified results transformer against the specified id
|
<TResult,TTransformer extends AbstractTransformerCreationTask> |
load(Class<TTransformer> tranformerClass,
Class<TResult> clazz,
String id)
Performs a load that will use the specified results transformer against the specified id
|
<TResult,TTransformer extends AbstractTransformerCreationTask> |
load(Class<TTransformer> tranformerClass,
Class<TResult> clazz,
String id,
LoadConfigurationFactory configureFactory)
Performs a load that will use the specified results transformer against the specified id
|
<T> T[] |
loadInternal(Class<T> clazz,
String[] ids) |
<T> T[] |
loadInternal(Class<T> clazz,
String[] ids,
String transformer) |
<T> T[] |
loadInternal(Class<T> clazz,
String[] ids,
String transformer,
Map<String,RavenJToken> transformerParameters) |
<T> T[] |
loadInternal(Class<T> clazz,
String[] ids,
Tuple<String,Class<?>>[] includes) |
<T> T[] |
loadInternal(Class<T> clazz,
String[] ids,
Tuple<String,Class<?>>[] includes,
String transformer) |
<T> T[] |
loadInternal(Class<T> clazz,
String[] ids,
Tuple<String,Class<?>>[] includes,
String transformer,
Map<String,RavenJToken> transformerParameters) |
<T> T[] |
loadStartingWith(Class<T> clazz,
String keyPrefix)
Loads multiple entities that contain common prefix.
|
<T> T[] |
loadStartingWith(Class<T> clazz,
String keyPrefix,
String matches)
Loads multiple entities that contain common prefix.
|
<T> T[] |
loadStartingWith(Class<T> clazz,
String keyPrefix,
String matches,
int start)
Loads multiple entities that contain common prefix.
|
<T> T[] |
loadStartingWith(Class<T> clazz,
String keyPrefix,
String matches,
int start,
int pageSize)
Loads multiple entities that contain common prefix.
|
<T> T[] |
loadStartingWith(Class<T> clazz,
String keyPrefix,
String matches,
int start,
int pageSize,
String exclude)
Loads multiple entities that contain common prefix.
|
<T> T[] |
loadStartingWith(Class<T> clazz,
String keyPrefix,
String matches,
int start,
int pageSize,
String exclude,
RavenPagingInformation pagingInformation)
Loads multiple entities that contain common prefix.
|
<T> T[] |
loadStartingWith(Class<T> clazz,
String keyPrefix,
String matches,
int start,
int pageSize,
String exclude,
RavenPagingInformation pagingInformation,
String skipAfter)
Loads multiple entities that contain common prefix.
|
<TResult,TTransformer extends AbstractTransformerCreationTask> |
loadStartingWith(Class<TResult> clazz,
Class<TTransformer> transformerClass,
String keyPrefix)
Loads documents with the specified key prefix and applies the specified results transformer against the results
|
<TResult,TTransformer extends AbstractTransformerCreationTask> |
loadStartingWith(Class<TResult> clazz,
Class<TTransformer> transformerClass,
String keyPrefix,
String matches)
Loads documents with the specified key prefix and applies the specified results transformer against the results
|
<TResult,TTransformer extends AbstractTransformerCreationTask> |
loadStartingWith(Class<TResult> clazz,
Class<TTransformer> transformerClass,
String keyPrefix,
String matches,
int start)
Loads documents with the specified key prefix and applies the specified results transformer against the results
|
<TResult,TTransformer extends AbstractTransformerCreationTask> |
loadStartingWith(Class<TResult> clazz,
Class<TTransformer> transformerClass,
String keyPrefix,
String matches,
int start,
int pageSize)
Loads documents with the specified key prefix and applies the specified results transformer against the results
|
<TResult,TTransformer extends AbstractTransformerCreationTask> |
loadStartingWith(Class<TResult> clazz,
Class<TTransformer> transformerClass,
String keyPrefix,
String matches,
int start,
int pageSize,
String exclude)
Loads documents with the specified key prefix and applies the specified results transformer against the results
|
<TResult,TTransformer extends AbstractTransformerCreationTask> |
loadStartingWith(Class<TResult> clazz,
Class<TTransformer> transformerClass,
String keyPrefix,
String matches,
int start,
int pageSize,
String exclude,
RavenPagingInformation pagingInformation)
Loads documents with the specified key prefix and applies the specified results transformer against the results
|
<TResult,TTransformer extends AbstractTransformerCreationTask> |
loadStartingWith(Class<TResult> clazz,
Class<TTransformer> transformerClass,
String keyPrefix,
String matches,
int start,
int pageSize,
String exclude,
RavenPagingInformation pagingInformation,
LoadConfigurationFactory configure)
Loads documents with the specified key prefix and applies the specified results transformer against the results
|
<TResult,TTransformer extends AbstractTransformerCreationTask> |
loadStartingWith(Class<TResult> clazz,
Class<TTransformer> transformerClass,
String keyPrefix,
String matches,
int start,
int pageSize,
String exclude,
RavenPagingInformation pagingInformation,
LoadConfigurationFactory configure,
String skipAfter)
Loads documents with the specified key prefix and applies the specified results transformer against the results
|
<T> T[] |
moreLikeThis(Class<T> entityClass,
Class<? extends AbstractIndexCreationTask> indexCreator,
Class<? extends AbstractTransformerCreationTask> transformerClass,
MoreLikeThisQuery parameters) |
<T> T[] |
moreLikeThis(Class<T> entityClass,
Class<? extends AbstractIndexCreationTask> indexCreator,
Class<? extends AbstractTransformerCreationTask> transformerClass,
String documentId) |
<T> T[] |
moreLikeThis(Class<T> entityClass,
Class<? extends AbstractIndexCreationTask> indexCreator,
MoreLikeThisQuery parameters) |
<T> T[] |
moreLikeThis(Class<T> entityClass,
Class<? extends AbstractIndexCreationTask> indexCreator,
String documentId) |
<T> T[] |
moreLikeThis(Class<T> entityClass,
String index,
String documentId) |
<T> T[] |
moreLikeThis(Class<T> entityClass,
String index,
String transformer,
MoreLikeThisQuery parameters) |
<T> T[] |
moreLikeThis(Class<T> entityClass,
String index,
String transformer,
String documentId) |
FacetResults[] |
multiFacetedSearch(FacetQuery... queries)
Sends a multiple faceted queries in a single request and calculates the facet results for each of them
|
<T> void |
refresh(T entity)
Updates entity with latest changes from server
|
void |
saveChanges()
Saves all the changes to the Raven server.
|
<T> CloseableIterator<StreamResult<T>> |
stream(Class<T> entityClass)
Stream the results on the query to the client, converting them to
Java types along the way.
|
<T> CloseableIterator<StreamResult<T>> |
stream(Class<T> entityClass,
Etag fromEtag)
Stream the results on the query to the client, converting them to
Java types along the way.
|
<T> CloseableIterator<StreamResult<T>> |
stream(Class<T> entityClass,
Etag fromEtag,
String startsWith)
Stream the results on the query to the client, converting them to
Java types along the way.
|
<T> CloseableIterator<StreamResult<T>> |
stream(Class<T> entityClass,
Etag fromEtag,
String startsWith,
String matches)
Stream the results on the query to the client, converting them to
Java types along the way.
|
<T> CloseableIterator<StreamResult<T>> |
stream(Class<T> entityClass,
Etag fromEtag,
String startsWith,
String matches,
int start)
Stream the results on the query to the client, converting them to
Java types along the way.
|
<T> CloseableIterator<StreamResult<T>> |
stream(Class<T> entityClass,
Etag fromEtag,
String startsWith,
String matches,
int start,
int pageSize)
Stream the results on the query to the client, converting them to
Java types along the way.
|
<T> CloseableIterator<StreamResult<T>> |
stream(Class<T> entityClass,
Etag fromEtag,
String startsWith,
String matches,
int start,
int pageSize,
RavenPagingInformation pagingInformation)
Stream the results on the query to the client, converting them to
Java types along the way.
|
<T> CloseableIterator<StreamResult<T>> |
stream(Class<T> entityClass,
Etag fromEtag,
String startsWith,
String matches,
int start,
int pageSize,
RavenPagingInformation pagingInformation,
String skipAfter)
Stream the results on the query to the client, converting them to
Java types along the way.
|
<T> CloseableIterator<StreamResult<T>> |
stream(IDocumentQuery<T> query)
Stream the results on the query to the client, converting them to
Java types along the way.
|
<T> CloseableIterator<StreamResult<T>> |
stream(IDocumentQuery<T> query,
Reference<QueryHeaderInformation> queryHeaderInformation)
Stream the results on the query to the client, converting them to
Java types along the way.
|
<T> CloseableIterator<StreamResult<T>> |
stream(IRavenQueryable<T> query)
Stream the results on the query to the client, converting them to
Java types along the way.
|
<T> CloseableIterator<StreamResult<T>> |
stream(IRavenQueryable<T> query,
Reference<QueryHeaderInformation> queryHeaderInformation)
Stream the results on the query to the client, converting them to
Java types along the way.
|
createSaveChangesBatchPerShardFromDeferredCommands, defer, getCommandsToOperateOn, getDatabaseName, getDynamicIndexName, getIdsThatNeedLoading, getShardsToOperateOn, getShardStrategy, modifyObjectId, query, query, query, query, query, storeEntityInUnitOfWork
assertNoNonUniqueInstance, checkIfIdAlreadyIncluded, clear, close, convertToEntity, createDynamicIndexName, createPutEntityCommand, delete, delete, delete, delete, ensureNotReadVetoed, entityChanged, entityChanged, evict, explicitlyVersion, getConventions, getDocumentId, getDocumentMetadataValue, getDocumentStore, getEntityToJson, getEtagFor, getExternalState, getGenerateEntityIdOnTheClient, getId, getListeners, getMaxNumberOfRequestsPerSession, getMetadataFor, getNonAuthoritativeInformationTimeout, getNumberOfEntitiesInUnitOfWork, getNumberOfRequests, getStoreIdentifier, handleInternalMetadata, hasChanged, hasChanges, hashCode, ignoreChangesFor, incrementRequestCount, isAllowNonAuthoritativeInformation, isDeleted, isLoaded, isUseOptimisticConcurrency, logBatch, markReadOnly, prepareForSaveChanges, projectionToInstance, refreshInternal, registerMissing, registerMissingIncludes, rememberEntityForDocumentKeyGeneration, setAllowNonAuthoritativeInformation, setDatabaseName, setMaxNumberOfRequestsPerSession, setNonAuthoritativeInformationTimeout, setUseOptimisticConcurrency, store, store, store, store, trackEntity, trackEntity, trackIncludedDocument, unregisterMissing, updateBatchResults, whatChanged
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getConventions
getConventions
delete, delete, delete, delete, query, query, query, query, query, store, store, store, store
close
clear, defer, evict, explicitlyVersion, getDocumentId, getDocumentStore, getEtagFor, getExternalState, getMaxNumberOfRequestsPerSession, getMetadataFor, getNonAuthoritativeInformationTimeout, getNumberOfRequests, getStoreIdentifier, hasChanged, hasChanges, ignoreChangesFor, isAllowNonAuthoritativeInformation, isLoaded, isUseOptimisticConcurrency, markReadOnly, setAllowNonAuthoritativeInformation, setMaxNumberOfRequestsPerSession, setNonAuthoritativeInformationTimeout, setUseOptimisticConcurrency, unregisterMissing, whatChanged
public ShardedDocumentSession(String dbName, ShardedDocumentStore documentStore, DocumentSessionListeners listeners, UUID id, ShardStrategy shardStrategy, Map<String,IDatabaseCommands> shardDbCommands)
protected JsonDocument getJsonDocument(String documentKey)
InMemoryDocumentSessionOperations
getJsonDocument
in class InMemoryDocumentSessionOperations
protected String generateKey(Object entity)
generateKey
in class InMemoryDocumentSessionOperations
public ILazySessionOperations lazily()
lazily
in interface ISyncAdvancedSessionOperation
public IEagerSessionOperations eagerly()
eagerly
in interface ISyncAdvancedSessionOperation
public ISyncAdvancedSessionOperation advanced()
IDocumentSession
advanced
in interface IDocumentSession
public <TResult,TTransformer extends AbstractTransformerCreationTask> TResult load(Class<TTransformer> tranformerClass, Class<TResult> clazz, String id)
IDocumentSession
load
in interface IDocumentSession
tranformerClass
- The transformer to use in this load operationclazz
- The results shape to return after the load operationid
- Identifier of a entity that will be loaded.public <TResult,TTransformer extends AbstractTransformerCreationTask> TResult load(Class<TTransformer> tranformerClass, Class<TResult> clazz, String id, LoadConfigurationFactory configureFactory)
IDocumentSession
load
in interface IDocumentSession
tranformerClass
- The transformer to use in this load operationclazz
- The results shape to return after the load operationid
- Identifier of a entity that will be loaded.configureFactory
- Additional configuration options for operation e.g. AddTransformerParameterpublic <T> T load(Class<T> clazz, String id)
IDocumentSession
load
in interface IDocumentSession
clazz
- Defines type of objectid
- Identifier of a entity that will be loaded.public <T> T[] load(Class<T> clazz, Collection<String> ids)
load
in interface IDocumentSession
clazz
- Defines type of objectids
- Collection of Ids that should be loadedpublic <T> T[] load(Class<T> clazz, String... ids)
IDocumentSession
load
in interface IDocumentSession
clazz
- Defines type of objectids
- Array of Ids that should be loadedpublic <T> T load(Class<T> clazz, Number id)
IDocumentSession
load
in interface IDocumentSession
clazz
- Defines type of objectid
- Identifier of a entity that will be loaded.public <T> T load(Class<T> clazz, UUID id)
IDocumentSession
load
in interface IDocumentSession
clazz
- Defines type of objectid
- Identifier of a entity that will be loaded.public <T> T[] load(Class<T> clazz, Number... ids)
IDocumentSession
load
in interface IDocumentSession
clazz
- Defines type of objectids
- Collection of Ids that should be loadedpublic <T> T[] load(Class<T> clazz, UUID... ids)
IDocumentSession
load
in interface IDocumentSession
clazz
- Defines type of objectids
- Collection of Ids that should be loadedpublic <TResult,TTransformer extends AbstractTransformerCreationTask> TResult[] load(Class<TTransformer> tranformerClass, Class<TResult> clazz, List<String> ids, LoadConfigurationFactory configureFactory)
IDocumentSession
load
in interface IDocumentSession
tranformerClass
- The transformer to use in this load operationclazz
- The results shape to return after the load operationids
- Array of ids of documents to loadconfigureFactory
- Additional configuration options for operation e.g. AddTransformerParameterpublic <TResult> TResult load(Class<TResult> clazz, String transformer, String id)
IDocumentSession
load
in interface IDocumentSession
clazz
- The results shape to return after the load operationtransformer
- The transformer to use in this load operationid
- Identifier of a entity that will be loaded.public <TResult> TResult load(Class<TResult> clazz, String transformer, String id, LoadConfigurationFactory configure)
IDocumentSession
load
in interface IDocumentSession
clazz
- The results shape to return after the load operationtransformer
- The transformer to use in this load operationid
- Identifier of a entity that will be loaded.configure
- Additional configuration options for operation e.g. AddTransformerParameterpublic <TResult> TResult[] load(Class<TResult> clazz, String transformer, Collection<String> ids)
IDocumentSession
load
in interface IDocumentSession
clazz
- The results shape to return after the load operationtransformer
- The transformer to use in this load operationids
- Array of ids of documents to loadpublic <TResult> TResult[] load(Class<TResult> clazz, String transformer, Collection<String> ids, LoadConfigurationFactory configure)
IDocumentSession
load
in interface IDocumentSession
clazz
- The results shape to return after the load operationtransformer
- The transformer to use in this load operationids
- Array of ids of documents to loadconfigure
- Additional configuration options for operation e.g. AddTransformerParameterpublic <T> T[] loadInternal(Class<T> clazz, String[] ids, String transformer)
loadInternal
in interface IDocumentSessionImpl
public <T> T[] loadInternal(Class<T> clazz, String[] ids, String transformer, Map<String,RavenJToken> transformerParameters)
loadInternal
in interface IDocumentSessionImpl
public <T> T[] loadInternal(Class<T> clazz, String[] ids, Tuple<String,Class<?>>[] includes, String transformer)
loadInternal
in interface IDocumentSessionImpl
public <T> T[] loadInternal(Class<T> clazz, String[] ids, Tuple<String,Class<?>>[] includes, String transformer, Map<String,RavenJToken> transformerParameters)
loadInternal
in interface IDocumentSessionImpl
public <T> T[] loadInternal(Class<T> clazz, String[] ids)
loadInternal
in interface IDocumentSessionImpl
public <T> T[] loadInternal(Class<T> clazz, String[] ids, Tuple<String,Class<?>>[] includes)
loadInternal
in interface IDocumentSessionImpl
public ILoaderWithInclude include(String path)
IDocumentSession
include
in interface IDocumentSession
path
- Path in documents in which server should look for a 'referenced' documents.public ILoaderWithInclude include(com.mysema.query.types.Expression<?> path)
IDocumentSession
include
in interface IDocumentSession
path
- Path in documents in which server should look for a 'referenced' documents.public ILoaderWithInclude include(Class<?> targetClass, com.mysema.query.types.Expression<?> path)
IDocumentSession
include
in interface IDocumentSession
targetClass
- Target entity class (used for id generation)path
- Path in documents in which server should look for a 'referenced' documents.public <T> Lazy<T> addLazyOperation(ILazyOperation operation, Action1<T> onEval, List<IDatabaseCommands> cmds)
protected Lazy<Integer> addLazyCountOperation(ILazyOperation operation, List<IDatabaseCommands> cmds)
public <T> Lazy<T[]> lazyLoadInternal(Class<T> clazz, String[] ids, Tuple<String,Class<?>>[] includes, Action1<T[]> onEval)
lazyLoadInternal
in interface IDocumentSessionImpl
public <TResult,TTransformer extends AbstractTransformerCreationTask> TResult[] load(Class<TTransformer> tranformerClass, Class<TResult> clazz, String... ids)
IDocumentSession
load
in interface IDocumentSession
tranformerClass
- The transformer to use in this load operationclazz
- The results shape to return after the load operationids
- Array of ids of documents to loadpublic ResponseTimeInformation executeAllPendingLazyOperations()
IEagerSessionOperations
executeAllPendingLazyOperations
in interface IEagerSessionOperations
public <T> RavenQueryInspector<T> createRavenQueryInspector()
IDocumentQueryGenerator
createRavenQueryInspector
in interface IDocumentQueryGenerator
public <T,TIndexCreator extends AbstractIndexCreationTask> IDocumentQuery<T> documentQuery(Class<T> clazz, Class<TIndexCreator> indexClazz)
ISyncAdvancedSessionOperation
documentQuery
in interface ISyncAdvancedSessionOperation
clazz
- The result class of the query.indexClazz
- The type of the index creator.public <T> IDocumentQuery<T> documentQuery(Class<T> clazz)
ISyncAdvancedSessionOperation
documentQuery
in interface ISyncAdvancedSessionOperation
public <T> IDocumentQuery<T> documentQuery(Class<T> clazz, String indexName)
ISyncAdvancedSessionOperation
documentQuery
in interface ISyncAdvancedSessionOperation
indexName
- Name of the index.public <T> IDocumentQuery<T> documentQuery(Class<T> clazz, String indexName, boolean isMapReduce)
IDocumentQueryGenerator
documentQuery
in interface ISyncAdvancedSessionOperation
documentQuery
in interface IDocumentQueryGenerator
indexName
- Name of the index.isMapReduce
- Control how we treat identifier properties in map/reduce indexespublic void saveChanges()
saveChanges
in interface IDocumentSession
protected Map<String,SaveChangesData> getChangesToSavePerShard(SaveChangesData data)
public <T> void refresh(T entity)
ISyncAdvancedSessionOperation
refresh
in interface ISyncAdvancedSessionOperation
entity
- Instance of an entity that will be refreshedpublic <T> T[] loadStartingWith(Class<T> clazz, String keyPrefix)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objectkeyPrefix
- Prefix for which documents should be returned e.g. "products/"public <T> T[] loadStartingWith(Class<T> clazz, String keyPrefix, String matches)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objectkeyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)public <T> T[] loadStartingWith(Class<T> clazz, String keyPrefix, String matches, int start)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objectkeyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skipped. By default: 0.public <T> T[] loadStartingWith(Class<T> clazz, String keyPrefix, String matches, int start, int pageSize)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objectkeyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skipped. By default: 0.pageSize
- Maximum number of documents that will be retrieved. By default: 25.public <T> T[] loadStartingWith(Class<T> clazz, String keyPrefix, String matches, int start, int pageSize, String exclude)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objectkeyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skipped. By default: 0.pageSize
- Maximum number of documents that will be retrieved. By default: 25.exclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)public <T> T[] loadStartingWith(Class<T> clazz, String keyPrefix, String matches, int start, int pageSize, String exclude, RavenPagingInformation pagingInformation)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objectkeyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skipped. By default: 0.pageSize
- Maximum number of documents that will be retrieved. By default: 25.exclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)pagingInformation
- Used to perform rapid pagination on a server sidepublic <T> T[] loadStartingWith(Class<T> clazz, String keyPrefix, String matches, int start, int pageSize, String exclude, RavenPagingInformation pagingInformation, String skipAfter)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objectkeyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skipped. By default: 0.pageSize
- Maximum number of documents that will be retrieved. By default: 25.exclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)pagingInformation
- Used to perform rapid pagination on a server sideskipAfter
- skip document fetching until given key is found and return documents after that key (default: null)public <TResult,TTransformer extends AbstractTransformerCreationTask> TResult[] loadStartingWith(Class<TResult> clazz, Class<TTransformer> transformerClass, String keyPrefix)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objecttransformerClass
- The transformer to use in this load operationkeyPrefix
- Prefix for which documents should be returned e.g. "products/"public <TResult,TTransformer extends AbstractTransformerCreationTask> TResult[] loadStartingWith(Class<TResult> clazz, Class<TTransformer> transformerClass, String keyPrefix, String matches)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objecttransformerClass
- The transformer to use in this load operationkeyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)public <TResult,TTransformer extends AbstractTransformerCreationTask> TResult[] loadStartingWith(Class<TResult> clazz, Class<TTransformer> transformerClass, String keyPrefix, String matches, int start)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objecttransformerClass
- The transformer to use in this load operationkeyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skipped. By default: 0.public <TResult,TTransformer extends AbstractTransformerCreationTask> TResult[] loadStartingWith(Class<TResult> clazz, Class<TTransformer> transformerClass, String keyPrefix, String matches, int start, int pageSize)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objecttransformerClass
- The transformer to use in this load operationkeyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skipped. By default: 0.pageSize
- Maximum number of documents that will be retrieved. By default: 25.public <TResult,TTransformer extends AbstractTransformerCreationTask> TResult[] loadStartingWith(Class<TResult> clazz, Class<TTransformer> transformerClass, String keyPrefix, String matches, int start, int pageSize, String exclude)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objecttransformerClass
- The transformer to use in this load operationkeyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skipped. By default: 0.pageSize
- Maximum number of documents that will be retrieved. By default: 25.exclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)public <TResult,TTransformer extends AbstractTransformerCreationTask> TResult[] loadStartingWith(Class<TResult> clazz, Class<TTransformer> transformerClass, String keyPrefix, String matches, int start, int pageSize, String exclude, RavenPagingInformation pagingInformation)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objecttransformerClass
- The transformer to use in this load operationkeyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skipped. By default: 0.pageSize
- Maximum number of documents that will be retrieved. By default: 25.exclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)pagingInformation
- Used to perform rapid pagination on a server sidepublic <TResult,TTransformer extends AbstractTransformerCreationTask> TResult[] loadStartingWith(Class<TResult> clazz, Class<TTransformer> transformerClass, String keyPrefix, String matches, int start, int pageSize, String exclude, RavenPagingInformation pagingInformation, LoadConfigurationFactory configure)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objecttransformerClass
- The transformer to use in this load operationkeyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skipped. By default: 0.pageSize
- Maximum number of documents that will be retrieved. By default: 25.exclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)pagingInformation
- Used to perform rapid pagination on a server sideconfigure
- Additional configuration options for operation e.g. AddTransformerParameterpublic <TResult,TTransformer extends AbstractTransformerCreationTask> TResult[] loadStartingWith(Class<TResult> clazz, Class<TTransformer> transformerClass, String keyPrefix, String matches, int start, int pageSize, String exclude, RavenPagingInformation pagingInformation, LoadConfigurationFactory configure, String skipAfter)
ISyncAdvancedSessionOperation
loadStartingWith
in interface ISyncAdvancedSessionOperation
clazz
- Defines type of objecttransformerClass
- The transformer to use in this load operationkeyPrefix
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skipped. By default: 0.pageSize
- Maximum number of documents that will be retrieved. By default: 25.exclude
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should not be matched ('?' any single character, '*' any characters)pagingInformation
- Used to perform rapid pagination on a server sideconfigure
- Additional configuration options for operation e.g. AddTransformerParameterskipAfter
- Skip document fetching until given key is found and return documents after that key (default: null)public String getDocumentUrl(Object entity)
ISyncAdvancedSessionOperation
getDocumentUrl
in interface ISyncAdvancedSessionOperation
entity
- Instance of an entity for which url will be returnedpublic <T> CloseableIterator<StreamResult<T>> stream(IRavenQueryable<T> query)
ISyncAdvancedSessionOperation
stream
in interface ISyncAdvancedSessionOperation
query
- Query to stream results forpublic <T> CloseableIterator<StreamResult<T>> stream(IRavenQueryable<T> query, Reference<QueryHeaderInformation> queryHeaderInformation)
ISyncAdvancedSessionOperation
stream
in interface ISyncAdvancedSessionOperation
query
- Query to stream results forqueryHeaderInformation
- Information about performed querypublic <T> CloseableIterator<StreamResult<T>> stream(IDocumentQuery<T> query)
ISyncAdvancedSessionOperation
stream
in interface ISyncAdvancedSessionOperation
query
- Query to stream results forpublic <T> CloseableIterator<StreamResult<T>> stream(IDocumentQuery<T> query, Reference<QueryHeaderInformation> queryHeaderInformation)
ISyncAdvancedSessionOperation
stream
in interface ISyncAdvancedSessionOperation
query
- Query to stream results forqueryHeaderInformation
- Information about performed querypublic <T> CloseableIterator<StreamResult<T>> stream(Class<T> entityClass)
ISyncAdvancedSessionOperation
stream
in interface ISyncAdvancedSessionOperation
public <T> CloseableIterator<StreamResult<T>> stream(Class<T> entityClass, Etag fromEtag)
ISyncAdvancedSessionOperation
stream
in interface ISyncAdvancedSessionOperation
fromEtag
- ETag of a document from which stream should startpublic <T> CloseableIterator<StreamResult<T>> stream(Class<T> entityClass, Etag fromEtag, String startsWith)
ISyncAdvancedSessionOperation
stream
in interface ISyncAdvancedSessionOperation
fromEtag
- ETag of a document from which stream should startstartsWith
- Prefix for which documents should be returned e.g. "products/"public <T> CloseableIterator<StreamResult<T>> stream(Class<T> entityClass, Etag fromEtag, String startsWith, String matches)
ISyncAdvancedSessionOperation
stream
in interface ISyncAdvancedSessionOperation
fromEtag
- ETag of a document from which stream should startstartsWith
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)public <T> CloseableIterator<StreamResult<T>> stream(Class<T> entityClass, Etag fromEtag, String startsWith, String matches, int start)
ISyncAdvancedSessionOperation
stream
in interface ISyncAdvancedSessionOperation
fromEtag
- ETag of a document from which stream should startstartsWith
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpublic <T> CloseableIterator<StreamResult<T>> stream(Class<T> entityClass, Etag fromEtag, String startsWith, String matches, int start, int pageSize)
ISyncAdvancedSessionOperation
stream
in interface ISyncAdvancedSessionOperation
fromEtag
- ETag of a document from which stream should startstartsWith
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedpublic <T> CloseableIterator<StreamResult<T>> stream(Class<T> entityClass, Etag fromEtag, String startsWith, String matches, int start, int pageSize, RavenPagingInformation pagingInformation)
ISyncAdvancedSessionOperation
stream
in interface ISyncAdvancedSessionOperation
fromEtag
- ETag of a document from which stream should startstartsWith
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedpagingInformation
- Used to perform rapid pagination on a server sidepublic <T> CloseableIterator<StreamResult<T>> stream(Class<T> entityClass, Etag fromEtag, String startsWith, String matches, int start, int pageSize, RavenPagingInformation pagingInformation, String skipAfter)
ISyncAdvancedSessionOperation
stream
in interface ISyncAdvancedSessionOperation
fromEtag
- ETag of a document from which stream should startstartsWith
- Prefix for which documents should be returned e.g. "products/"matches
- Pipe ('|') separated values for which document keys (after 'keyPrefix') should be matched ('?' any single character, '*' any characters)start
- Number of documents that should be skippedpageSize
- Maximum number of documents that will be retrievedpagingInformation
- Used to perform rapid pagination on a server sideskipAfter
- Skip document fetching until given key is found and return documents after that key (default: null)public FacetResults[] multiFacetedSearch(FacetQuery... queries)
ISyncAdvancedSessionOperation
multiFacetedSearch
in interface ISyncAdvancedSessionOperation
queries
- Array of the faceted queries that will be executed on the server-sidepublic <T> T[] moreLikeThis(Class<T> entityClass, Class<? extends AbstractIndexCreationTask> indexCreator, String documentId)
moreLikeThis
in interface ISyncAdvancedSessionOperation
public <T> T[] moreLikeThis(Class<T> entityClass, Class<? extends AbstractIndexCreationTask> indexCreator, MoreLikeThisQuery parameters)
moreLikeThis
in interface ISyncAdvancedSessionOperation
public <T> T[] moreLikeThis(Class<T> entityClass, String index, String documentId)
moreLikeThis
in interface ISyncAdvancedSessionOperation
public <T> T[] moreLikeThis(Class<T> entityClass, Class<? extends AbstractIndexCreationTask> indexCreator, Class<? extends AbstractTransformerCreationTask> transformerClass, String documentId)
moreLikeThis
in interface ISyncAdvancedSessionOperation
public <T> T[] moreLikeThis(Class<T> entityClass, Class<? extends AbstractIndexCreationTask> indexCreator, Class<? extends AbstractTransformerCreationTask> transformerClass, MoreLikeThisQuery parameters)
moreLikeThis
in interface ISyncAdvancedSessionOperation
public <T> T[] moreLikeThis(Class<T> entityClass, String index, String transformer, String documentId)
moreLikeThis
in interface ISyncAdvancedSessionOperation
public <T> T[] moreLikeThis(Class<T> entityClass, String index, String transformer, MoreLikeThisQuery parameters)
moreLikeThis
in interface ISyncAdvancedSessionOperation
Copyright © 2016. All Rights Reserved.