Im using JPa API's and its work well ,I have tried to add new member/column to the class(table) and when I was tried to add data for it works fine but in the commit part I get dump with the following error
我正在使用JPa API和它的工作,我试图添加新的成员/列到类(表),当我尝试添加数据为它工作正常但在提交部分我得到转储与以下错误
Exception in thread "main" javax.persistence.RollbackException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLSyntaxErrorException: 'DOUBLE1' is not a column in table or VTI 'TEST.PERSON'. Error Code: 20000 Call: INSERT INTO PERSON (ID, DOUBLE1, FIRSTNAME, LASTNAME, NONSENSEFIELD) VALUES (?, ?, ?, ?, ?) bind => [5 parameters bound]
线程“main”中的异常javax.persistence.RollbackException:Exception [EclipseLink-4002](Eclipse Persistence Services - 2.4.1.v20121003-ad44345):org.eclipse.persistence.exceptions.DatabaseException内部异常:java.sql.SQLSyntaxErrorException: 'DOUBLE1'不是表中的列或VTI'TEST.PERSON'。错误代码:20000调用:INSERT INTO PERSON(ID,DOUBLE1,FIRSTNAME,LASTNAME,NONSENSEFIELD)VALUES(?,?,?,?,?)bind => [5个参数绑定]
But in the table person I have added the member double1 as follows
但在表格中我已经添加了成员double1,如下所示
@Entity
public class Person {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private String id;
private String firstName;
private String lastName;
private double double1;
....
public double getDouble1() {
return double1;
}
public void setDouble1(double double1) {
this.double1 = double1;
}
What am i missing here?
我在这里缺少什么?
1 个解决方案
#1
3
There is obviously no column DOUBLE1 in the database table VTI 'TEST.PERSON'. Adding a new field to a JPA entity does not automatically make it appear in the database as well.
显然,数据库表VTI'TEST.PERSON'中没有列DOUBLE1。向JPA实体添加新字段也不会自动使其出现在数据库中。
#1
3
There is obviously no column DOUBLE1 in the database table VTI 'TEST.PERSON'. Adding a new field to a JPA entity does not automatically make it appear in the database as well.
显然,数据库表VTI'TEST.PERSON'中没有列DOUBLE1。向JPA实体添加新字段也不会自动使其出现在数据库中。