@@ -0,0 +1,1986 @@
+package com.google.code.morphia.issue325;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport junit.framework.Assert;%0A%0Aimport org.junit.Test;%0A%0Aimport com.google.code.morphia.TestBase;%0Aimport com.google.code.morphia.annotations.Embedded;%0Aimport com.google.code.morphia.annotations.Entity;%0Aimport com.google.code.morphia.annotations.Id;%0Aimport com.google.code.morphia.annotations.PreLoad;%0Aimport com.google.code.morphia.annotations.Transient;%0Aimport com.google.code.morphia.mapping.Mapper;%0Aimport com.mongodb.DBObject;%0A%0A%0A/**%0A */%0A@SuppressWarnings(%22unused%22)%0Apublic class TestEmbeddedClassname extends TestBase %7B%0A%09%0A//%09@SuppressWarnings(%22unused%22)%0A%09@Entity(noClassnameStored = true)%0A%09private static class Root %7B%0A%09    @Id String id = %22a%22;%0A%0A%09    @Embedded%0A%09    List%3CA%3E as = new ArrayList%3CA%3E();%0A%0A%09    @Embedded%0A%09    List%3CB%3E bs = new ArrayList%3CB%3E();%0A%09%7D%0A%09%0A%09private static class A %7B%0A%09%09String name = %22undefined%22;%0A%09%09%0A%09%09@Transient DBObject raw;%0A%09%09@PreLoad%0A%09%09void preLoad(DBObject dbObj) %7B%0A%09%09%09raw = dbObj;%0A%09%09%7D%0A%09%7D%0A%09%0A%09private static class B extends A%7B%0A%09%09String description = %22%3Cdescr. here%3E%22;%0A%09%7D%0A%0A%09@Test%0A%09public final void testEmbeddedClassname() %7B%0A%09%09Root r = new Root();%0A%09%09ds.save(r);%0A%09%09%0A%09%09A a = new A();%0A%09%09ds.update(ds.createQuery(Root.class), ds.createUpdateOperations(Root.class).add(%22as%22, a));%0A%09%09r = ds.get(Root.class, %22a%22);%0A%09%09Assert.assertFalse(r.as.get(0).raw.containsField(Mapper.CLASS_NAME_FIELDNAME));%0A%0A%09%09B b = new B();%0A%09%09ds.update(ds.createQuery(Root.class), ds.createUpdateOperations(Root.class).add(%22bs%22, b));%0A%09%09r = ds.get(Root.class, %22a%22);%0A%09%09Assert.assertFalse(r.bs.get(0).raw.containsField(Mapper.CLASS_NAME_FIELDNAME));%0A%09%09%0A%09%09ds.delete(ds.createQuery(Root.class));%0A%09%09//test saving an B in as, and it should have the classname.%0A%09%09%0A%09%09ds.save(new Root());%0A%09%09b = new B();%0A%09%09ds.update(ds.createQuery(Root.class), ds.createUpdateOperations(Root.class).add(%22as%22, b));%0A%09%09r = ds.get(Root.class, %22a%22);%0A%09%09Assert.assertTrue(r.as.get(0).raw.containsField(Mapper.CLASS_NAME_FIELDNAME));%0A%09%09%0A%09%7D%0A%0A%7D%0A

update issue 325