@Entity
@Table(name = "JBPM4_EXECUTION", uniqueConstraints = @UniqueConstraint(columnNames = "ID_"))
public class Jbpm4Execution implements java.io.Serializable {
@Column(name = "ID_", unique = true)
public String getId() {
return this.id;
}
}
生成的sql在oracle中执行报错
create table mip_test.JBPM4_EXECUTION (DBID_ number(20,0) not null,
ACTIVITYNAME_ varchar2(255 char), CLASS_ varchar2(255 char) not null,
DBVERSION_ number(19,0) not null, HASVARS_ varchar2(255 char),
HISACTINST_ number(20,0), ID_ varchar2(255 char) unique,
KEY_ varchar2(255 char), NAME_ varchar2(255 char),
PARENT_IDX_ number(19,0), PRIORITY_ number(19,0),
PROCDEFID_ varchar2(255 char), STATE_ varchar2(255 char),
SUSPHISTSTATE_ varchar2(255 char), INSTANCE_ number(20,0),
PARENT_ number(20,0), SUBPROCINST_ number(20,0),
SUPEREXEC_ number(20,0), primary key (DBID_), unique (ID_))
重复的unique属性
去掉@Column(name = "ID_", unique = true)的unique = true后ok