DATAREST-1260 - Tweaked DomainObjectReader to support immutable entities.
DomainObjectReader now aborts the recursive merges in case it encounters an entity that's described as @Immutable (just introduced in Spring Data Commons). Fixed some generics and removed DomainObjectMerger as it's unused. Related ticket: DATACMNS-1322.
This commit is contained in:
@@ -23,6 +23,7 @@ import static org.mockito.Mockito.*;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Value;
|
||||
@@ -51,6 +52,7 @@ import org.mockito.Mock;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.annotation.Immutable;
|
||||
import org.springframework.data.annotation.ReadOnlyProperty;
|
||||
import org.springframework.data.annotation.Reference;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
@@ -734,11 +736,13 @@ public class DomainObjectReaderUnitTests {
|
||||
List<SampleEnum> enums = new ArrayList<SampleEnum>();
|
||||
}
|
||||
|
||||
@Value
|
||||
@EqualsAndHashCode
|
||||
@AllArgsConstructor
|
||||
static class SampleWithReference {
|
||||
@Reference List<Nested> nested;
|
||||
private @Getter @Reference List<Nested> nested;
|
||||
}
|
||||
|
||||
@Immutable
|
||||
@Value
|
||||
static class Nested {
|
||||
int x, y;
|
||||
|
||||
Reference in New Issue
Block a user