public interface IDocumentSession extends CleanCloseable
Modifier and Type | Method and Description |
---|---|
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> void |
delete(Class<T> clazz,
Number id)
Marks the specified entity for deletion.
|
<T> void |
delete(Class<T> clazz,
UUID id)
Marks the specified entity for deletion.
|
void |
delete(String id)
Marks the specified entity for deletion.
|
<T> void |
delete(T entity)
Marks the specified entity for deletion.
|
ILoaderWithInclude |
include(Class<?> targetEntityClass,
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
|
<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> transformerClass,
Class<TResult> clazz,
List<String> ids,
LoadConfigurationFactory configure)
Performs a load that will use the specified results transformer against the specified id
|
<TResult,TTransformer extends AbstractTransformerCreationTask> |
load(Class<TTransformer> transformerClass,
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> transformerClass,
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> transformerClass,
Class<TResult> clazz,
String id,
LoadConfigurationFactory configure)
Performs a load that will use the specified results transformer against the specified id
|
<T> IRavenQueryable<T> |
query(Class<T> clazz)
Dynamically queries RavenDB.
|
<T> IRavenQueryable<T> |
query(Class<T> clazz,
Class<? extends AbstractIndexCreationTask> indexCreator)
Queries the index specified by indexCreator.
|
<T> IRavenQueryable<T> |
query(Class<T> clazz,
Class<? extends AbstractIndexCreationTask> indexCreator,
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.
|
void |
saveChanges()
Saves all the changes to the Raven server.
|
void |
store(Object entity)
Stores entity in session, extracts Id from entity using Conventions or generates new one if it is not available.
|
void |
store(Object entity,
Etag etag)
Stores entity in session, extracts Id from entity using Conventions or generates new one if it is not available and
forces concurrency check with given Etag
|
void |
store(Object entity,
Etag etag,
String id)
Stores the specified entity with the specified etag, under the specified id
|
void |
store(Object entity,
String id)
Stores the specified dynamic entity, under the specified id.
|
close
ISyncAdvancedSessionOperation advanced()
<T> void delete(T entity)
entity
- <T> void delete(Class<T> clazz, Number id)
id
- Entity Id<T> void delete(Class<T> clazz, UUID id)
id
- Entity Idvoid delete(String id)
id
- Entity Id<T> T load(Class<T> clazz, String id)
clazz
- Defines type of objectid
- Identifier of a entity that will be loaded.<T> T[] load(Class<T> clazz, String... ids)
clazz
- Defines type of objectids
- Array of Ids that should be loaded<T> T[] load(Class<T> clazz, Collection<String> ids)
clazz
- Defines type of objectids
- Collection of Ids that should be loaded<T> T load(Class<T> clazz, Number id)
clazz
- Defines type of objectid
- Identifier of a entity that will be loaded.<T> T load(Class<T> clazz, UUID id)
clazz
- Defines type of objectid
- Identifier of a entity that will be loaded.<T> T[] load(Class<T> clazz, Number... ids)
clazz
- Defines type of objectids
- Collection of Ids that should be loaded<T> T[] load(Class<T> clazz, UUID... ids)
clazz
- Defines type of objectids
- Collection of Ids that should be loaded<T> IRavenQueryable<T> query(Class<T> clazz, String indexName)
clazz
- Defines type of objectindexName
- Name of the index.<T> IRavenQueryable<T> query(Class<T> clazz, String indexName, boolean isMapReduce)
clazz
- Defines type of objectindexName
- Name of the index.isMapReduce
- Whatever we are querying a map/reduce index (modify how we treat identifier properties)<T> IRavenQueryable<T> query(Class<T> clazz)
clazz
- Defines type of object<T> IRavenQueryable<T> query(Class<T> clazz, Class<? extends AbstractIndexCreationTask> indexCreator)
clazz
- Defines type of objectindexCreator
- <T> IRavenQueryable<T> query(Class<T> clazz, Class<? extends AbstractIndexCreationTask> indexCreator, ShardReduceFunction reduceFunction)
clazz
- indexCreator
- reduceFunction
- ILoaderWithInclude include(String path)
path
- Path in documents in which server should look for a 'referenced' documents.ILoaderWithInclude include(com.mysema.query.types.Expression<?> path)
path
- Path in documents in which server should look for a 'referenced' documents.ILoaderWithInclude include(Class<?> targetEntityClass, com.mysema.query.types.Expression<?> path)
targetEntityClass
- Target entity class (used for id generation)path
- Path in documents in which server should look for a 'referenced' documents.<TResult,TTransformer extends AbstractTransformerCreationTask> TResult load(Class<TTransformer> transformerClass, Class<TResult> clazz, String id)
transformerClass
- 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.<TResult,TTransformer extends AbstractTransformerCreationTask> TResult load(Class<TTransformer> transformerClass, Class<TResult> clazz, String id, LoadConfigurationFactory configure)
transformerClass
- 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.configure
- Additional configuration options for operation e.g. AddTransformerParameter<TResult,TTransformer extends AbstractTransformerCreationTask> TResult[] load(Class<TTransformer> transformerClass, Class<TResult> clazz, String... ids)
transformerClass
- The transformer to use in this load operationclazz
- The results shape to return after the load operationids
- Array of ids of documents to load<TResult,TTransformer extends AbstractTransformerCreationTask> TResult[] load(Class<TTransformer> transformerClass, Class<TResult> clazz, List<String> ids, LoadConfigurationFactory configure)
transformerClass
- The transformer to use in this load operationclazz
- The results shape to return after the load operationids
- Array of ids of documents to loadconfigure
- Additional configuration options for operation e.g. AddTransformerParameter<TResult> TResult load(Class<TResult> clazz, String transformer, String id)
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.<TResult> TResult load(Class<TResult> clazz, String transformer, String id, LoadConfigurationFactory configure)
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. AddTransformerParameter<TResult> TResult[] load(Class<TResult> clazz, String transformer, Collection<String> ids)
clazz
- The results shape to return after the load operationtransformer
- The transformer to use in this load operationids
- Array of ids of documents to load<TResult> TResult[] load(Class<TResult> clazz, String transformer, Collection<String> ids, LoadConfigurationFactory configure)
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. AddTransformerParametervoid saveChanges()
void store(Object entity)
entity
- Entity to store.void store(Object entity, String id)
entity
- Entity to store.id
- Id to store this entity under. If other entity exists with the same id it will be overwritten.void store(Object entity, Etag etag)
entity
- Entity to store.etag
- Copyright © 2016. All Rights Reserved.