Package dev.morphia
Class DatastoreImpl
- java.lang.Object
-
- dev.morphia.DatastoreImpl
-
- All Implemented Interfaces:
AdvancedDatastore,Datastore
@Deprecated public class DatastoreImpl extends java.lang.Object implements AdvancedDatastore
Deprecated.This is an internal implementation of a published API. No public alternative planned.A generic (type-safe) wrapper around mongodb collectionsDeveloper note. This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-
Constructor Summary
Constructors Constructor Description DatastoreImpl(Morphia morphia, com.mongodb.MongoClient mongoClient, java.lang.String dbName)Deprecated.This is not meant to be directly instantiated by end user code.DatastoreImpl(Morphia morphia, Mapper mapper, com.mongodb.MongoClient mongoClient, java.lang.String dbName)Deprecated.This is not meant to be directly instantiated by end user code.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DatastoreImplcopy(java.lang.String database)Deprecated.AggregationPipelinecreateAggregation(java.lang.Class source)Deprecated.Returns a new query bound to the kind (a specificDBCollection)AggregationPipelinecreateAggregation(java.lang.String collection, java.lang.Class<?> clazz)Deprecated.Returns anAggregationPipelinebound to the given collection and class.<T> Query<T>createQuery(java.lang.Class<T> collection)Deprecated.Returns a new query bound to the collection (a specificDBCollection)<T> Query<T>createQuery(java.lang.Class<T> clazz, com.mongodb.DBObject q)Deprecated.<T> Query<T>createQuery(java.lang.String collection, java.lang.Class<T> type)Deprecated.<T> Query<T>createQuery(java.lang.String collection, java.lang.Class<T> type, com.mongodb.DBObject q)Deprecated.<T,V>
com.mongodb.DBRefcreateRef(java.lang.Class<T> clazz, V id)Deprecated.Creates a reference to the entity (using the current DB -can be null-, the collectionName, and id)<T> com.mongodb.DBRefcreateRef(T entity)Deprecated.Creates a reference to the entity (using the current DB -can be null-, the collectionName, and id)<T> UpdateOperations<T>createUpdateOperations(java.lang.Class<T> clazz)Deprecated.The builder for all update operations<T> UpdateOperations<T>createUpdateOperations(java.lang.Class<T> type, com.mongodb.DBObject ops)Deprecated.Creates an UpdateOperations instance for the given type.<T> com.mongodb.WriteResultdelete(Query<T> query)Deprecated.Deletes entities based on the query<T> com.mongodb.WriteResultdelete(Query<T> query, com.mongodb.WriteConcern wc)Deprecated.Deletes entities based on the query, with the WriteConcern<T> com.mongodb.WriteResultdelete(Query<T> query, DeleteOptions options)Deprecated.Deletes entities based on the query<T,V>
com.mongodb.WriteResultdelete(java.lang.Class<T> clazz, java.lang.Iterable<V> ids)Deprecated.Deletes the given entities (by id)<T,V>
com.mongodb.WriteResultdelete(java.lang.Class<T> clazz, java.lang.Iterable<V> ids, DeleteOptions options)Deprecated.Deletes the given entities (by id)<T,V>
com.mongodb.WriteResultdelete(java.lang.Class<T> clazz, V id)Deprecated.Deletes the given entity (by id)<T,V>
com.mongodb.WriteResultdelete(java.lang.Class<T> clazz, V id, DeleteOptions options)Deprecated.Deletes the given entity (by id)<T,V>
com.mongodb.WriteResultdelete(java.lang.String kind, java.lang.Class<T> clazz, V id)Deprecated.Deletes an entity of the given type T, with the givenid, from the collection with the name in thekindparam.<T,V>
com.mongodb.WriteResultdelete(java.lang.String kind, java.lang.Class<T> clazz, V id, com.mongodb.WriteConcern wc)Deprecated.<T,V>
com.mongodb.WriteResultdelete(java.lang.String kind, java.lang.Class<T> clazz, V id, DeleteOptions options)Deprecated.Deletes an entity of the given type T, with the givenid, from the collection with the name in thekindparam.<T> com.mongodb.WriteResultdelete(T entity)Deprecated.Deletes the given entity (by @Id)<T> com.mongodb.WriteResultdelete(T entity, com.mongodb.WriteConcern wc)Deprecated.Deletes the given entity (by @Id), with the WriteConcern<T> com.mongodb.WriteResultdelete(T entity, DeleteOptions options)Deprecated.Deletes the given entity (by @Id), with the WriteConcernvoidenableDocumentValidation()Deprecated.Process anyValidationannotations for document validation.voidensureCaps()Deprecated.ensure capped collections forEntity(s)<T> voidensureIndex(java.lang.Class<T> type, java.lang.String fields)Deprecated.<T> voidensureIndex(java.lang.Class<T> clazz, java.lang.String name, java.lang.String fields, boolean unique, boolean dropDupsOnCreate)Deprecated.<T> voidensureIndex(java.lang.String collection, java.lang.Class<T> type, java.lang.String fields)Deprecated.<T> voidensureIndex(java.lang.String collection, java.lang.Class<T> clazz, java.lang.String name, java.lang.String fields, boolean unique, boolean dropDupsOnCreate)Deprecated.voidensureIndexes()Deprecated.Ensures (creating if necessary) the indexes found during class mappingvoidensureIndexes(boolean background)Deprecated.Ensures (creating if necessary) the indexes found during class mapping (using@Indexed, @Indexes)on the given collection name, possibly in the background<T> voidensureIndexes(java.lang.Class<T> clazz)Deprecated.Ensures (creating if necessary) the indexes found during class mapping<T> voidensureIndexes(java.lang.Class<T> clazz, boolean background)Deprecated.Ensures (creating if necessary) the indexes found during class mapping<T> voidensureIndexes(java.lang.String collection, java.lang.Class<T> clazz)Deprecated.Ensures (creating if necessary) the indexes found during class mapping (using@Indexed, @Indexes)on the given collection name.<T> voidensureIndexes(java.lang.String collection, java.lang.Class<T> clazz, boolean background)Deprecated.Ensures (creating if necessary) the indexes found during class mapping (using@Indexed, @Indexes)on the given collection name, possibly in the backgroundKey<?>exists(java.lang.Object entityOrKey)Deprecated.Does a query to check if the keyOrEntity exists in mongodbKey<?>exists(java.lang.Object entityOrKey, com.mongodb.ReadPreference readPreference)Deprecated.Checks that an entity exists for the given key or entity<T> Query<T>find(java.lang.Class<T> clazz)Deprecated.Find all instances by type<T,V>
Query<T>find(java.lang.Class<T> clazz, java.lang.String property, V value)Deprecated.<T,V>
Query<T>find(java.lang.Class<T> clazz, java.lang.String property, V value, int offset, int size)Deprecated.<T> Query<T>find(java.lang.String collection, java.lang.Class<T> clazz)Deprecated.Find all instances by type in a different collection than what is mapped on the class given.<T,V>
Query<T>find(java.lang.String collection, java.lang.Class<T> clazz, java.lang.String property, V value, int offset, int size)Deprecated.Find all instances by type in a different collection than what is mapped on the class given skipping some documents and returning a fixed number of the remaining.<T,V>
Query<T>find(java.lang.String collection, java.lang.Class<T> clazz, java.lang.String property, V value, int offset, int size, boolean validate)Deprecated.Find all instances by type in a different collection than what is mapped on the class given skipping some documents and returning a fixed number of the remaining.<T> TfindAndDelete(Query<T> query)Deprecated.Deletes the given entities based on the query (first item only).<T> TfindAndDelete(Query<T> query, FindAndModifyOptions options)Deprecated.Deletes the given entities based on the query (first item only).<T> TfindAndModify(Query<T> query, UpdateOperations<T> operations)Deprecated.Find the first Entity from the Query, and modify it.<T> TfindAndModify(Query<T> query, UpdateOperations<T> operations, boolean oldVersion)Deprecated.<T> TfindAndModify(Query<T> query, UpdateOperations<T> operations, boolean oldVersion, boolean createIfMissing)Deprecated.<T> TfindAndModify(Query<T> query, UpdateOperations<T> operations, FindAndModifyOptions options)Deprecated.Find the first Entity from the Query, and modify it.<T> Tget(java.lang.Class<T> clazz, com.mongodb.DBRef ref)Deprecated.Find the given entity (by collectionName/id);<T,V>
Query<T>get(java.lang.Class<T> clazz, java.lang.Iterable<V> ids)Deprecated.Find the given entities (by id); shorthand forfind("_id in", ids)<T,V>
Tget(java.lang.Class<T> clazz, V id)Deprecated.Find the given entity (by id); shorthand forfind("_id ", id)<T,V>
Tget(java.lang.String collection, java.lang.Class<T> clazz, V id)Deprecated.Finds an entity in the named collection whose id matches the value given.<T> Tget(T entity)Deprecated.Find the given entity (by collectionName/id); think of this as refresh<T> TgetByKey(java.lang.Class<T> clazz, Key<T> key)Deprecated.Find the given entity (by collectionName/id);<T> java.util.List<T>getByKeys(java.lang.Class<T> clazz, java.lang.Iterable<Key<T>> keys)Deprecated.Find the given entities (by id), verifying they are of the correct type; shorthand forfind("_id in", ids)<T> java.util.List<T>getByKeys(java.lang.Iterable<Key<T>> keys)Deprecated.Find the given entities (by id); shorthand forfind("_id in", ids)com.mongodb.DBCollectiongetCollection(java.lang.Class clazz)Deprecated.com.mongodb.DBCollectiongetCollection(java.lang.Object obj)Deprecated.this is an internal method.<T> longgetCount(Query<T> query)Deprecated.Gets the count of items returned by this query; same asquery.countAll()<T> longgetCount(Query<T> query, CountOptions options)Deprecated.Gets the count of items returned by this query; same asquery.countAll()<T> longgetCount(java.lang.Class<T> clazz)Deprecated.Gets the count this kind (DBCollection)longgetCount(java.lang.String collection)Deprecated.Gets the count this collection<T> longgetCount(T entity)Deprecated.Gets the count this kind (DBCollection)com.mongodb.client.MongoDatabasegetDatabase()Deprecated.com.mongodb.DBgetDB()Deprecated.com.mongodb.DBDecoderFactorygetDecoderFact()Deprecated.Returns the DBDecoderFactory used by this Datastorecom.mongodb.WriteConcerngetDefaultWriteConcern()Deprecated.protected java.lang.ObjectgetId(java.lang.Object entity)Deprecated.<T> Key<T>getKey(T entity)Deprecated.MappergetMapper()Deprecated.com.mongodb.MongoClientgetMongo()Deprecated.Get the underlying MongoClient that allows connection to the MongoDB instance being used.QueryFactorygetQueryFactory()Deprecated.protected <T> Key<T>insert(com.mongodb.DBCollection dbColl, T entity, InsertOptions options)Deprecated.<T> java.lang.Iterable<Key<T>>insert(java.lang.Iterable<T> entities)Deprecated.Inserts entities in to the database<T> java.lang.Iterable<Key<T>>insert(java.lang.Iterable<T> entities, com.mongodb.WriteConcern wc)Deprecated.Inserts entities in to the mapped collection.<T> java.lang.Iterable<Key<T>>insert(java.lang.Iterable<T> entities, InsertOptions options)Deprecated.Inserts entities in to the mapped collection.<T> java.lang.Iterable<Key<T>>insert(java.lang.String collection, java.lang.Iterable<T> entities)Deprecated.Inserts an entity in to the named collection.<T> java.lang.Iterable<Key<T>>insert(java.lang.String collection, java.lang.Iterable<T> entities, com.mongodb.WriteConcern wc)Deprecated.Inserts an entity in to the named collection.<T> java.lang.Iterable<Key<T>>insert(java.lang.String collection, java.lang.Iterable<T> entities, InsertOptions options)Deprecated.Inserts entities in to the named collection.<T> Key<T>insert(java.lang.String collection, T entity)Deprecated.Inserts an entity in to the named collection.<T> Key<T>insert(java.lang.String collection, T entity, com.mongodb.WriteConcern wc)Deprecated.Inserts an entity in to the database<T> Key<T>insert(java.lang.String collection, T entity, InsertOptions options)Deprecated.Inserts an entity in to the named collection.<T> Key<T>insert(T entity)Deprecated.Inserts an entity in to the mapped collection.<T> java.lang.Iterable<Key<T>>insert(T... entities)Deprecated.<T> Key<T>insert(T entity, com.mongodb.WriteConcern wc)Deprecated.Inserts an entity in to the mapped collection.<T> Key<T>insert(T entity, InsertOptions options)Deprecated.Inserts an entity in to the mapped collection.<T> MapreduceResults<T>mapReduce(MapReduceOptions<T> options)Deprecated.Runs a map/reduce job at the server<T> MapreduceResults<T>mapReduce(MapreduceType type, Query query, java.lang.Class<T> outputType, com.mongodb.MapReduceCommand baseCommand)Deprecated.<T> MapreduceResults<T>mapReduce(MapreduceType type, Query query, java.lang.String map, java.lang.String reduce, java.lang.String finalize, java.util.Map<java.lang.String,java.lang.Object> scopeFields, java.lang.Class<T> outputType)Deprecated.<T> Key<T>merge(T entity)Deprecated.Work as if you did an update with each field in the entity doing a $set; Only at the top level of the entity.<T> Key<T>merge(T entity, com.mongodb.WriteConcern wc)Deprecated.Work as if you did an update with each field in the entity doing a $set; Only at the top level of the entity.<T> Query<T>queryByExample(java.lang.String collection, T ex)Deprecated.Returns a new query based on the example object<T> Query<T>queryByExample(T ex)Deprecated.Returns a new query based on the example objectprotected <T> Key<T>save(com.mongodb.DBCollection dbColl, T entity, InsertOptions options)Deprecated.<T> java.lang.Iterable<Key<T>>save(java.lang.Iterable<T> entities)Deprecated.Saves the entities (Objects) and updates the @Id field The return type will change in 2.0<T> java.lang.Iterable<Key<T>>save(java.lang.Iterable<T> entities, com.mongodb.WriteConcern wc)Deprecated.Saves the entities (Objects) and updates the @Id field, with the WriteConcern<T> java.lang.Iterable<Key<T>>save(java.lang.Iterable<T> entities, InsertOptions options)Deprecated.Saves the entities (Objects) and updates the @Id field, with the WriteConcern The return type will change in 2.0<T> Key<T>save(java.lang.String collection, T entity)Deprecated.Saves an entity in to the named collection.<T> Key<T>save(java.lang.String collection, T entity, com.mongodb.WriteConcern wc)Deprecated.Saves an entity in to the named collection.<T> Key<T>save(java.lang.String collection, T entity, InsertOptions options)Deprecated.Saves an entity in to the named collection.<T> Key<T>save(T entity)Deprecated.Saves an entity (Object) and updates the @Id field The return type will change in 2.0<T> java.lang.Iterable<Key<T>>save(T... entities)Deprecated.<T> Key<T>save(T entity, com.mongodb.WriteConcern wc)Deprecated.<T> Key<T>save(T entity, InsertOptions options)Deprecated.Saves an entity (Object) and updates the @Id field The return type will change in 2.0voidsetDecoderFact(com.mongodb.DBDecoderFactory fact)Deprecated.Sets the DBDecoderFactory to use in this DatastorevoidsetDefaultWriteConcern(com.mongodb.WriteConcern wc)Deprecated.Sets the default WriteConcern for this DatastorevoidsetMapper(Mapper mapper)Deprecated.Sets the Mapper this Datastore usesvoidsetQueryFactory(QueryFactory queryFactory)Deprecated.Replaces the currentQueryFactorywith the given value.<T> UpdateResultsupdate(Key<T> key, UpdateOperations<T> operations)Deprecated.Updates an entity with the operations; this is an atomic operation<T> UpdateResultsupdate(Query<T> query, UpdateOperations<T> operations)Deprecated.Updates all entities found with the operations; this is an atomic operation per entity<T> UpdateResultsupdate(Query<T> query, UpdateOperations<T> operations, boolean createIfMissing)Deprecated.<T> UpdateResultsupdate(Query<T> query, UpdateOperations<T> operations, boolean createIfMissing, com.mongodb.WriteConcern wc)Deprecated.<T> UpdateResultsupdate(Query<T> query, UpdateOperations<T> operations, UpdateOptions options)Deprecated.Updates all entities found with the operations; this is an atomic operation per entity<T> UpdateResultsupdate(T entity, UpdateOperations<T> operations)Deprecated.Updates an entity with the operations; this is an atomic operation<T> UpdateResultsupdateFirst(Query<T> query, UpdateOperations<T> operations)Deprecated.<T> UpdateResultsupdateFirst(Query<T> query, UpdateOperations<T> operations, boolean createIfMissing)Deprecated.<T> UpdateResultsupdateFirst(Query<T> query, UpdateOperations<T> operations, boolean createIfMissing, com.mongodb.WriteConcern wc)Deprecated.<T> UpdateResultsupdateFirst(Query<T> query, T entity, boolean createIfMissing)Deprecated.
-
-
-
Constructor Detail
-
DatastoreImpl
@Deprecated public DatastoreImpl(Morphia morphia, com.mongodb.MongoClient mongoClient, java.lang.String dbName)
Deprecated.This is not meant to be directly instantiated by end user code. UseMorphia.createDatastore(MongoClient, Mapper, String)Create a new DatastoreImpl- Parameters:
morphia- the Morphia instancemongoClient- the connection to the MongoDB instancedbName- the name of the database for this data store.
-
DatastoreImpl
@Deprecated public DatastoreImpl(Morphia morphia, Mapper mapper, com.mongodb.MongoClient mongoClient, java.lang.String dbName)
Deprecated.This is not meant to be directly instantiated by end user code. UseMorphia.createDatastore(MongoClient, Mapper, String)Create a new DatastoreImpl- Parameters:
morphia- the Morphia instancemapper- an initialised MappermongoClient- the connection to the MongoDB instancedbName- the name of the database for this data store.
-
-
Method Detail
-
copy
@Deprecated public DatastoreImpl copy(java.lang.String database)
Deprecated.Creates a copy of this Datastore and all its configuration but with a new database- Parameters:
database- the new database to use for operations- Returns:
- the new Datastore instance
-
createAggregation
public AggregationPipeline createAggregation(java.lang.Class source)
Deprecated.Description copied from interface:DatastoreReturns a new query bound to the kind (a specificDBCollection)- Specified by:
createAggregationin interfaceDatastore- Parameters:
source- the initial type/collection to aggregate against- Returns:
- a new query bound to the kind (a specific
DBCollection)
-
createAggregation
public AggregationPipeline createAggregation(java.lang.String collection, java.lang.Class<?> clazz)
Deprecated.Description copied from interface:AdvancedDatastoreReturns anAggregationPipelinebound to the given collection and class.- Specified by:
createAggregationin interfaceAdvancedDatastore- Parameters:
collection- the collection to queryclazz- The class to create aggregation against- Returns:
- the aggregation pipeline
-
createQuery
public <T> Query<T> createQuery(java.lang.Class<T> collection)
Deprecated.Description copied from interface:DatastoreReturns a new query bound to the collection (a specificDBCollection)- Specified by:
createQueryin interfaceDatastore- Type Parameters:
T- the type of the query- Parameters:
collection- The collection to query- Returns:
- the query
-
createUpdateOperations
public <T> UpdateOperations<T> createUpdateOperations(java.lang.Class<T> clazz)
Deprecated.Description copied from interface:DatastoreThe builder for all update operations- Specified by:
createUpdateOperationsin interfaceDatastore- Type Parameters:
T- the type to update- Parameters:
clazz- the type to update- Returns:
- the new UpdateOperations instance
-
delete
public <T> com.mongodb.WriteResult delete(Query<T> query, DeleteOptions options)
Deprecated.Description copied from interface:DatastoreDeletes entities based on the query
-
delete
public <T,V> com.mongodb.WriteResult delete(java.lang.Class<T> clazz, V id)Deprecated.Description copied from interface:DatastoreDeletes the given entity (by id)
-
delete
public <T,V> com.mongodb.WriteResult delete(java.lang.Class<T> clazz, V id, DeleteOptions options)Deprecated.Description copied from interface:DatastoreDeletes the given entity (by id)
-
delete
public <T,V> com.mongodb.WriteResult delete(java.lang.Class<T> clazz, java.lang.Iterable<V> ids)Deprecated.Description copied from interface:DatastoreDeletes the given entities (by id)
-
delete
public <T,V> com.mongodb.WriteResult delete(java.lang.Class<T> clazz, java.lang.Iterable<V> ids, DeleteOptions options)Deprecated.Description copied from interface:DatastoreDeletes the given entities (by id)
-
delete
public <T> com.mongodb.WriteResult delete(Query<T> query)
Deprecated.Description copied from interface:DatastoreDeletes entities based on the query
-
delete
public <T> com.mongodb.WriteResult delete(Query<T> query, com.mongodb.WriteConcern wc)
Deprecated.Description copied from interface:DatastoreDeletes entities based on the query, with the WriteConcern
-
delete
public <T> com.mongodb.WriteResult delete(T entity)
Deprecated.Description copied from interface:DatastoreDeletes the given entity (by @Id)
-
delete
public <T> com.mongodb.WriteResult delete(T entity, com.mongodb.WriteConcern wc)Deprecated.Description copied from interface:DatastoreDeletes the given entity (by @Id), with the WriteConcern
-
delete
public <T> com.mongodb.WriteResult delete(T entity, DeleteOptions options)Deprecated.Deletes the given entity (by @Id), with the WriteConcern
-
ensureCaps
public void ensureCaps()
Deprecated.Description copied from interface:Datastoreensure capped collections forEntity(s)- Specified by:
ensureCapsin interfaceDatastore
-
enableDocumentValidation
public void enableDocumentValidation()
Deprecated.Description copied from interface:DatastoreProcess anyValidationannotations for document validation.- Specified by:
enableDocumentValidationin interfaceDatastore
-
exists
public Key<?> exists(java.lang.Object entityOrKey)
Deprecated.Description copied from interface:DatastoreDoes a query to check if the keyOrEntity exists in mongodb
-
find
public <T> Query<T> find(java.lang.Class<T> clazz)
Deprecated.Description copied from interface:DatastoreFind all instances by type
-
find
@Deprecated public <T,V> Query<T> find(java.lang.Class<T> clazz, java.lang.String property, V value)
Deprecated.Description copied from interface:DatastoreFind all instances by collectionName, and filter property.
This is the same as:
find(clazzOrEntity).filter (property, value);
-
find
@Deprecated public <T,V> Query<T> find(java.lang.Class<T> clazz, java.lang.String property, V value, int offset, int size)
Deprecated.Description copied from interface:DatastoreFind all instances by type in a different collection than what is mapped on the class given skipping some documents and returning a fixed number of the remaining.- Specified by:
findin interfaceDatastore- Type Parameters:
T- the type to queryV- the type to filter value- Parameters:
clazz- the class to use for mapping the resultsproperty- the document property to query againstvalue- the value to check foroffset- the number of results to skipsize- the maximum number of results to return- Returns:
- the query
-
findAndDelete
public <T> T findAndDelete(Query<T> query)
Deprecated.Description copied from interface:DatastoreDeletes the given entities based on the query (first item only).- Specified by:
findAndDeletein interfaceDatastore- Type Parameters:
T- the type to query- Parameters:
query- the query to use when finding entities to delete- Returns:
- the deleted Entity
-
findAndDelete
public <T> T findAndDelete(Query<T> query, FindAndModifyOptions options)
Deprecated.Description copied from interface:DatastoreDeletes the given entities based on the query (first item only).- Specified by:
findAndDeletein interfaceDatastore- Type Parameters:
T- the type to query- Parameters:
query- the query to use when finding entities to deleteoptions- the options to apply to the delete- Returns:
- the deleted Entity
-
findAndModify
public <T> T findAndModify(Query<T> query, UpdateOperations<T> operations, FindAndModifyOptions options)
Deprecated.Description copied from interface:DatastoreFind the first Entity from the Query, and modify it.- Specified by:
findAndModifyin interfaceDatastore- Type Parameters:
T- the type to query- Parameters:
query- the query to use when finding entities to updateoperations- the updates to apply to the matched documentsoptions- the options to apply to the update- Returns:
- The modified Entity (the result of the update)
-
findAndModify
public <T> T findAndModify(Query<T> query, UpdateOperations<T> operations)
Deprecated.Description copied from interface:DatastoreFind the first Entity from the Query, and modify it.- Specified by:
findAndModifyin interfaceDatastore- Type Parameters:
T- the type to query- Parameters:
query- the query to use when finding entities to updateoperations- the updates to apply to the matched documents- Returns:
- The modified Entity (the result of the update)
-
findAndModify
@Deprecated public <T> T findAndModify(Query<T> query, UpdateOperations<T> operations, boolean oldVersion)
Deprecated.Description copied from interface:DatastoreFind the first Entity from the Query, and modify it.- Specified by:
findAndModifyin interfaceDatastore- Type Parameters:
T- the type to query- Parameters:
query- the query to find the Entity with; You are not allowed to offset/skip in the query.operations- the updates to apply to the matched documentsoldVersion- indicated the old version of the Entity should be returned- Returns:
- The Entity (the result of the update if oldVersion is false)
-
findAndModify
@Deprecated public <T> T findAndModify(Query<T> query, UpdateOperations<T> operations, boolean oldVersion, boolean createIfMissing)
Deprecated.Description copied from interface:DatastoreFind the first Entity from the Query, and modify it.- Specified by:
findAndModifyin interfaceDatastore- Type Parameters:
T- the type of the entity- Parameters:
query- the query to find the Entity with; You are not allowed to offset/skip in the query.operations- the updates to apply to the matched documentsoldVersion- indicated the old version of the Entity should be returnedcreateIfMissing- if the query returns no results, then a new object will be created (sets upsert=true)- Returns:
- The Entity (the result of the update if oldVersion is false)
-
get
public <T,V> Query<T> get(java.lang.Class<T> clazz, java.lang.Iterable<V> ids)
Deprecated.Description copied from interface:DatastoreFind the given entities (by id); shorthand forfind("_id in", ids)
-
get
public <T,V> T get(java.lang.Class<T> clazz, V id)Deprecated.Description copied from interface:DatastoreFind the given entity (by id); shorthand forfind("_id ", id)
-
get
public <T> T get(T entity)
Deprecated.Description copied from interface:DatastoreFind the given entity (by collectionName/id); think of this as refresh
-
getByKey
public <T> T getByKey(java.lang.Class<T> clazz, Key<T> key)Deprecated.Description copied from interface:DatastoreFind the given entity (by collectionName/id);
-
getByKeys
public <T> java.util.List<T> getByKeys(java.lang.Class<T> clazz, java.lang.Iterable<Key<T>> keys)Deprecated.Description copied from interface:DatastoreFind the given entities (by id), verifying they are of the correct type; shorthand forfind("_id in", ids)
-
getByKeys
public <T> java.util.List<T> getByKeys(java.lang.Iterable<Key<T>> keys)
Deprecated.Description copied from interface:DatastoreFind the given entities (by id); shorthand forfind("_id in", ids)
-
getCollection
@Deprecated public com.mongodb.DBCollection getCollection(java.lang.Object obj)
Deprecated.this is an internal method. no replacement is planned.- Parameters:
obj- the value to search with- Returns:
- the DBCollection
-
getCollection
public com.mongodb.DBCollection getCollection(java.lang.Class clazz)
Deprecated.- Specified by:
getCollectionin interfaceDatastore- Parameters:
clazz- the class to use for mapping- Returns:
- the mapped collection for the collection
-
getCount
public <T> long getCount(T entity)
Deprecated.Description copied from interface:DatastoreGets the count this kind (DBCollection)
-
getCount
public <T> long getCount(java.lang.Class<T> clazz)
Deprecated.Description copied from interface:DatastoreGets the count this kind (DBCollection)
-
getCount
public <T> long getCount(Query<T> query)
Deprecated.Description copied from interface:DatastoreGets the count of items returned by this query; same asquery.countAll()
-
getCount
public <T> long getCount(Query<T> query, CountOptions options)
Deprecated.Description copied from interface:DatastoreGets the count of items returned by this query; same asquery.countAll()
-
getDB
public com.mongodb.DB getDB()
Deprecated.
-
getDatabase
public com.mongodb.client.MongoDatabase getDatabase()
Deprecated.- Specified by:
getDatabasein interfaceDatastore- Returns:
- the MongoDatabase used by this DataStore
-
getDefaultWriteConcern
public com.mongodb.WriteConcern getDefaultWriteConcern()
Deprecated.- Specified by:
getDefaultWriteConcernin interfaceDatastore- Returns:
- the default WriteConcern used by this Datastore
-
setDefaultWriteConcern
public void setDefaultWriteConcern(com.mongodb.WriteConcern wc)
Deprecated.Description copied from interface:DatastoreSets the default WriteConcern for this Datastore- Specified by:
setDefaultWriteConcernin interfaceDatastore- Parameters:
wc- the default WriteConcern to be used by this Datastore
-
getKey
@Deprecated public <T> Key<T> getKey(T entity)
Deprecated.Description copied from interface:DatastoreCreates a (type-safe) reference to the entity; if stored this will become aDBRef
-
getMongo
public com.mongodb.MongoClient getMongo()
Deprecated.Description copied from interface:DatastoreGet the underlying MongoClient that allows connection to the MongoDB instance being used.
-
getQueryFactory
public QueryFactory getQueryFactory()
Deprecated.- Specified by:
getQueryFactoryin interfaceDatastore- Returns:
- the current
QueryFactory. - See Also:
QueryFactory
-
setQueryFactory
public void setQueryFactory(QueryFactory queryFactory)
Deprecated.Description copied from interface:DatastoreReplaces the currentQueryFactorywith the given value.- Specified by:
setQueryFactoryin interfaceDatastore- Parameters:
queryFactory- the QueryFactory to use- See Also:
QueryFactory
-
mapReduce
public <T> MapreduceResults<T> mapReduce(MapReduceOptions<T> options)
Deprecated.Description copied from interface:DatastoreRuns a map/reduce job at the server
-
mapReduce
@Deprecated public <T> MapreduceResults<T> mapReduce(MapreduceType type, Query query, java.lang.String map, java.lang.String reduce, java.lang.String finalize, java.util.Map<java.lang.String,java.lang.Object> scopeFields, java.lang.Class<T> outputType)
Deprecated.Description copied from interface:DatastoreRuns a map/reduce job at the server; this should be used with a server version 1.7.4 or higher- Specified by:
mapReducein interfaceDatastore- Type Parameters:
T- The type of resulting data- Parameters:
type- MapreduceTypequery- The query (only the criteria, limit and sort will be used)map- The map function, in javascript, as a stringreduce- The reduce function, in javascript, as a stringfinalize- The finalize function, in javascript, as a string; can be nullscopeFields- Each map entry will be a global variable in all the functions; can be nulloutputType- The type of resulting data; inline is not working yet- Returns:
- counts and stuff
-
mapReduce
@Deprecated public <T> MapreduceResults<T> mapReduce(MapreduceType type, Query query, java.lang.Class<T> outputType, com.mongodb.MapReduceCommand baseCommand)
Deprecated.Description copied from interface:DatastoreRuns a map/reduce job at the server; this should be used with a server version 1.7.4 or higher- Specified by:
mapReducein interfaceDatastore- Type Parameters:
T- The type of resulting data- Parameters:
type- MapreduceTypequery- The query (only the criteria, limit and sort will be used)outputType- The type of resulting data; inline is not working yetbaseCommand- The base command to fill in and send to the server- Returns:
- counts and stuff
-
merge
public <T> Key<T> merge(T entity)
Deprecated.Description copied from interface:DatastoreWork as if you did an update with each field in the entity doing a $set; Only at the top level of the entity.
-
merge
public <T> Key<T> merge(T entity, com.mongodb.WriteConcern wc)
Deprecated.Description copied from interface:DatastoreWork as if you did an update with each field in the entity doing a $set; Only at the top level of the entity.
-
queryByExample
public <T> Query<T> queryByExample(T ex)
Deprecated.Description copied from interface:DatastoreReturns a new query based on the example object- Specified by:
queryByExamplein interfaceDatastore- Type Parameters:
T- the type of the entity- Parameters:
ex- the example entity to use when creating the query- Returns:
- the query
-
save
public <T> java.lang.Iterable<Key<T>> save(java.lang.Iterable<T> entities)
Deprecated.Description copied from interface:DatastoreSaves the entities (Objects) and updates the @Id field The return type will change in 2.0
-
save
public <T> java.lang.Iterable<Key<T>> save(java.lang.Iterable<T> entities, com.mongodb.WriteConcern wc)
Deprecated.Description copied from interface:DatastoreSaves the entities (Objects) and updates the @Id field, with the WriteConcern
-
save
public <T> java.lang.Iterable<Key<T>> save(java.lang.Iterable<T> entities, InsertOptions options)
Deprecated.Description copied from interface:DatastoreSaves the entities (Objects) and updates the @Id field, with the WriteConcern The return type will change in 2.0
-
save
@Deprecated public <T> java.lang.Iterable<Key<T>> save(T... entities)
Deprecated.Description copied from interface:DatastoreSaves the entities (Objects) and updates the @Id field
-
save
public <T> Key<T> save(T entity)
Deprecated.Description copied from interface:DatastoreSaves an entity (Object) and updates the @Id field The return type will change in 2.0
-
save
@Deprecated public <T> Key<T> save(T entity, com.mongodb.WriteConcern wc)
Deprecated.Description copied from interface:DatastoreSaves an entity (Object) and updates the @Id field, with the WriteConcern
-
save
public <T> Key<T> save(T entity, InsertOptions options)
Deprecated.Description copied from interface:DatastoreSaves an entity (Object) and updates the @Id field The return type will change in 2.0
-
update
public <T> UpdateResults update(T entity, UpdateOperations<T> operations)
Deprecated.Description copied from interface:DatastoreUpdates an entity with the operations; this is an atomic operation- Specified by:
updatein interfaceDatastore- Type Parameters:
T- the type of the entity- Parameters:
entity- the entity to updateoperations- the update operations to perform- Returns:
- the update results
- See Also:
UpdateResults
-
update
public <T> UpdateResults update(Key<T> key, UpdateOperations<T> operations)
Deprecated.Description copied from interface:DatastoreUpdates an entity with the operations; this is an atomic operation- Specified by:
updatein interfaceDatastore- Type Parameters:
T- the type of the entity- Parameters:
key- the key of entity to updateoperations- the update operations to perform- Returns:
- the update results
- See Also:
UpdateResults
-
update
public <T> UpdateResults update(Query<T> query, UpdateOperations<T> operations)
Deprecated.Description copied from interface:DatastoreUpdates all entities found with the operations; this is an atomic operation per entity
-
update
@Deprecated public <T> UpdateResults update(Query<T> query, UpdateOperations<T> operations, boolean createIfMissing)
Deprecated.Description copied from interface:DatastoreUpdates all entities found with the operations, if nothing is found insert the update as an entity if "createIfMissing" is true; this is an atomic operation per entity- Specified by:
updatein interfaceDatastore- Type Parameters:
T- the type of the entity- Parameters:
query- the query used to match the documents to updateoperations- the update operations to performcreateIfMissing- if true, a document will be created if none can be found that match the query- Returns:
- the results of the updates
-
update
@Deprecated public <T> UpdateResults update(Query<T> query, UpdateOperations<T> operations, boolean createIfMissing, com.mongodb.WriteConcern wc)
Deprecated.Description copied from interface:DatastoreUpdates all entities found with the operations, if nothing is found insert the update as an entity if "createIfMissing" is true; this is an atomic operation per entity- Specified by:
updatein interfaceDatastore- Type Parameters:
T- the type of the entity- Parameters:
query- the query used to match the documents to updateoperations- the update operations to performcreateIfMissing- if true, a document will be created if none can be found that match the querywc- the WriteConcern to use- Returns:
- the results of the updates
-
updateFirst
@Deprecated public <T> UpdateResults updateFirst(Query<T> query, UpdateOperations<T> operations)
Deprecated.Description copied from interface:DatastoreUpdates the first entity found with the operations; this is an atomic operation- Specified by:
updateFirstin interfaceDatastore- Type Parameters:
T- the type of the entity- Parameters:
query- the query used to match the document to updateoperations- the update operations to perform- Returns:
- the results of the update
-
updateFirst
@Deprecated public <T> UpdateResults updateFirst(Query<T> query, UpdateOperations<T> operations, boolean createIfMissing)
Deprecated.Description copied from interface:DatastoreUpdates the first entity found with the operations, if nothing is found insert the update as an entity if "createIfMissing" is true.- Specified by:
updateFirstin interfaceDatastore- Type Parameters:
T- the type of the entity- Parameters:
query- the query used to match the documents to updateoperations- the update operations to performcreateIfMissing- if true, a document will be created if none can be found that match the query- Returns:
- the results of the updates
-
updateFirst
@Deprecated public <T> UpdateResults updateFirst(Query<T> query, UpdateOperations<T> operations, boolean createIfMissing, com.mongodb.WriteConcern wc)
Deprecated.Description copied from interface:DatastoreUpdates the first entity found with the operations, if nothing is found insert the update as an entity if "createIfMissing" is true.- Specified by:
updateFirstin interfaceDatastore- Type Parameters:
T- the type of the entity- Parameters:
query- the query used to match the documents to updateoperations- the update operations to performcreateIfMissing- if true, a document will be created if none can be found that match the querywc- the WriteConcern to use- Returns:
- the results of the updates
-
updateFirst
@Deprecated public <T> UpdateResults updateFirst(Query<T> query, T entity, boolean createIfMissing)
Deprecated.Description copied from interface:Datastoreupdates the first entity found using the entity as a template, if nothing is found insert the update as an entity if "createIfMissing" is true.If the entity is a versioned entity, an UnsupportedOperationException is thrown.
- Specified by:
updateFirstin interfaceDatastore- Type Parameters:
T- the type of the entity- Parameters:
query- the query used to match the documents to updateentity- the entity whose state will be used as an update template for any matching documentscreateIfMissing- if true, a document will be created if none can be found that match the query- Returns:
- the results of the updates
-
createQuery
public <T> Query<T> createQuery(java.lang.String collection, java.lang.Class<T> type)
Deprecated.- Specified by:
createQueryin interfaceAdvancedDatastore- Type Parameters:
T- The type of the entity- Parameters:
collection- the collection to querytype- the class of objects to be returned- Returns:
- Query for the specified class clazz
-
createQuery
public <T> Query<T> createQuery(java.lang.Class<T> clazz, com.mongodb.DBObject q)
Deprecated.- Specified by:
createQueryin interfaceAdvancedDatastore- Type Parameters:
T- The type of the entity- Parameters:
clazz- the class of objects to be returnedq- the query which will be passed to aQueryFactory- Returns:
- Query for the specified class clazz
-
createQuery
public <T> Query<T> createQuery(java.lang.String collection, java.lang.Class<T> type, com.mongodb.DBObject q)
Deprecated.- Specified by:
createQueryin interfaceAdvancedDatastore- Type Parameters:
T- The type of the entity- Parameters:
collection- the collection to querytype- the class of objects to be returnedq- the query which will be passed to aQueryFactory- Returns:
- Query for the specified class clazz
-
createRef
public <T,V> com.mongodb.DBRef createRef(java.lang.Class<T> clazz, V id)Deprecated.Description copied from interface:AdvancedDatastoreCreates a reference to the entity (using the current DB -can be null-, the collectionName, and id)- Specified by:
createRefin interfaceAdvancedDatastore- 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
public <T> com.mongodb.DBRef createRef(T entity)
Deprecated.Description copied from interface:AdvancedDatastoreCreates a reference to the entity (using the current DB -can be null-, the collectionName, and id)- Specified by:
createRefin interfaceAdvancedDatastore- Type Parameters:
T- The type of the entity- Parameters:
entity- the entity to create a DBRef for- Returns:
- the DBRef for the entity
-
createUpdateOperations
public <T> UpdateOperations<T> createUpdateOperations(java.lang.Class<T> type, com.mongodb.DBObject ops)
Deprecated.Description copied from interface:AdvancedDatastoreCreates an UpdateOperations instance for the given type.- Specified by:
createUpdateOperationsin interfaceAdvancedDatastore- Type Parameters:
T- The type of the entity- Parameters:
type- The type of the entityops- The operations to perform- Returns:
- the UpdateOperations instance
-
delete
public <T,V> com.mongodb.WriteResult delete(java.lang.String kind, java.lang.Class<T> clazz, V id)Deprecated.Description copied from interface:AdvancedDatastoreDeletes an entity of the given type T, with the givenid, from the collection with the name in thekindparam. Validates theid, checking it's the correct type for an ID for entities of typeT. The entity typeclazzis used only for validation, not for filtering, therefore if you have entities of different types in the same collection (kind), this method will delete any entity with the givenid, regardless of its type.- Specified by:
deletein interfaceAdvancedDatastore- Type Parameters:
T- the entity typeV- is the type of the ID, for example ObjectId- Parameters:
kind- the collection nameclazz- the Class of the entity to deleteid- the value of the ID- Returns:
- the result of this delete operation.
-
delete
public <T,V> com.mongodb.WriteResult delete(java.lang.String kind, java.lang.Class<T> clazz, V id, DeleteOptions options)Deprecated.Description copied from interface:AdvancedDatastoreDeletes an entity of the given type T, with the givenid, from the collection with the name in thekindparam. Validates theid, checking it's the correct type for an ID for entities of typeT. The entity typeclazzis used only for validation, not for filtering, therefore if you have entities of different types in the same collection (kind), this method will delete any entity with the givenid, regardless of its type.- Specified by:
deletein interfaceAdvancedDatastore- Type Parameters:
T- the entity typeV- is the type of the ID, for example ObjectId- Parameters:
kind- the collection nameclazz- the Class of the entity to deleteid- the value of the IDoptions- the options to use when deleting- Returns:
- the result of this delete operation.
-
delete
@Deprecated public <T,V> com.mongodb.WriteResult delete(java.lang.String kind, java.lang.Class<T> clazz, V id, com.mongodb.WriteConcern wc)Deprecated.Description copied from interface:AdvancedDatastoreDeletes an entity of the given type T, with the givenid, from the collection with the name in thekindparam. Validates theid, checking it's the correct type for an ID for entities of typeT. The entity typeclazzis used only for validation, not for filtering, therefore if you have entities of different types in the same collection (kind), this method will delete any entity with the givenid, regardless of its type.- Specified by:
deletein interfaceAdvancedDatastore- Type Parameters:
T- the entity typeV- is the type of the ID, for example ObjectId- Parameters:
kind- the collection nameclazz- the Class of the entity to deleteid- the value of the IDwc- the WriteConcern for this operation- Returns:
- the result of this delete operation.
-
ensureIndex
@Deprecated public <T> void ensureIndex(java.lang.Class<T> type, java.lang.String fields)Deprecated.Description copied from interface:DatastoreEnsures (creating if necessary) the index including the field(s) + directions on the given collection name; eg fields = "field1, -field2" ({field1:1, field2:-1})- Specified by:
ensureIndexin interfaceDatastore- Type Parameters:
T- the type to index- Parameters:
type- the class from which to get the index definitionsfields- the fields to index- See Also:
MongoCollection.createIndex(org.bson.conversions.Bson, com.mongodb.client.model.IndexOptions)
-
ensureIndex
@Deprecated public <T> void ensureIndex(java.lang.Class<T> clazz, java.lang.String name, java.lang.String fields, boolean unique, boolean dropDupsOnCreate)Deprecated.Description copied from interface:DatastoreEnsures (creating if necessary) the index including the field(s) + directions on the given collection name; eg fields = "field1, -field2" ({field1:1, field2:-1})- Specified by:
ensureIndexin interfaceDatastore- Type Parameters:
T- the type to index- Parameters:
clazz- the class from which to get the index definitionsname- the name of the index to createfields- the fields to indexunique- true if the index should enforce uniqueness on the fields indexeddropDupsOnCreate- Support for this has been removed from the server. This value is ignored.- See Also:
MongoCollection.createIndex(org.bson.conversions.Bson, com.mongodb.client.model.IndexOptions)
-
ensureIndexes
public void ensureIndexes()
Deprecated.Description copied from interface:DatastoreEnsures (creating if necessary) the indexes found during class mapping- Specified by:
ensureIndexesin interfaceDatastore- See Also:
Indexes,Indexed,Text
-
ensureIndexes
public void ensureIndexes(boolean background)
Deprecated.Description copied from interface:DatastoreEnsures (creating if necessary) the indexes found during class mapping (using@Indexed, @Indexes)on the given collection name, possibly in the background- Specified by:
ensureIndexesin interfaceDatastore- Parameters:
background- if true, the index will be built in the background. If false, background indexing is deferred to the annotation definition- See Also:
Indexes,Indexed,Text
-
ensureIndexes
public <T> void ensureIndexes(java.lang.Class<T> clazz)
Deprecated.Description copied from interface:DatastoreEnsures (creating if necessary) the indexes found during class mapping- Specified by:
ensureIndexesin interfaceDatastore- Type Parameters:
T- the type to index- Parameters:
clazz- the class from which to get the index definitions- See Also:
Indexes,Indexed,Text
-
ensureIndexes
public <T> void ensureIndexes(java.lang.Class<T> clazz, boolean background)Deprecated.Description copied from interface:DatastoreEnsures (creating if necessary) the indexes found during class mapping- Specified by:
ensureIndexesin interfaceDatastore- Type Parameters:
T- the type to index- Parameters:
clazz- the class from which to get the index definitionsbackground- if true, the index will be built in the background. If false, background indexing is deferred to the annotation definition- See Also:
Indexes,Indexed,Text
-
ensureIndex
@Deprecated public <T> void ensureIndex(java.lang.String collection, java.lang.Class<T> type, java.lang.String fields)Deprecated.Description copied from interface:AdvancedDatastoreEnsures (creating if necessary) the index including the field(s) + directions on the given collection name; eg fields = "field1, -field2" ({field1:1, field2:-1})- Specified by:
ensureIndexin interfaceAdvancedDatastore- Type Parameters:
T- the type to index- Parameters:
collection- the collection to updatetype- the class from which to get the index definitionsfields- the fields to index- See Also:
MongoCollection.createIndex(org.bson.conversions.Bson, com.mongodb.client.model.IndexOptions),AdvancedDatastore.ensureIndexes(String, Class)
-
ensureIndex
@Deprecated public <T> void ensureIndex(java.lang.String collection, java.lang.Class<T> clazz, java.lang.String name, java.lang.String fields, boolean unique, boolean dropDupsOnCreate)Deprecated.Description copied from interface:AdvancedDatastoreEnsures (creating if necessary) the index including the field(s) + directions on the given collection name; eg fields = "field1, -field2" ({field1:1, field2:-1})- Specified by:
ensureIndexin interfaceAdvancedDatastore- Type Parameters:
T- the type to index- Parameters:
collection- the collection to updateclazz- the class from which to get the index definitionsname- the name of the index to createfields- the fields to indexunique- true if the index should enforce uniqueness on the fields indexeddropDupsOnCreate- This value is no longer supported. Tells the unique index to drop duplicates silently when creating; only the first will be kept- See Also:
MongoCollection.createIndex(org.bson.conversions.Bson, com.mongodb.client.model.IndexOptions),AdvancedDatastore.ensureIndexes(String, Class)
-
ensureIndexes
public <T> void ensureIndexes(java.lang.String collection, java.lang.Class<T> clazz)Deprecated.Description copied from interface:AdvancedDatastoreEnsures (creating if necessary) the indexes found during class mapping (using@Indexed, @Indexes)on the given collection name.- Specified by:
ensureIndexesin interfaceAdvancedDatastore- Type Parameters:
T- the type to index- Parameters:
collection- the collection to updateclazz- the class from which to get the index definitions
-
ensureIndexes
public <T> void ensureIndexes(java.lang.String collection, java.lang.Class<T> clazz, boolean background)Deprecated.Description copied from interface:AdvancedDatastoreEnsures (creating if necessary) the indexes found during class mapping (using@Indexed, @Indexes)on the given collection name, possibly in the background- Specified by:
ensureIndexesin interfaceAdvancedDatastore- Type Parameters:
T- the type to index- Parameters:
collection- the collection to updateclazz- the class from which to get the index definitionsbackground- if true, the index will be built in the background. If false, the method will block until the index is created.
-
exists
public Key<?> exists(java.lang.Object entityOrKey, com.mongodb.ReadPreference readPreference)
Deprecated.Description copied from interface:AdvancedDatastoreChecks that an entity exists for the given key or entity- Specified by:
existsin interfaceAdvancedDatastore- Parameters:
entityOrKey- the value to check forreadPreference- Uses the supplied ReadPreference for the check. If readPreference is null the preference is taken from the annotation or uses the default preference.- Returns:
- the key if the entity exists
- See Also:
Datastore.exists(Object)
-
find
public <T> Query<T> find(java.lang.String collection, java.lang.Class<T> clazz)
Deprecated.Description copied from interface:AdvancedDatastoreFind all instances by type in a different collection than what is mapped on the class given.- Specified by:
findin interfaceAdvancedDatastore- Type Parameters:
T- the type to query- Parameters:
collection- the collection to query againstclazz- the class to use for mapping the results- Returns:
- the query
-
find
public <T,V> Query<T> find(java.lang.String collection, java.lang.Class<T> clazz, java.lang.String property, V value, int offset, int size)
Deprecated.Description copied from interface:AdvancedDatastoreFind all instances by type in a different collection than what is mapped on the class given skipping some documents and returning a fixed number of the remaining.- Specified by:
findin interfaceAdvancedDatastore- Type Parameters:
T- the type to queryV- the type to filter value- Parameters:
collection- the collection to query againstclazz- the class to use for mapping the resultsproperty- the document property to query againstvalue- the value to check foroffset- the number of results to skipsize- the maximum number of results to return- Returns:
- the query
-
get
public <T> T get(java.lang.Class<T> clazz, com.mongodb.DBRef ref)Deprecated.Description copied from interface:AdvancedDatastoreFind the given entity (by collectionName/id);- Specified by:
getin interfaceAdvancedDatastore- Type Parameters:
T- the type to fetch- Parameters:
clazz- the class to use for mappingref- the DBRef to use when querying- Returns:
- the entity referenced in the DBRef. May be null.
-
get
public <T,V> T get(java.lang.String collection, java.lang.Class<T> clazz, V id)Deprecated.Description copied from interface:AdvancedDatastoreFinds an entity in the named collection whose id matches the value given.- Specified by:
getin interfaceAdvancedDatastore- Type Parameters:
T- the type to fetchV- the type of the ID- Parameters:
collection- the collection to queryclazz- the class to use for mappingid- the ID to query- Returns:
- the entity with the id. May be null.
-
getCount
public long getCount(java.lang.String collection)
Deprecated.Description copied from interface:AdvancedDatastoreGets the count this collection- Specified by:
getCountin interfaceAdvancedDatastore- Parameters:
collection- the collection to count- Returns:
- the collection size
-
getDecoderFact
public com.mongodb.DBDecoderFactory getDecoderFact()
Deprecated.Description copied from interface:AdvancedDatastoreReturns the DBDecoderFactory used by this Datastore- Specified by:
getDecoderFactin interfaceAdvancedDatastore- Returns:
- the decoder factory
- See Also:
DBDecoderFactory
-
setDecoderFact
public void setDecoderFact(com.mongodb.DBDecoderFactory fact)
Deprecated.Description copied from interface:AdvancedDatastoreSets the DBDecoderFactory to use in this Datastore- Specified by:
setDecoderFactin interfaceAdvancedDatastore- Parameters:
fact- the DBDecoderFactory to use
-
insert
public <T> Key<T> insert(java.lang.String collection, T entity)
Deprecated.Description copied from interface:AdvancedDatastoreInserts an entity in to the named collection.- Specified by:
insertin interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
collection- the collection to updateentity- the entity to insert- Returns:
- the new key of the inserted entity
-
insert
public <T> Key<T> insert(java.lang.String collection, T entity, InsertOptions options)
Deprecated.Description copied from interface:AdvancedDatastoreInserts an entity in to the named collection.- Specified by:
insertin interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
collection- the collection to updateentity- the entity to insertoptions- the options to apply to the insert operation- Returns:
- the new key of the inserted entity
-
insert
public <T> Key<T> insert(T entity)
Deprecated.Description copied from interface:AdvancedDatastoreInserts an entity in to the mapped collection. The return type will change in 2.0- Specified by:
insertin interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
entity- the entity to insert- Returns:
- the new key of the inserted entity
-
insert
public <T> Key<T> insert(T entity, com.mongodb.WriteConcern wc)
Deprecated.Description copied from interface:AdvancedDatastoreInserts an entity in to the mapped collection.- Specified by:
insertin interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
entity- the entity to insertwc- the WriteConcern to use when inserting- Returns:
- the new key of the inserted entity
- See Also:
WriteConcern
-
insert
public <T> Key<T> insert(T entity, InsertOptions options)
Deprecated.Description copied from interface:AdvancedDatastoreInserts an entity in to the mapped collection. The return type will change in 2.0- Specified by:
insertin interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
entity- the entity to insertoptions- the options to apply to the insert operation- Returns:
- the new key of the inserted entity
-
insert
@Deprecated public <T> java.lang.Iterable<Key<T>> insert(T... entities)
Deprecated.Description copied from interface:AdvancedDatastoreInserts entities in to the mapped collection.- Specified by:
insertin interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
entities- the entities to insert- Returns:
- the new keys of the inserted entities
-
insert
public <T> java.lang.Iterable<Key<T>> insert(java.lang.Iterable<T> entities, com.mongodb.WriteConcern wc)
Deprecated.Description copied from interface:AdvancedDatastoreInserts entities in to the mapped collection.- Specified by:
insertin interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
entities- the entities to insertwc- the WriteConcern to use when inserting- Returns:
- the new keys of the inserted entities
-
insert
public <T> java.lang.Iterable<Key<T>> insert(java.lang.Iterable<T> entities, InsertOptions options)
Deprecated.Description copied from interface:AdvancedDatastoreInserts entities in to the mapped collection. The return type will change in 2.0- Specified by:
insertin interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
entities- the entities to insertoptions- the options to apply to the insert operation- Returns:
- the new keys of the inserted entities
-
insert
public <T> java.lang.Iterable<Key<T>> insert(java.lang.String collection, java.lang.Iterable<T> entities)
Deprecated.Description copied from interface:AdvancedDatastoreInserts an entity in to the named collection.- Specified by:
insertin interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
collection- the collection to updateentities- the entities to insert- Returns:
- the new keys of the inserted entities
-
insert
public <T> java.lang.Iterable<Key<T>> insert(java.lang.String collection, java.lang.Iterable<T> entities, com.mongodb.WriteConcern wc)
Deprecated.Description copied from interface:AdvancedDatastoreInserts an entity in to the named collection.- Specified by:
insertin interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
collection- the collection to updateentities- the entities to insertwc- the WriteConcern to use when inserting- Returns:
- the new keys of the inserted entities
- See Also:
WriteConcern
-
insert
public <T> java.lang.Iterable<Key<T>> insert(java.lang.String collection, java.lang.Iterable<T> entities, InsertOptions options)
Deprecated.Description copied from interface:AdvancedDatastoreInserts entities in to the named collection.- Specified by:
insertin interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
collection- the collection to updateentities- the entities to insertoptions- the options to apply to the insert operation- Returns:
- the new keys of the inserted entities
-
queryByExample
public <T> Query<T> queryByExample(java.lang.String collection, T ex)
Deprecated.Description copied from interface:AdvancedDatastoreReturns a new query based on the example object- Specified by:
queryByExamplein interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
collection- the collection to queryex- the example entity to use when building the query- Returns:
- the query
-
save
public <T> Key<T> save(java.lang.String collection, T entity)
Deprecated.Description copied from interface:AdvancedDatastoreSaves an entity in to the named collection.- Specified by:
savein interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
collection- the collection to updateentity- the entity to save- Returns:
- the new key of the inserted entity
-
save
public <T> Key<T> save(java.lang.String collection, T entity, com.mongodb.WriteConcern wc)
Deprecated.Description copied from interface:AdvancedDatastoreSaves an entity in to the named collection.- Specified by:
savein interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
collection- the collection to updateentity- the entity to savewc- the WriteConcern to use when inserting- Returns:
- the new key of the inserted entity
-
save
public <T> Key<T> save(java.lang.String collection, T entity, InsertOptions options)
Deprecated.Description copied from interface:AdvancedDatastoreSaves an entity in to the named collection.- Specified by:
savein interfaceAdvancedDatastore- Type Parameters:
T- the type of the entity- Parameters:
collection- the collection to updateentity- the entity to saveoptions- the options to apply to the save operation- Returns:
- the new key of the inserted entity
-
find
public <T,V> Query<T> find(java.lang.String collection, java.lang.Class<T> clazz, java.lang.String property, V value, int offset, int size, boolean validate)
Deprecated.Find all instances by type in a different collection than what is mapped on the class given skipping some documents and returning a fixed number of the remaining.- Type Parameters:
T- the type to queryV- the type to filter value- Parameters:
collection- The collection use when queryingclazz- the class to use for mapping the resultsproperty- the document property to query againstvalue- the value to check foroffset- the number of results to skipsize- the maximum number of results to returnvalidate- if true, validate the query- Returns:
- the query
-
getMapper
public Mapper getMapper()
Deprecated.
-
setMapper
public void setMapper(Mapper mapper)
Deprecated.Sets the Mapper this Datastore uses- Parameters:
mapper- the new Mapper
-
insert
public <T> java.lang.Iterable<Key<T>> insert(java.lang.Iterable<T> entities)
Deprecated.Inserts entities in to the database- Specified by:
insertin interfaceAdvancedDatastore- Type Parameters:
T- the type of the entities- Parameters:
entities- the entities to insert- Returns:
- the keys of entities
-
insert
public <T> Key<T> insert(java.lang.String collection, T entity, com.mongodb.WriteConcern wc)
Deprecated.Inserts an entity in to the database- Type Parameters:
T- the type of the entities- Parameters:
collection- the collection to query againstentity- the entity to insertwc- the WriteConcern to use when deleting- Returns:
- the key of entity
-
getId
@Deprecated protected java.lang.Object getId(java.lang.Object entity)
Deprecated.
-
insert
protected <T> Key<T> insert(com.mongodb.DBCollection dbColl, T entity, InsertOptions options)
Deprecated.
-
save
protected <T> Key<T> save(com.mongodb.DBCollection dbColl, T entity, InsertOptions options)
Deprecated.
-
update
public <T> UpdateResults update(Query<T> query, UpdateOperations<T> operations, UpdateOptions options)
Deprecated.Description copied from interface:DatastoreUpdates all entities found with the operations; this is an atomic operation per entity
-
-