mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-29 15:22:11 +00:00
Remove deprecated methods.
Original Pull Request #3067 Closes #3066 Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
This commit is contained in:
parent
8b43af2d33
commit
fa979249fc
@ -20,3 +20,11 @@ Some classes that probably are not used by a library user have been renamed, the
|
|||||||
|===
|
|===
|
||||||
|
|
||||||
=== Removals
|
=== Removals
|
||||||
|
|
||||||
|
The following methods that had been deprecated since release 5.3 have been removed:
|
||||||
|
```
|
||||||
|
DocumentOperations.delete(Query, Class<?>)
|
||||||
|
DocumentOperations.delete(Query, Class<?>, IndexCoordinates)
|
||||||
|
ReactiveDocumentOperations.delete(Query, Class<?>)
|
||||||
|
ReactiveDocumentOperations.delete(Query, Class<?>, IndexCoordinates)
|
||||||
|
```
|
||||||
|
@ -181,19 +181,6 @@ public class ElasticsearchTemplate extends AbstractElasticsearchTemplate {
|
|||||||
return delete(query, clazz, getIndexCoordinatesFor(clazz));
|
return delete(query, clazz, getIndexCoordinatesFor(clazz));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ByQueryResponse delete(Query query, Class<?> clazz, IndexCoordinates index) {
|
|
||||||
|
|
||||||
Assert.notNull(query, "query must not be null");
|
|
||||||
|
|
||||||
DeleteByQueryRequest request = requestConverter.documentDeleteByQueryRequest(query, routingResolver.getRouting(),
|
|
||||||
clazz, index, getRefreshPolicy());
|
|
||||||
|
|
||||||
DeleteByQueryResponse response = execute(client -> client.deleteByQuery(request));
|
|
||||||
|
|
||||||
return responseConverter.byQueryResponse(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ByQueryResponse delete(DeleteQuery query, Class<?> clazz, IndexCoordinates index) {
|
public ByQueryResponse delete(DeleteQuery query, Class<?> clazz, IndexCoordinates index) {
|
||||||
Assert.notNull(query, "query must not be null");
|
Assert.notNull(query, "query must not be null");
|
||||||
|
@ -167,16 +167,6 @@ public class ReactiveElasticsearchTemplate extends AbstractReactiveElasticsearch
|
|||||||
.onErrorReturn(NoSuchIndexException.class, false);
|
.onErrorReturn(NoSuchIndexException.class, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Mono<ByQueryResponse> delete(Query query, Class<?> entityType, IndexCoordinates index) {
|
|
||||||
|
|
||||||
Assert.notNull(query, "query must not be null");
|
|
||||||
|
|
||||||
DeleteByQueryRequest request = requestConverter.documentDeleteByQueryRequest(query, routingResolver.getRouting(),
|
|
||||||
entityType, index, getRefreshPolicy());
|
|
||||||
return Mono.from(execute(client -> client.deleteByQuery(request))).map(responseConverter::byQueryResponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mono<ByQueryResponse> delete(DeleteQuery query, Class<?> entityType, IndexCoordinates index) {
|
public Mono<ByQueryResponse> delete(DeleteQuery query, Class<?> entityType, IndexCoordinates index) {
|
||||||
Assert.notNull(query, "query must not be null");
|
Assert.notNull(query, "query must not be null");
|
||||||
|
@ -298,12 +298,6 @@ public abstract class AbstractElasticsearchTemplate implements ElasticsearchOper
|
|||||||
return this.delete(id, getIndexCoordinatesFor(entityType));
|
return this.delete(id, getIndexCoordinatesFor(entityType));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@Deprecated
|
|
||||||
public ByQueryResponse delete(Query query, Class<?> clazz) {
|
|
||||||
return delete(query, clazz, getIndexCoordinatesFor(clazz));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String delete(Object entity) {
|
public String delete(Object entity) {
|
||||||
return delete(entity, getIndexCoordinatesFor(entity.getClass()));
|
return delete(entity, getIndexCoordinatesFor(entity.getClass()));
|
||||||
|
@ -408,12 +408,6 @@ abstract public class AbstractReactiveElasticsearchTemplate
|
|||||||
|
|
||||||
abstract protected Mono<String> doDeleteById(String id, @Nullable String routing, IndexCoordinates index);
|
abstract protected Mono<String> doDeleteById(String id, @Nullable String routing, IndexCoordinates index);
|
||||||
|
|
||||||
@Override
|
|
||||||
@Deprecated
|
|
||||||
public Mono<ByQueryResponse> delete(Query query, Class<?> entityType) {
|
|
||||||
return delete(query, entityType, getIndexCoordinatesFor(entityType));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mono<ByQueryResponse> delete(DeleteQuery query, Class<?> entityType) {
|
public Mono<ByQueryResponse> delete(DeleteQuery query, Class<?> entityType) {
|
||||||
return delete(query, entityType, getIndexCoordinatesFor(entityType));
|
return delete(query, entityType, getIndexCoordinatesFor(entityType));
|
||||||
|
@ -272,19 +272,6 @@ public interface DocumentOperations {
|
|||||||
*/
|
*/
|
||||||
String delete(Object entity, IndexCoordinates index);
|
String delete(Object entity, IndexCoordinates index);
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete all records matching the query.
|
|
||||||
*
|
|
||||||
* @param query query defining the objects
|
|
||||||
* @param clazz The entity class, must be annotated with
|
|
||||||
* {@link org.springframework.data.elasticsearch.annotations.Document}
|
|
||||||
* @return response with detailed information
|
|
||||||
* @since 4.1
|
|
||||||
* @deprecated since 5.3.0, use {@link #delete(DeleteQuery, Class)}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
ByQueryResponse delete(Query query, Class<?> clazz);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete all records matching the query.
|
* Delete all records matching the query.
|
||||||
*
|
*
|
||||||
@ -296,19 +283,6 @@ public interface DocumentOperations {
|
|||||||
*/
|
*/
|
||||||
ByQueryResponse delete(DeleteQuery query, Class<?> clazz);
|
ByQueryResponse delete(DeleteQuery query, Class<?> clazz);
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete all records matching the query.
|
|
||||||
*
|
|
||||||
* @param query query defining the objects
|
|
||||||
* @param clazz The entity class, must be annotated with
|
|
||||||
* {@link org.springframework.data.elasticsearch.annotations.Document}
|
|
||||||
* @param index the index from which to delete
|
|
||||||
* @return response with detailed information
|
|
||||||
* @deprecated since 5.3.0, use {@link #delete(DeleteQuery, Class, IndexCoordinates)}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
ByQueryResponse delete(Query query, Class<?> clazz, IndexCoordinates index);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete all records matching the query.
|
* Delete all records matching the query.
|
||||||
*
|
*
|
||||||
|
@ -326,17 +326,6 @@ public interface ReactiveDocumentOperations {
|
|||||||
*/
|
*/
|
||||||
Mono<String> delete(String id, Class<?> entityType);
|
Mono<String> delete(String id, Class<?> entityType);
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete the documents matching the given {@link Query} extracting index from entity metadata.
|
|
||||||
*
|
|
||||||
* @param query must not be {@literal null}.
|
|
||||||
* @param entityType must not be {@literal null}.
|
|
||||||
* @return a {@link Mono} emitting the number of the removed documents.
|
|
||||||
* @deprecated since 5.3.0, use {@link #delete(DeleteQuery, Class)}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
Mono<ByQueryResponse> delete(Query query, Class<?> entityType);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the documents matching the given {@link Query} extracting index from entity metadata.
|
* Delete the documents matching the given {@link Query} extracting index from entity metadata.
|
||||||
*
|
*
|
||||||
@ -347,18 +336,6 @@ public interface ReactiveDocumentOperations {
|
|||||||
*/
|
*/
|
||||||
Mono<ByQueryResponse> delete(DeleteQuery query, Class<?> entityType);
|
Mono<ByQueryResponse> delete(DeleteQuery query, Class<?> entityType);
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete the documents matching the given {@link Query} extracting index from entity metadata.
|
|
||||||
*
|
|
||||||
* @param query must not be {@literal null}.
|
|
||||||
* @param entityType must not be {@literal null}.
|
|
||||||
* @param index the target index, must not be {@literal null}
|
|
||||||
* @return a {@link Mono} emitting the number of the removed documents.
|
|
||||||
* @deprecated since 5.3.0, use {@link #delete(DeleteQuery, Class, IndexCoordinates)}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
Mono<ByQueryResponse> delete(Query query, Class<?> entityType, IndexCoordinates index);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the documents matching the given {@link Query} extracting index from entity metadata.
|
* Delete the documents matching the given {@link Query} extracting index from entity metadata.
|
||||||
*
|
*
|
||||||
|
@ -384,7 +384,7 @@ public class SimpleElasticsearchRepository<T, ID> implements ElasticsearchReposi
|
|||||||
public void deleteAll() {
|
public void deleteAll() {
|
||||||
|
|
||||||
executeAndRefresh((OperationsCallback<Void>) operations -> {
|
executeAndRefresh((OperationsCallback<Void>) operations -> {
|
||||||
operations.delete(Query.findAll(), entityClass, getIndexCoordinates());
|
operations.delete(DeleteQuery.builder(Query.findAll()).build(), entityClass, getIndexCoordinates());
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user