public class DocumentSession extends InMemoryDocumentSessionOperations implements IDocumentSessionImpl, ISyncAdvancedSessionOperation, IDocumentQueryGenerator, ITransactionalDocumentSession
Modifier and Type | Class and Description |
---|---|
protected class |
DocumentSession.DisableAllCachingCallback |
_databaseName, dbName, deletedEntities, entitiesAndMetadata, entitiesByKey, entityToJson, generateDocumentKeysOnStore, includedDocumentsByKey, knownMissingIds, log, onEvaluateLazy, pendingLazyOperations, theListeners
Constructor and Description |
---|
DocumentSession(String dbName,
DocumentStore documentStore,
DocumentSessionListeners listeners,
UUID id,
IDatabaseCommands databaseCommands)
Initializes a new instance of the
DocumentSession class. |
Modifier and Type | Method and Description |
---|---|
Lazy<Integer> |
addLazyCountOperation(ILazyOperation operation) |
<T> Lazy<T> |
addLazyOperation(ILazyOperation operation,
Action1<T> onEval) |
ISyncAdvancedSessionOperation |
advanced()
Get the accessor for advanced operations
Note: Those operations are rarely needed, and have been moved to a separate
property to avoid cluttering the API
|
<S> RavenQueryInspector<S> |
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)
Query the specified index using Lucene syntax
|
IEagerSessionOperations |
eagerly()
Access the eager operations
|
ResponseTimeInformation |
executeAllPendingLazyOperations()
Execute all the lazy requests pending within this session
|
protected String |
generateKey(Object entity) |
IDatabaseCommands |
getDatabaseCommands()
Gets the database commands.
|
String |
getDocumentUrl(Object entity)
Gets the document URL for the specified 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 including 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)
Register to lazily load documents and include
|
<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... facetQueries)
Sends a multiple faceted queries in a single request and calculates the facet results for each of them
|
<T> IRavenQueryable<T> |
query(Class<T> clazz)
Query RavenDB dynamically using
|
<T> IRavenQueryable<T> |
query(Class<T> clazz,
Class<? extends AbstractIndexCreationTask> tIndexCreator)
Queries the index specified by tIndexCreator using Linq.
|
<T> IRavenQueryable<T> |
query(Class<T> clazz,
Class<? extends AbstractIndexCreationTask> tIndexCreator,
ShardReduceFunction reduceFunction)
Queries the index specified by indexCreator.
|
<T> IRavenQueryable<T> |
query(Class<T> clazz,
String indexName)
Queries the specified index.
|
<T> IRavenQueryable<T> |
query(Class<T> clazz,
String indexName,
boolean isMapReduce)
Queries the specified index.
|
<T> void |
refresh(T entity)
Refreshes the specified entity from Raven 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> queryHeaderInformationRef)
Stream the results on the query to the client, converting them to
Java types along the way.
|
assertNoNonUniqueInstance, checkIfIdAlreadyIncluded, clear, close, convertToEntity, createDynamicIndexName, createPutEntityCommand, defer, delete, delete, delete, delete, ensureNotReadVetoed, entityChanged, entityChanged, evict, explicitlyVersion, getConventions, getDatabaseName, 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, storeEntityInUnitOfWork, trackEntity, trackEntity, trackIncludedDocument, unregisterMissing, updateBatchResults, whatChanged
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getConventions
delete, delete, delete, delete, 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
getConventions
getDatabaseName
public DocumentSession(String dbName, DocumentStore documentStore, DocumentSessionListeners listeners, UUID id, IDatabaseCommands databaseCommands)
DocumentSession
class.dbName
- documentStore
- listeners
- id
- databaseCommands
- public IDatabaseCommands getDatabaseCommands()
public ILazySessionOperations lazily()
lazily
in interface ISyncAdvancedSessionOperation
public IEagerSessionOperations eagerly()
eagerly
in interface ISyncAdvancedSessionOperation
public ISyncAdvancedSessionOperation advanced()
advanced
in interface IDocumentSession
public <T> T load(Class<T> clazz, String id)
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 <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, Tuple<String,Class<?>>[] includes)
loadInternal
in interface IDocumentSessionImpl
public <T> T[] loadInternal(Class<T> clazz, String[] ids)
loadInternal
in interface IDocumentSessionImpl
public <T> IRavenQueryable<T> query(Class<T> clazz, String indexName)
query
in interface IDocumentSession
clazz
- indexName
- public <T> IRavenQueryable<T> query(Class<T> clazz, String indexName, boolean isMapReduce)
query
in interface IDocumentSession
clazz
- The result of the queryindexName
- Name of the index.isMapReduce
- Whatever we are querying a map/reduce index (modify how we treat identifier properties)public <T> IRavenQueryable<T> query(Class<T> clazz, Class<? extends AbstractIndexCreationTask> tIndexCreator)
query
in interface IDocumentSession
clazz
- The result of the querytIndexCreator
- The type of the index creatorpublic <T> IRavenQueryable<T> query(Class<T> clazz, Class<? extends AbstractIndexCreationTask> tIndexCreator, ShardReduceFunction reduceFunction)
IDocumentSession
query
in interface IDocumentSession
public <T> void refresh(T entity)
refresh
in interface ISyncAdvancedSessionOperation
entity
- Instance of an entity that will be refreshedprotected JsonDocument getJsonDocument(String documentKey)
getJsonDocument
in class InMemoryDocumentSessionOperations
protected String generateKey(Object entity)
generateKey
in class InMemoryDocumentSessionOperations
public ILoaderWithInclude include(String path)
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)
include
in interface IDocumentSession
path
- public ILoaderWithInclude include(Class<?> targetClass, com.mysema.query.types.Expression<?> path)
include
in interface IDocumentSession
path
- targetClass
- Target entity class (used for id generation)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 <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 <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 String getDocumentUrl(Object entity)
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> queryHeaderInformationRef)
ISyncAdvancedSessionOperation
stream
in interface ISyncAdvancedSessionOperation
query
- Query to stream results forqueryHeaderInformationRef
- 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... facetQueries)
ISyncAdvancedSessionOperation
multiFacetedSearch
in interface ISyncAdvancedSessionOperation
facetQueries
- Array of the faceted queries that will be executed on the server-sidepublic void saveChanges()
saveChanges
in interface IDocumentSession
public <T,TIndexCreator extends AbstractIndexCreationTask> IDocumentQuery<T> documentQuery(Class<T> clazz, Class<TIndexCreator> indexClazz)
documentQuery
in interface ISyncAdvancedSessionOperation
clazz
- The result of the queryindexClazz
- The type of the index creator.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)
documentQuery
in interface ISyncAdvancedSessionOperation
documentQuery
in interface IDocumentQueryGenerator
clazz
- indexName
- Name of the index.isMapReduce
- public <T> IRavenQueryable<T> query(Class<T> clazz)
query
in interface IDocumentSession
clazz
- public <T> IDocumentQuery<T> documentQuery(Class<T> clazz)
documentQuery
in interface ISyncAdvancedSessionOperation
public <S> RavenQueryInspector<S> createRavenQueryInspector()
IDocumentQueryGenerator
createRavenQueryInspector
in interface IDocumentQueryGenerator
public <T> Lazy<T> addLazyOperation(ILazyOperation operation, Action1<T> onEval)
public Lazy<Integer> addLazyCountOperation(ILazyOperation operation)
public <T> Lazy<T[]> lazyLoadInternal(Class<T> clazz, String[] ids, Tuple<String,Class<?>>[] includes, Action1<T[]> onEval)
lazyLoadInternal
in interface IDocumentSessionImpl
public ResponseTimeInformation executeAllPendingLazyOperations()
IEagerSessionOperations
executeAllPendingLazyOperations
in interface IEagerSessionOperations
public <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 <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.