模型文件如下所示:
@Entity
public class Person {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
public String id;
public String name;
}
使用的数据库是postgres,在应用迁移时会出现此错误:
[error] o.h.t.h.SchemaUpdate - HHH000388: Unsuccessful: alter table Person add column _ebean_intercept binary(255)
[error] o.h.t.h.SchemaUpdate - ERROR: type "binary" does not exist
在控制器级别给出这些错误:
1) Error injecting constructor, java.lang.NoClassDefFoundError: com/avaje/ebean/bean/EntityBean
at play.db.jpa.DefaultJPAApi$JPAApiProvider.<init>(DefaultJPAApi.java:39)
at play.db.jpa.DefaultJPAApi$JPAApiProvider.class(DefaultJPAApi.java:34)
while locating play.db.jpa.DefaultJPAApi$JPAApiProvider
while locating play.db.jpa.JPAApi
for parameter 0 at play.db.jpa.TransactionalAction.<init>(TransactionalAction.java:20)
while locating play.db.jpa.TransactionalAction
我的控制器看起来像:
public class Application extends Controller {
@Transactional
public Result addPerson() {
Person person = Form.form(Person.class).bindFromRequest().get();
JPA.em().persist(person);
return redirect(routes.Application.index());
}
.....
可能导致此问题的是什么,“_ebean_intercept”列的概念是什么?如果需要更多信息,请告诉我。