public interface BaseMongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>> extends MongoRepository<T>, BaseMongoComponent
| Modifier and Type | Method and Description |
|---|---|
default org.mongodb.morphia.query.Query<T> |
asQuery() |
default org.mongodb.morphia.query.Query<T> |
asQuery(java.time.Instant createdUtc) |
default org.mongodb.morphia.query.Query<T> |
asQuery(org.bson.types.ObjectId id) |
default java.util.Optional<org.mongodb.morphia.query.Query<T>> |
asQueryForIdOrTime(java.lang.String idOrTime) |
default org.mongodb.morphia.query.UpdateOperations<T> |
createUpdateOperations() |
default java.util.concurrent.CompletableFuture<java.lang.Boolean> |
delete(org.mongodb.morphia.query.Query<T> query) |
default java.util.concurrent.CompletableFuture<java.lang.Boolean> |
deleteOne(java.time.Instant createdUtc)
Attempts to delete the first
document where
Instant.getEpochSecond() retrieved from
ObjectWithId.getCreatedUtc() is equal to
Instant.getEpochSecond() of the provided
Instant |
default java.util.concurrent.CompletableFuture<java.lang.Boolean> |
deleteOne(org.bson.types.ObjectId id)
Attempts to delete a matching
document with
the provided id |
default java.util.concurrent.CompletableFuture<java.util.List<T>> |
getAll() |
default java.util.concurrent.CompletableFuture<java.util.List<T>> |
getAll(org.mongodb.morphia.query.Query<T> query) |
default java.util.concurrent.CompletableFuture<java.util.List<org.bson.types.ObjectId>> |
getAllIds() |
default java.util.concurrent.CompletableFuture<java.util.Optional<java.time.Instant>> |
getCreatedUtc(org.bson.types.ObjectId id) |
default java.util.concurrent.CompletableFuture<java.util.Optional<T>> |
getOne(java.time.Instant createdUtc)
Attempts to find the first
document where
Instant.getEpochSecond() retrieved from
ObjectWithId.getCreatedUtc() is equal to
Instant.getEpochSecond() of the provided
Instant |
default java.util.concurrent.CompletableFuture<java.util.Optional<T>> |
getOne(org.bson.types.ObjectId id)
Attempts to find a matching
document with
the provided id |
default java.util.concurrent.CompletableFuture<java.util.Optional<T>> |
getOne(org.mongodb.morphia.query.Query<T> query) |
default org.mongodb.morphia.query.UpdateOperations<T> |
inc(java.lang.String field) |
default org.mongodb.morphia.query.UpdateOperations<T> |
inc(java.lang.String field,
java.lang.Number value) |
default java.util.concurrent.CompletableFuture<java.util.List<T>> |
insert(java.util.List<T> list) |
default java.util.concurrent.CompletableFuture<java.util.Optional<T>> |
insertOne(T item) |
default org.mongodb.morphia.query.UpdateOperations<T> |
set(java.lang.String field,
java.lang.Object value) |
default org.mongodb.morphia.query.UpdateOperations<T> |
unSet(java.lang.String field) |
default java.util.concurrent.CompletableFuture<java.lang.Boolean> |
update(java.util.Optional<org.mongodb.morphia.query.Query<T>> optionalQuery,
org.mongodb.morphia.query.UpdateOperations<T> updateOperations) |
default java.util.concurrent.CompletableFuture<java.lang.Boolean> |
update(org.mongodb.morphia.query.Query<T> query,
org.mongodb.morphia.query.UpdateOperations<T> updateOperations) |
generateEmpty, getTClass, parseAndDeleteOne, parseAndGetOnegetDataStoreContext, getTKeyClass, parse, parseUnsafeparseUnsafedefault java.util.concurrent.CompletableFuture<java.util.Optional<java.time.Instant>> getCreatedUtc(org.bson.types.ObjectId id)
getCreatedUtc in interface Repository<org.bson.types.ObjectId,T extends ObjectWithId<org.bson.types.ObjectId>,org.mongodb.morphia.Datastore>id - The id of the documentInstantdefault java.util.concurrent.CompletableFuture<java.util.Optional<T>> insertOne(T item)
insertOne in interface StorageService<org.bson.types.ObjectId,T extends ObjectWithId<org.bson.types.ObjectId>,org.mongodb.morphia.Datastore>item - document to insertOptional containing the inserted document
if successful, otherwise Optional.empty()default java.util.concurrent.CompletableFuture<java.util.List<T>> insert(java.util.List<T> list)
insert in interface StorageService<org.bson.types.ObjectId,T extends ObjectWithId<org.bson.types.ObjectId>,org.mongodb.morphia.Datastore>list - List of documents to insertList of all documents that were successfully inserteddefault java.util.concurrent.CompletableFuture<java.util.Optional<T>> getOne(org.mongodb.morphia.query.Query<T> query)
getOne in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>default java.util.concurrent.CompletableFuture<java.util.Optional<T>> getOne(org.bson.types.ObjectId id)
StorageServicedocument with
the provided idgetOne in interface StorageService<org.bson.types.ObjectId,T extends ObjectWithId<org.bson.types.ObjectId>,org.mongodb.morphia.Datastore>id - TKey to query repository withOptional containing a matching document
if successful, otherwise Optional.empty()default java.util.concurrent.CompletableFuture<java.util.Optional<T>> getOne(java.time.Instant createdUtc)
StorageServicedocument where
Instant.getEpochSecond() retrieved from
ObjectWithId.getCreatedUtc() is equal to
Instant.getEpochSecond() of the provided
InstantgetOne in interface StorageService<org.bson.types.ObjectId,T extends ObjectWithId<org.bson.types.ObjectId>,org.mongodb.morphia.Datastore>createdUtc - Instant to query repository withOptional containing if successful,
otherwise Optional.empty()default java.util.concurrent.CompletableFuture<java.util.List<org.bson.types.ObjectId>> getAllIds()
getAllIds in interface StorageService<org.bson.types.ObjectId,T extends ObjectWithId<org.bson.types.ObjectId>,org.mongodb.morphia.Datastore>List of all ids in the repositorydefault java.util.concurrent.CompletableFuture<java.lang.Boolean> delete(org.mongodb.morphia.query.Query<T> query)
delete in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>default java.util.concurrent.CompletableFuture<java.lang.Boolean> deleteOne(org.bson.types.ObjectId id)
StorageServicedocument with
the provided iddeleteOne in interface StorageService<org.bson.types.ObjectId,T extends ObjectWithId<org.bson.types.ObjectId>,org.mongodb.morphia.Datastore>id - TKey to query repository withdefault java.util.concurrent.CompletableFuture<java.lang.Boolean> deleteOne(java.time.Instant createdUtc)
StorageServicedocument where
Instant.getEpochSecond() retrieved from
ObjectWithId.getCreatedUtc() is equal to
Instant.getEpochSecond() of the provided
InstantdeleteOne in interface StorageService<org.bson.types.ObjectId,T extends ObjectWithId<org.bson.types.ObjectId>,org.mongodb.morphia.Datastore>createdUtc - Instant to query repository withdocument was found and deleteddefault org.mongodb.morphia.query.UpdateOperations<T> createUpdateOperations()
createUpdateOperations in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>default org.mongodb.morphia.query.UpdateOperations<T> inc(java.lang.String field, java.lang.Number value)
inc in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>default org.mongodb.morphia.query.UpdateOperations<T> inc(java.lang.String field)
inc in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>default org.mongodb.morphia.query.UpdateOperations<T> set(java.lang.String field, java.lang.Object value)
set in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>default org.mongodb.morphia.query.UpdateOperations<T> unSet(java.lang.String field)
unSet in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>default java.util.concurrent.CompletableFuture<java.lang.Boolean> update(org.mongodb.morphia.query.Query<T> query, org.mongodb.morphia.query.UpdateOperations<T> updateOperations)
update in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>default java.util.concurrent.CompletableFuture<java.lang.Boolean> update(java.util.Optional<org.mongodb.morphia.query.Query<T>> optionalQuery, org.mongodb.morphia.query.UpdateOperations<T> updateOperations)
update in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>default java.util.concurrent.CompletableFuture<java.util.List<T>> getAll()
getAll in interface StorageService<org.bson.types.ObjectId,T extends ObjectWithId<org.bson.types.ObjectId>,org.mongodb.morphia.Datastore>List of all documents in the repositorydefault java.util.concurrent.CompletableFuture<java.util.List<T>> getAll(org.mongodb.morphia.query.Query<T> query)
getAll in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>default org.mongodb.morphia.query.Query<T> asQuery()
asQuery in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>default org.mongodb.morphia.query.Query<T> asQuery(org.bson.types.ObjectId id)
asQuery in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>default org.mongodb.morphia.query.Query<T> asQuery(java.time.Instant createdUtc)
asQuery in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>default java.util.Optional<org.mongodb.morphia.query.Query<T>> asQueryForIdOrTime(java.lang.String idOrTime)
asQueryForIdOrTime in interface MongoRepository<T extends ObjectWithId<org.bson.types.ObjectId>>