Package dev.morphia
Interface AdvancedDatastore
-
- All Superinterfaces:
Datastore
- All Known Subinterfaces:
MorphiaSession
@Deprecated(since="2.0", forRemoval=true) public interface AdvancedDatastore extends Datastore
Deprecated, for removal: This API element is subject to removal in a future version.This interface exposes advancedDatastore
features, like interacting with Document and low-level options. It implements matching methods from theDatastore
interface but with a specified kind (collection name), or raw types (Document).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description AggregationPipeline
createAggregation(String collection, Class<?> clazz)
Deprecated, for removal: This API element is subject to removal in a future version.useDatastore.aggregate(Class)
and pass the alternate collection via the options onAggregation.execute(Class, AggregationOptions)
<T> Query<T>
createQuery(Class<T> type, Document q)
Deprecated, for removal: This API element is subject to removal in a future version.default <T,V>
DBRefcreateRef(Class<T> clazz, V id)
Deprecated, for removal: This API element is subject to removal in a future version.default <T> DBRef
createRef(T entity)
Deprecated, for removal: This API element is subject to removal in a future version.default <T> UpdateOperations<T>
createUpdateOperations(Class<T> type, DBObject ops)
Deprecated, for removal: This API element is subject to removal in a future version.useQuery.update(UpdateOperator, UpdateOperator...)
insteaddefault <T> void
insert(List<T> entities, InsertOptions options)
Deprecated, for removal: This API element is subject to removal in a future version.useDatastore.insert(List, InsertManyOptions)
insteaddefault <T> void
insert(T entity, InsertOptions options)
Deprecated, for removal: This API element is subject to removal in a future version.useDatastore.insert(Object, InsertOneOptions)
instead<T> Query<T>
queryByExample(String collection, T example)
Deprecated, for removal: This API element is subject to removal in a future version.-
Methods inherited from interface dev.morphia.Datastore
aggregate, aggregate, createAggregation, createQuery, createUpdateOperations, delete, delete, delete, delete, enableDocumentValidation, ensureCaps, ensureIndexes, find, find, find, find, findAndDelete, findAndDelete, findAndModify, findAndModify, getCodecRegistry, getCollection, getDatabase, getLoggedQuery, getMapper, insert, insert, insert, insert, merge, merge, merge, queryByExample, refresh, replace, replace, replace, replace, save, save, save, save, save, save, save, shardCollections, startSession, startSession, update, update, withTransaction, withTransaction
-
-
-
-
Method Detail
-
createAggregation
@Deprecated(since="2.0", forRemoval=true) AggregationPipeline createAggregation(String collection, Class<?> clazz)
Deprecated, for removal: This API element is subject to removal in a future version.useDatastore.aggregate(Class)
and pass the alternate collection via the options onAggregation.execute(Class, AggregationOptions)
Returns anAggregationPipeline
bound to the given collection and class.- Parameters:
collection
- the collection to queryclazz
- The class to create aggregation against- Returns:
- the aggregation pipeline
- See Also:
Aggregation
,AggregationOptions
-
createQuery
@Deprecated(since="2.0", forRemoval=true) <T> Query<T> createQuery(Class<T> type, Document q)
Deprecated, for removal: This API element is subject to removal in a future version.- Type Parameters:
T
- The type of the entity- Parameters:
type
- the class of objects to be returnedq
- the query which will be passed to aQueryFactory
- Returns:
- Query for the specified class type
-
createRef
@Deprecated(since="2.0", forRemoval=true) default <T,V> DBRef createRef(Class<T> clazz, V id)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a reference to the entity (using the current DB -can be null-, the collectionName, and id)- Type Parameters:
T
- The type of the entityV
- The type of the ID value- Parameters:
clazz
- The type of the entityid
- The ID value of the entity- Returns:
- the DBRef for the entity
-
createRef
@Deprecated(since="2.0", forRemoval=true) default <T> DBRef createRef(T entity)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a reference to the entity (using the current DB -can be null-, the collectionName, and id)- Type Parameters:
T
- The type of the entity- Parameters:
entity
- the entity to create a DBRef for- Returns:
- the DBRef for the entity
-
createUpdateOperations
@Deprecated(since="2.0", forRemoval=true) default <T> UpdateOperations<T> createUpdateOperations(Class<T> type, DBObject ops)
Deprecated, for removal: This API element is subject to removal in a future version.useQuery.update(UpdateOperator, UpdateOperator...)
insteadCreates an UpdateOperations instance for the given type.- Type Parameters:
T
- The type of the entity- Parameters:
type
- The type of the entityops
- The operations to perform- Returns:
- the UpdateOperations instance
-
insert
@Deprecated(since="2.0", forRemoval=true) default <T> void insert(T entity, InsertOptions options)
Deprecated, for removal: This API element is subject to removal in a future version.useDatastore.insert(Object, InsertOneOptions)
insteadInserts an entity in to the mapped collection.- Type Parameters:
T
- the type of the entity- Parameters:
entity
- the entity to insertoptions
- the options to apply to the insert operation- Since:
- 1.3
Developer note. Inline this method to update to the new usage
-
insert
@Deprecated(since="2.0", forRemoval=true) default <T> void insert(List<T> entities, InsertOptions options)
Deprecated, for removal: This API element is subject to removal in a future version.useDatastore.insert(List, InsertManyOptions)
insteadInserts entities in to the mapped collection.- Type Parameters:
T
- the type of the entity- Parameters:
entities
- the entities to insertoptions
- the options to apply to the insert operation- Since:
- 1.3
Developer note. Inline this method to update to the new usage
-
queryByExample
@Deprecated(since="2.0", forRemoval=true) <T> Query<T> queryByExample(String collection, T example)
Deprecated, for removal: This API element is subject to removal in a future version.Returns a new query based on the example object- Type Parameters:
T
- the type of the entity- Parameters:
collection
- the collection to queryexample
- the example entity to use when building the query- Returns:
- the query
-
-