Prefer implementing PersistentPropertyAccessor over PersistentPropertyPathAccessor.

Fixes: #1368
Related issue: spring-projects/spring-data-commons#2813
This commit is contained in:
Oliver Drotbohm
2023-04-04 11:50:16 +02:00
parent d0a1b13751
commit 8dd3f1b94b

View File

@@ -1454,7 +1454,7 @@ public class MappingCassandraConverter extends AbstractCassandraConverter
}
}
private static class PropertyTranslatingPropertyAccessor<T> implements PersistentPropertyPathAccessor<T> {
private static class PropertyTranslatingPropertyAccessor<T> implements PersistentPropertyAccessor<T> {
private final PersistentPropertyAccessor<T> delegate;
private final PersistentPropertyTranslator propertyTranslator;
@@ -1485,23 +1485,6 @@ public class MappingCassandraConverter extends AbstractCassandraConverter
return delegate.getBean();
}
@Override
public void setProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path, Object value,
AccessOptions.SetOptions options) {
throw new UnsupportedOperationException();
}
@Override
public Object getProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path,
AccessOptions.GetOptions context) {
throw new UnsupportedOperationException();
}
@Override
public void setProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path, Object value) {
throw new UnsupportedOperationException();
}
private CassandraPersistentProperty translate(PersistentProperty<?> property) {
return propertyTranslator.translate((CassandraPersistentProperty) property);
}