From 0aacc6d4d3112e57a621b73e8f743b78182e59be Mon Sep 17 00:00:00 2001 From: Jon Brisbin Date: Tue, 27 Nov 2012 10:24:01 -0600 Subject: [PATCH] Fix for #47 --- .../data/rest/webmvc/RepositoryRestController.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestController.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestController.java index 584580fbe..ea96e4782 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestController.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestController.java @@ -875,9 +875,10 @@ public class RepositoryRestController if(null != (entity = repo.findOne(serId))) { // Updating an existing resource isUpdate = true; - for(AttributeMetadata attrMeta : (Collection)repoMeta.entityMetadata() - .embeddedAttributes() - .values()) { + List attrs = new ArrayList(); + attrs.addAll(repoMeta.entityMetadata().embeddedAttributes().values()); + attrs.addAll(repoMeta.entityMetadata().linkedAttributes().values()); + for(AttributeMetadata attrMeta : attrs) { Object incomingVal; if(null != (incomingVal = attrMeta.get(incoming))) { attrMeta.set(incomingVal, entity);