Skip to content

Commit 5f48ee5

Browse files
committed
Prefer implementing PersistentPropertyAccessor over PersistentPropertyPathAccessor.
In preparation of spring-projects/spring-data-commons#2813 we're moving off the implementation of PersistentPropertyPathAccessor and rather only implement PersistenPropertyAccessor. Fixes #4354.
1 parent 5733a00 commit 5f48ee5

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MappingMongoConverter.java

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,7 +2443,7 @@ public ConversionContext withPath(ObjectPath currentPath) {
24432443
}
24442444
}
24452445

2446-
private static class PropertyTranslatingPropertyAccessor<T> implements PersistentPropertyPathAccessor<T> {
2446+
private static class PropertyTranslatingPropertyAccessor<T> implements PersistentPropertyAccessor<T> {
24472447

24482448
private final PersistentPropertyAccessor<T> delegate;
24492449
private final PersistentPropertyTranslator propertyTranslator;
@@ -2460,7 +2460,7 @@ static <T> PersistentPropertyAccessor<T> create(PersistentPropertyAccessor<T> de
24602460
}
24612461

24622462
@Override
2463-
public void setProperty(PersistentProperty property, @Nullable Object value) {
2463+
public void setProperty(PersistentProperty<?> property, @Nullable Object value) {
24642464
delegate.setProperty(translate(property), value);
24652465
}
24662466

@@ -2474,23 +2474,6 @@ public T getBean() {
24742474
return delegate.getBean();
24752475
}
24762476

2477-
@Override
2478-
public void setProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path, Object value,
2479-
AccessOptions.SetOptions options) {
2480-
throw new UnsupportedOperationException();
2481-
}
2482-
2483-
@Override
2484-
public Object getProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path,
2485-
AccessOptions.GetOptions context) {
2486-
throw new UnsupportedOperationException();
2487-
}
2488-
2489-
@Override
2490-
public void setProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path, Object value) {
2491-
throw new UnsupportedOperationException();
2492-
}
2493-
24942477
private MongoPersistentProperty translate(PersistentProperty<?> property) {
24952478
return propertyTranslator.translate((MongoPersistentProperty) property);
24962479
}

0 commit comments

Comments
 (0)