Package io.foodtechlab.common.mongo.port
Class AbstractMongoSafeDeleteRepository<ID,E extends io.foodtechlab.common.domain.entities.BaseDeleteEntity<ID>,D extends BaseDeleteDocument,F extends io.foodtechlab.common.domain.port.filters.DeleteFilter>
- java.lang.Object
-
- com.rcore.database.mongo.commons.port.impl.AbstractMongoRepository<ID,E,D,F>
-
- io.foodtechlab.common.mongo.port.AbstractMongoSafeDeleteRepository<ID,E,D,F>
-
- All Implemented Interfaces:
com.rcore.domain.commons.port.CreateUpdateRepository<E>,com.rcore.domain.commons.port.CRUDRepository<ID,E,F>,com.rcore.domain.commons.port.DeleteRepository<ID>,com.rcore.domain.commons.port.ReadRepository<ID,E,F>,io.foodtechlab.common.domain.port.SafeDeleteCRUDRepository<ID,E,F>,io.foodtechlab.common.domain.port.SafeDeleteRepository<ID>,io.foodtechlab.common.domain.port.SafeReadRepository<ID,E,F>
public abstract class AbstractMongoSafeDeleteRepository<ID,E extends io.foodtechlab.common.domain.entities.BaseDeleteEntity<ID>,D extends BaseDeleteDocument,F extends io.foodtechlab.common.domain.port.filters.DeleteFilter> extends com.rcore.database.mongo.commons.port.impl.AbstractMongoRepository<ID,E,D,F> implements io.foodtechlab.common.domain.port.SafeDeleteCRUDRepository<ID,E,F>
-
-
Constructor Summary
Constructors Constructor Description AbstractMongoSafeDeleteRepository(Class<D> documentClass, com.rcore.commons.mapper.ExampleDataMapper<E,D> mapper, org.springframework.data.mongodb.core.MongoTemplate mongoTemplate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Booleandelete(ID id)Optional<E>findById(ID id)Optional<E>forceFindById(ID id)booleanpermanentDelete(ID id)booleanrestore(ID id)-
Methods inherited from class com.rcore.database.mongo.commons.port.impl.AbstractMongoRepository
count, exist, find, findSearch, getSearchQuery, save
-
-
-
-
Method Detail
-
findById
public Optional<E> findById(ID id)
- Specified by:
findByIdin interfacecom.rcore.domain.commons.port.ReadRepository<ID,E extends io.foodtechlab.common.domain.entities.BaseDeleteEntity<ID>,D extends BaseDeleteDocument>- Overrides:
findByIdin classcom.rcore.database.mongo.commons.port.impl.AbstractMongoRepository<ID,E extends io.foodtechlab.common.domain.entities.BaseDeleteEntity<ID>,D extends BaseDeleteDocument,F extends io.foodtechlab.common.domain.port.filters.DeleteFilter>
-
forceFindById
public Optional<E> forceFindById(ID id)
- Specified by:
forceFindByIdin interfaceio.foodtechlab.common.domain.port.SafeReadRepository<ID,E extends io.foodtechlab.common.domain.entities.BaseDeleteEntity<ID>,D extends BaseDeleteDocument>
-
restore
public boolean restore(ID id)
- Specified by:
restorein interfaceio.foodtechlab.common.domain.port.SafeDeleteRepository<ID>
-
delete
public Boolean delete(ID id)
- Specified by:
deletein interfacecom.rcore.domain.commons.port.DeleteRepository<ID>- Overrides:
deletein classcom.rcore.database.mongo.commons.port.impl.AbstractMongoRepository<ID,E extends io.foodtechlab.common.domain.entities.BaseDeleteEntity<ID>,D extends BaseDeleteDocument,F extends io.foodtechlab.common.domain.port.filters.DeleteFilter>
-
-