@@ -0,0 +1,1441 @@
+package com.google.code.morphia.mapping;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.bson.types.ObjectId;%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0A%0Aimport com.google.code.morphia.Datastore;%0Aimport com.google.code.morphia.Morphia;%0Aimport com.google.code.morphia.TestBase;%0Aimport com.google.code.morphia.annotations.Id;%0Aimport com.google.code.morphia.mapping.UpdateRetainsClassInfoTest.X.E1;%0Aimport com.google.code.morphia.mapping.UpdateRetainsClassInfoTest.X.E2;%0Aimport com.google.code.morphia.query.Query;%0Aimport com.google.code.morphia.query.UpdateOperations;%0Aimport com.mongodb.DB;%0Aimport com.mongodb.Mongo;%0A%0Apublic class UpdateRetainsClassInfoTest extends TestBase %7B%0A%09public static class X %7B%0A%09%09public static abstract class E %7B%0A%09%09%09@Id%0A%09%09%09ObjectId id;%0A%09%09%7D%0A%0A%09%09public static class E1 extends E %7B%0A%09%09%09String foo;%0A%09%09%7D%0A%0A%09%09public static class E2 extends E %7B%0A%09%09%09String bar;%0A%09%09%7D%0A%0A%09%09Map%3CString, E%3E map = new HashMap%3CString, E%3E();%0A%0A%09%7D%0A%0A%09@Test %0A%09@Ignore //FIXME%0A%09public void retainsClassName() %7B%0A%09%09X x = new X();%0A%0A%09%09E1 e1 = new E1();%0A%09%09e1.foo = %22narf%22;%0A%09%09x.map.put(%22k1%22, e1);%0A%0A%09%09E2 e2 = new E2();%0A%09%09e2.bar = %22narf%22;%0A%09%09x.map.put(%22k2%22, e2);%0A%0A%09%09ds.save(x);%0A%0A%09%09Query%3CX%3E state_query = ds.createQuery(X.class);%0A%09%09UpdateOperations%3CX%3E state_update = ds%0A%09%09%09%09.createUpdateOperations(X.class);%0A%09%09state_update.set(%22map.k2%22, e2);%0A%0A%09%09ds.update(state_query, state_update);%0A%0A%09%09// fails due to type now missing%0A%09%09x = ds.find(X.class).get();%0A%09%7D%0A%7D

Test (currently ignored) for issue 120