如何映射一个在JPA中作为保留字的实体字段
- 论坛
- 如何映射一个在JPA中作为保留字的实体字段
8 浏览
如何映射一个在JPA中作为保留字的实体字段
@Column(name="open")
使用Hibernate与sqlserver方言。
[SchemaUpdate] 创建auth_session表不成功(id numeric(19,0) identity not null, active tinyint null, creation_date datetime not null, last_modified datetime not null, maxidle int null, maxlive int null, open tinyint null, sessionid varchar(255) not null, user_id numeric(19,0) not null, primary key (id), unique (sessionid)),错误信息:语法错误,关键字 'open' 附近不正确。
我本来期望Hibernate在创建表时使用带引号的标识符。
有没有其他处理方法,除了重命名字段?