greenlaw110/play-morphia — Issue #68: @MappedSuperclass & Fixtures.deleteAllModels()
Author: larssn
Created: 2012-02-21 19:22:30+00:00
State: open

I'm not sure if this is a problem with play-morphia or play.

I get this error when I do a Fixtures.deleteAllModels() <-- (deleteDatabase() doesnt work with Mongo apparently):

```
play.exceptions.UnexpectedException: Model models.Metric is not managed by any plugin
at play.db.Model$Manager.factoryFor(Model.java:57)
at play.test.Fixtures.delete(Fixtures.java:66)
at play.test.Fixtures.delete(Fixtures.java:86)
at play.test.Fixtures.deleteAllModels(Fixtures.java:99)
at Bootstrap.doJob(Bootstrap.java:14)
at play.jobs.Job.doJobWithResult(Job.java:50)
at play.jobs.Job.call(Job.java:146)
at Invocation.Job(Play!)
```

The Metric class looks like this:

```java
package models;

import java.util.Date;
import javax.persistence.MappedSuperclass;
import play.data.validation.Required;
import play.modules.morphia.Model;

@MappedSuperclass
public abstract class Metric extends Model {
@Required public String name;
@Required public Date timestamp = new Date(); // Date format follows ISO 8601

public String toString() {
return "(" + timestamp + ") " + name;
}
}
```

My Metric class is the base class for my concrete metric-implementations.