Package io.mangoo.persistence
Class DatastoreImpl
java.lang.Object
io.mangoo.persistence.DatastoreImpl
- All Implemented Interfaces:
Datastore
- Author:
- svenkubiak
-
Constructor Summary
ConstructorsConstructorDescriptionDatastoreImpl(Config config, EventBusService eventBus) DatastoreImpl(String prefix) -
Method Summary
Modifier and TypeMethodDescription<T> longCounts all objected of a mapped Morphia classvoidDeletes a mapped Morphia object in MongoDB<T> voidDeletes all mapped Morphia objects of a given classvoiddeleteAsync(Object object) Deletes a mapped Morphia object to MongoDB asynchronouslyvoidDrops all data in MongoDB on the connected databasevoidEnsure capped DBCollections for Entity(s)voidEnsures (creating if necessary) the indexes found during class mapping (using @Indexed, @Indexes)<T> List<T>Retrieves a list of mapped Morphia objects from MongoDB<T> TRetrieves a mapped Morphia object from MongoDB.dev.morphia.Datastorecom.mongodb.client.MongoClientdev.morphia.Datastorequery()voidSaves a mapped Morphia object to MongoDBvoidSaves a mapped Morphia object to MongoDB asynchronously
-
Constructor Details
-
DatastoreImpl
-
DatastoreImpl
-
-
Method Details
-
getDatastore
public dev.morphia.Datastore getDatastore()- Specified by:
getDatastorein interfaceDatastore
-
query
public dev.morphia.Datastore query() -
getMongoClient
public com.mongodb.client.MongoClient getMongoClient()- Specified by:
getMongoClientin interfaceDatastore
-
ensureIndexes
public void ensureIndexes()Description copied from interface:DatastoreEnsures (creating if necessary) the indexes found during class mapping (using @Indexed, @Indexes)- Specified by:
ensureIndexesin interfaceDatastore
-
ensureCaps
public void ensureCaps()Description copied from interface:DatastoreEnsure capped DBCollections for Entity(s)- Specified by:
ensureCapsin interfaceDatastore
-
findById
Description copied from interface:DatastoreRetrieves a mapped Morphia object from MongoDB. -
findAll
Description copied from interface:DatastoreRetrieves a list of mapped Morphia objects from MongoDB -
countAll
Description copied from interface:DatastoreCounts all objected of a mapped Morphia class -
save
Description copied from interface:DatastoreSaves a mapped Morphia object to MongoDB -
saveAsync
Description copied from interface:DatastoreSaves a mapped Morphia object to MongoDB asynchronously -
delete
Description copied from interface:DatastoreDeletes a mapped Morphia object in MongoDB -
deleteAsync
Description copied from interface:DatastoreDeletes a mapped Morphia object to MongoDB asynchronously- Specified by:
deleteAsyncin interfaceDatastore- Parameters:
object- The object to delete
-
deleteAll
Description copied from interface:DatastoreDeletes all mapped Morphia objects of a given class -
dropDatabase
public void dropDatabase()Description copied from interface:DatastoreDrops all data in MongoDB on the connected database- Specified by:
dropDatabasein interfaceDatastore
-