mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-08 13:12:10 +00:00
Fix adaption to PersistentProperty change.
This commit is contained in:
parent
1a24c3c989
commit
b99ca1816a
@ -403,7 +403,8 @@ public class MappingElasticsearchConverter
|
||||
|
||||
for (ElasticsearchPersistentProperty property : entity) {
|
||||
|
||||
if (entity.isCreatorArgument(property) || !property.isReadable() || property.isIndexedIndexNameProperty()) {
|
||||
if (entity.isCreatorArgument(property) || !property.isReadable() || property.isSeqNoPrimaryTermProperty()
|
||||
|| property.isIndexedIndexNameProperty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -4522,6 +4522,14 @@ public abstract class ElasticsearchIntegrationTests {
|
||||
this.seqNoPrimaryTerm = seqNoPrimaryTerm;
|
||||
}
|
||||
|
||||
public ImmutableEntity withId(@Nullable String id) {
|
||||
return new ImmutableEntity(id, this.text, this.seqNoPrimaryTerm);
|
||||
}
|
||||
|
||||
public ImmutableEntity withSeqNoPrimaryTerm(@Nullable SeqNoPrimaryTerm seqNoPrimaryTerm) {
|
||||
return new ImmutableEntity(this.id, this.text, seqNoPrimaryTerm);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getId() {
|
||||
return id;
|
||||
|
@ -18,10 +18,8 @@ package org.springframework.data.elasticsearch.core;
|
||||
import static java.util.Collections.*;
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldType.*;
|
||||
import static org.springframework.data.elasticsearch.core.query.StringQuery.MATCH_ALL;
|
||||
import static org.springframework.data.elasticsearch.core.query.StringQuery.*;
|
||||
|
||||
import org.assertj.core.api.InstanceOfAssertFactories;
|
||||
import org.springframework.data.elasticsearch.BulkFailureException;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.StepVerifier;
|
||||
@ -45,6 +43,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import org.assertj.core.api.InstanceOfAssertFactories;
|
||||
import org.json.JSONException;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
@ -60,6 +59,7 @@ import org.springframework.data.annotation.Version;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.elasticsearch.BulkFailureException;
|
||||
import org.springframework.data.elasticsearch.RestStatusException;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
import org.springframework.data.elasticsearch.annotations.Field;
|
||||
@ -1509,6 +1509,14 @@ public abstract class ReactiveElasticsearchIntegrationTests {
|
||||
this.seqNoPrimaryTerm = seqNoPrimaryTerm;
|
||||
}
|
||||
|
||||
public ImmutableEntity withId(@Nullable String id) {
|
||||
return new ImmutableEntity(id, this.text, this.seqNoPrimaryTerm);
|
||||
}
|
||||
|
||||
public ImmutableEntity withSeqNoPrimaryTerm(@Nullable SeqNoPrimaryTerm seqNoPrimaryTerm) {
|
||||
return new ImmutableEntity(this.id, this.text, seqNoPrimaryTerm);
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -185,14 +185,6 @@ public class SimpleElasticsearchPersistentPropertyUnitTests {
|
||||
assertThat(seqNoProperty.isWritable()).isFalse();
|
||||
}
|
||||
|
||||
@Test // DATAES-799
|
||||
void seqNoPrimaryTermPropertyShouldNotBeReadable() {
|
||||
SimpleElasticsearchPersistentEntity<?> entity = context.getRequiredPersistentEntity(SeqNoPrimaryTermProperty.class);
|
||||
ElasticsearchPersistentProperty seqNoProperty = entity.getRequiredPersistentProperty("seqNoPrimaryTerm");
|
||||
|
||||
assertThat(seqNoProperty.isReadable()).isFalse();
|
||||
}
|
||||
|
||||
@Test // DATAES-924
|
||||
@DisplayName("should require pattern for custom date format")
|
||||
void shouldRequirePatternForCustomDateFormat() {
|
||||
|
@ -30,6 +30,7 @@ import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates;
|
||||
import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest;
|
||||
import org.springframework.data.elasticsearch.utils.IndexNameProvider;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* @author Young Gu
|
||||
@ -90,6 +91,10 @@ public abstract class ImmutableRepositoryIntegrationTests {
|
||||
this(null, name);
|
||||
}
|
||||
|
||||
public ImmutableEntity withId(@Nullable String id) {
|
||||
return new ImmutableEntity(id, this.name);
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user