/** * Delete an instance that match the provided id * * @param id The instance that matches the provided id will be deleted in the database */ @Override public D delete(final I id) { Preconditions.checkNotNull(id, "The provided id cannot be null"); LOGGER.debug("Start the deletion of " + entityClass.getSimpleName() + " with id " + id); T type = mongoOperations.findAndRemove(getIdQuery(id), entityClass); LOGGER.debug("Deletion of " + entityClass.getSimpleName() + " with id " + id + " was successfully completed"); return mapper.map(type, dtoClass); }
/** * The method finds and deletes the oldest event. * * @return The event that was deleted. */ @Override public RestEvent deleteOldestEvent() { RestEventDocument oldestEvent = mongoOperations.findAndRemove(getOldestStartDateQuery(), RestEventDocument.class); return oldestEvent == null ? null : mapper.map(oldestEvent, RestEvent.class); }
/** * The method finds and deletes the oldest event. * * @return The event that was deleted. */ @Override public SoapEvent deleteOldestEvent() { SoapEventDocument oldestEvent = mongoOperations.findAndRemove(getOldestStartDateQuery(), SoapEventDocument.class); return oldestEvent == null ? null : mapper.map(oldestEvent, SoapEvent.class); }
/** * The method finds and deletes the oldest event. * * @return The event that was deleted. */ @Override public synchronized GraphQLEvent deleteOldestEvent() { GraphQLEventDocument oldestEvent = mongoOperations.findAndRemove(getOldestStartDateQuery(), GraphQLEventDocument.class); return oldestEvent == null ? null : mapper.map(oldestEvent, GraphQLEvent.class); }
@Override public OneTimeAccessToken findAndRemove(String id) { Query query = Query.query(Criteria.where("id").is(id)); return mongoOperations.findAndRemove(query, OneTimeAccessToken.class); }
@Override public OneTimeAccessToken findAndRemove(String id) { Query query = Query.query(Criteria.where("id").is(id)); return mongoOperations.findAndRemove(query, OneTimeAccessToken.class); }
@Override public OneTimeAccessToken findAndRemove(String id) { Query query = Query.query(Criteria.where("id").is(id)); return mongoOperations.findAndRemove(query, OneTimeAccessToken.class); }