Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play Framework: PersistenceException: The type is not a registered entity? (Ebean)

I'm following the Play Framework 2.0 tutorial for Java and get this error when trying to save an ebean Model (task.save()).

[PersistenceException: The type [class models.Task] is not a registered entity? If you don't explicitly list the entity classes to use Ebean will search for them in the classpath. If the entity is in a Jar check the ebean.search.jars property in ebean.properties file or check ServerConfig.addJar().]

like image 864
Rob Fox Avatar asked Mar 22 '12 14:03

Rob Fox


1 Answers

Check these 3 points :

  • Your model is annotated with @Entity (javax.persistence.Entity)
  • Your model extends Model (play.db.ebean.Model)
  • Ebean is enable in your application.conf ebean.default="models.*" (if your classes are in the models package)
like image 162
Julien Lafont Avatar answered Sep 20 '22 13:09

Julien Lafont