DATAREST-885 - PatchOperation now evaluates SpEL expression.

Original pull request: #223.
This commit is contained in:
Mathias Düsterhöft
2016-09-06 15:24:12 +02:00
committed by Oliver Gierke
parent 3643e06b1f
commit 518cab040f
4 changed files with 47 additions and 4 deletions

View File

@@ -26,6 +26,7 @@ import org.springframework.expression.ExpressionException;
* Abstract base class representing and providing support methods for patch operations.
*
* @author Craig Walls
* @author Mathias Düsterhöft
*/
public abstract class PatchOperation {
@@ -164,7 +165,7 @@ public abstract class PatchOperation {
* otherwise.
*/
protected <T> Object evaluateValueFromTarget(Object targetObject, Class<T> entityType) {
return value instanceof LateObjectEvaluator ? ((LateObjectEvaluator) value).evaluate(entityType) : value;
return value instanceof LateObjectEvaluator ? ((LateObjectEvaluator) value).evaluate(spelExpression.getValueType(targetObject)) : value;
}
/**