package play.test;

import java.util.List;

import play.Play;
import play.modules.morphia.Model;
import play.modules.morphia.MorphiaPlugin;
import play.test.Fixtures;

import com.google.code.morphia.Datastore;

public class MorphiaFixtures extends Fixtures {
    
	private static Datastore ds() {
        return MorphiaPlugin.ds();
    }
    
    public static void deleteAll() {
        Datastore ds = ds();
        for (Class<Model> clz: Play.classloader.getAssignableClasses(Model.class)) {
            ds.getCollection(clz).drop();
        }
    }
    
    public static void delete(Class<? extends Model> ... types) {
        for (Class<? extends Model> type: types) {
            ds().getCollection(type).drop();
        }
    }
    
    public static void delete(List<Class<? extends Model>> classes) {
        for (Class<? extends Model> type: classes) {
            ds().getCollection(type).drop();
        }
    }
    
    public static void deleteAllModels() {
        deleteAll();
    }
}

@@ -369,24 +369,46 @@
 leteAll() %7B%0A
+    %09idCache.clear();%0A
         Data
@@ -420,24 +420,24 @@
  ds = ds();%0A
-
         for 
@@ -630,32 +630,54 @@
 l%3E ... types) %7B%0A
+    %09idCache.clear();%0A
         for (Cla
@@ -769,32 +769,32 @@
    %7D%0A    %7D%0A    %0A
-
     public stati
@@ -839,32 +839,54 @@
 el%3E%3E classes) %7B%0A
+    %09idCache.clear();%0A
         for (Cla

Revert "reverse changes to MorhiaFixtures which is specific to 1.2.1"