@@ -0,0 +1,2882 @@
+package org.mongodb.morphia;%0A%0Aimport org.bson.types.ObjectId;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.mongodb.morphia.annotations.Embedded;%0Aimport org.mongodb.morphia.annotations.Entity;%0Aimport org.mongodb.morphia.annotations.Id;%0Aimport org.mongodb.morphia.query.UpdateOperations;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport static java.lang.String.format;%0A%0Apublic class TestArrayUpdates extends TestBase %7B%0A    @Entity%0A    public static class BatchData %7B%0A%0A        @Id%0A        private ObjectId id;%0A        @Embedded%0A        private List%3CFiles%3E files = new ArrayList%3CFiles%3E();%0A%0A        @Override%0A        public String toString() %7B%0A            return format(%22BatchData%7Bid=%25s, files=%25s%7D%22, id, files);%0A        %7D%0A    %7D%0A%0A    @Embedded%0A    public static class Files %7B%0A        private int position;%0A        private String fileName = %22%22;%0A        private String fileHash = %22%22;%0A%0A        public Files() %7B%7D%0A%0A        public Files(final int pos, final String fileName, final String fileHash) %7B%0A            this.position = pos;%0A            this.fileName = fileName;%0A            this.fileHash = fileHash;%0A        %7D%0A%0A        @Override%0A        public String toString() %7B%0A            return format(%22Files%7BfileHash='%25s', fileName='%25s', position=%25d%7D%22, fileHash, fileName, position);%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void testUpdates() %7B%0A        BatchData theBatch = new BatchData();%0A        theBatch.files.add(new Files(0, %22fileName1%22, %22fileHash1%22));%0A        theBatch.files.add(new Files(0, %22fileName2%22, %22fileHash2%22));%0A        getDs().save(theBatch);%0A        ObjectId id = theBatch.id;%0A%0A        theBatch = new BatchData();%0A        theBatch.files.add(new Files(0, %22fileName3%22, %22fileHash3%22));%0A        theBatch.files.add(new Files(0, %22fileName4%22, %22fileHash4%22));%0A        getDs().save(theBatch);%0A        ObjectId id2 = theBatch.id;%0A%0A        UpdateOperations%3CBatchData%3E updateOperations = getDs().createUpdateOperations(BatchData.class)%0A                                                              .set(%22files.$.fileHash%22, %22new hash%22);%0A%0A        getDs().update(getDs().createQuery(BatchData.class)%0A                              .filter(%22_id%22, id)%0A                              .filter(%22files.fileName%22, %22fileName1%22),%0A                       updateOperations);%0A%0A        BatchData data = getDs().createQuery(BatchData.class)%0A                                .filter(%22_id%22, id)%0A                                .get();%0A        %0A        Assert.assertEquals(%22new hash%22, data.files.get(0).fileHash);%0A        Assert.assertEquals(%22fileHash2%22, data.files.get(1).fileHash);%0A        %0A        data = getDs().createQuery(BatchData.class)%0A                                .filter(%22_id%22, id2)%0A                                .get();%0A        %0A        Assert.assertEquals(%22fileHash3%22, data.files.get(0).fileHash);%0A        Assert.assertEquals(%22fileHash4%22, data.files.get(1).fileHash);%0A    %7D%0A%7D%0A

add a test validating that array updates aren't an issue anymore resolves #619