【发布时间】:2015-01-24 10:23:28
【问题描述】:
我正在使用休眠来创建表。在我的实体中,我有以下字段。当我使用 MySQL 数据库时,此实体已成功创建。但是在 oracle 10g 上它会抛出错误
create table MetaData (ID bigint not null auto_increment, metaDataId varchar(255) not null, parentId bigint not null, locked bit, userId bigint not null, primary key (ID), unique (metaDataId))
java.sql.SQLSyntaxErrorException: ORA-00907: missing right parenthesis
实体:
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorOptions(force = true)
@Table(name = "MetaData", uniqueConstraints = @UniqueConstraint(columnNames = "metaDataId"))
public class MetaData extends SavableEntity {
@Column(nullable = false)
private String metaDataId;
@Column(nullable = false)
private Long parentId;
@Column(nullable = false)
private Long userId;
@Column
@Type(type = "boolean")
private boolean locked;
}
知道可能出了什么问题吗?
【问题讨论】:
-
LOCKED 是 oracle 中的关键字。可以尝试其他字段名称吗?
标签: java mysql oracle entity-framework hibernate