Ore*_*est 5 java spring spring-data-rest
I have my entity with few fields and one of them with @Transient annotation.
class Entity {
private String id;
...
@Transient
private String field;
}
Run Code Online (Sandbox Code Playgroud)
And I have next problem with validation. When I try to rejectValue for that field I'm getting next exception: org.springframework.beans.NotReadablePropertyException: Invalid property 'field' of bean class [com.test.Entity]: Bean property 'field' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
I've found a place where exception is thrown org.springframework.data.rest.core.ValidationErrors
we have there two lines:
PersistentProperty<?> property = entity.getPersistentProperty(PropertyAccessorUtils.getPropertyName(segment));
if (property == null) {
throw new NotReadablePropertyException(source.getClass(), propertyName);
}
Run Code Online (Sandbox Code Playgroud)
So it's possible to rejectValue only for persistent properties?
Any ideas how to overcome it?
| 归档时间: |
|
| 查看次数: |
845 次 |
| 最近记录: |