开发者

Error in Netbeans(?): attribute column name (length) is a reserved Java Persistence QL keyword

开发者 https://www.devze.com 2022-12-24 14:15 出处:网络
I have a column named length in an Oracle database.I cannot change the column name. When I use the @Column(name=\"length\") in a JPA Entity I get the following error:

I have a column named length in an Oracle database. I cannot change the column name. When I use the @Column(name="length") in a JPA Entity I get the following error:

attribute column name (length) is a reserved Java Persistence QL keyword

I am using the Netbeans 6.8 I开发者_StackOverflow中文版DE.

Any ideas on this?

Thanks


If I'm not mistaken, escaping the column name in double quotes should work.

@Column(name="\"length\"")
private int length;
0

精彩评论

暂无评论...
验证码 换一张
取 消