On play-java-intro template, it throws PersistenceException: org.hibernate.exception.SQLGrammarException: could not prepare statement
because PERSON
table not found.
The exception:
- org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Table "PERSON" not found; SQL statement:
This is the default Person model class from play-intro-java template (Play Framework 2.4):
package models;
import javax.persistence.*;
@Entity
public class Person {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
public int id;
public String name;
}
Play should ran the Database Evolution first, so the PERSON
table will be created first. Added libraryDependencies += evolutions
line in build.sbt per instruction but no luck. Haven't had this problem in Play 2.3.9.
Play 2.4 uses JPA for model/persistence, where Play 2.3 and previous versions uses Ebean ORM.