DATAGRAPH-368 Handle transient property on detached entity.
In DetachedEntityState.setValue(), check if the property to save exists on the Neo4jPersistentEntity instance. If the property is marked transient, the property won't exist on the entity. In that case, forward the request to the delegate.
This commit is contained in:
@@ -137,7 +137,11 @@ public class DetachedEntityState<STATE> implements EntityState<STATE> {
|
||||
}
|
||||
@Override
|
||||
public Object setValue(final Field field, final Object newVal, MappingPolicy mappingPolicy) {
|
||||
return setValue(property(field),newVal, mappingPolicy);
|
||||
Neo4jPersistentProperty property = property(field);
|
||||
if (property != null) {
|
||||
return setValue(property, newVal, mappingPolicy);
|
||||
}
|
||||
return delegate.setValue(property, newVal, mappingPolicy);
|
||||
}
|
||||
|
||||
private Neo4jPersistentProperty property(Field field) {
|
||||
|
||||
Reference in New Issue
Block a user