java identifier expected,java – hibernate h2 embeddable list expected“identifier”
我試圖將一個功能列表(Embeddable)關聯到我的Employee Entity中,而H2似乎對這個說它期望一個“標識符”不滿意
Caused by: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement ”
CREATE TABLE EMPLOYEE_FUNCTIONS (
EMPLOYEE_EMPLOYEEID VARCHAR(255) NOT NULL,
ACTIVE BOOLEAN NOT NULL,
DEPARTMENTNUMBER INTEGER NOT NULL,
DESCRIPTION VARCHAR(255),
ORDER[*] INTEGER NOT NULL
) “; expected “identifier”;
事情是我已經用另一個項目完成了這個,我不明白為什么它不起作用.
Employee.java
@Entity
public class Employee extends AbstractScheduleEntity {
public static final String ACOMBA_UNIQUE_FIELD = "acombaUnique";
@Id
@GenericGenerator(name = "sequence_id", strategy =
"ca.tecsar.core.sql.ServerSequenceGenerator")
@GeneratedValue(generator = "sequence_id")
@Column(name = "EmployeeID", unique = true, nullable = false)
private String employeeID;
@ElementCollection
private List functions;
//getter and setter
}
Function.java
@Embeddable
public class Function implements Serializable {
private int order;
private boolean active;
private String description;
private int departmentNumber;
//getter and setter
}
我在Employee中刪除了一些不必要的屬性.
什么可能導致此錯誤?是因為我的員工中有一個String作為標識符嗎?如果是這樣,我如何告訴Hibernate添加Employee_EmployeeID作為標識符?
謝謝
總結
以上是生活随笔為你收集整理的java identifier expected,java – hibernate h2 embeddable list expected“identifier”的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php 实时查看公众号加粉数据,公众号实
- 下一篇: warframe计算机拒绝访问,Win1