oracle ORA-01747(系统保留关键字)user.table.column, table.column 或列说明无效 hibernate映射oracle保留关键字

时间:2023-03-08 23:50:20
oracle ORA-01747(系统保留关键字)user.table.column, table.column 或列说明无效 hibernate映射oracle保留关键字

1、查询系统关键

select * from v$reserved_words

确认你使用的是否为关键字:

select * from v$reserved_words w where w.KEYWORD='LEVEL';

2、系统关键字需要加双引号

update UT_MENU  set "LEVEL"=2 where menuid=57886

如果这条语句在在sqlplus里面执行,则同样会提示ORA-01747错误,可以到sqlplus命令行里面执行就ok。有知道sqlplus怎么弄给我说下,谢谢。

sqlplus:

update UT_MENU  set "LEVEL"=2 where menuid=57886;

commit;

3、在补充hibernate映射oracle关键字

正确的:

<property name="level" type="java.lang.Integer">
<column name='"level"' precision="1" scale="0" />
</property>

  错误的:

<property name="level" type="java.lang.Integer">
<column name="level" precision="1" scale="0" />
</property>
</class>