表名hibernate中的特殊字符给出错误 [英] Special character in table name hibernate giving error
问题描述
我试图从Hibernate更新表。我的表名在名称的开头有特殊字符@。
$ b
SEVERE:Servlet.service()for在路径[/ GanttView]上下文中的servlet [kendo]引发异常[请求处理失败;嵌套异常是org.hibernate.QueryException:意想不到字符: '@'[更新[@IS_Demand]设置为SEL = 1]]与根源
org.hibernate.QueryException:意想不到字符: '@'[更新[@ IS_Demand] set sel = 1]
我不想更改表的名称在数据库中,因为那样我就不得不改变很多东西。有什么方法可以访问它吗?
我尝试了许多其他组合,例如
$ $ p $ \@ IS_Demand\或@IS_Demand'或'[ @IS_Demand]'
任何人都知道答案?
您需要设置一个属性。
< property name =hibernate.globally_quoted_identifiersvalue =true/>
有关详细信息,
AvailableSettings.html#GLOBALLY_QUOTED_IDENTIFIERS
I am trying to update the table from Hibernate. My table name has the special character '@' at the beginning of the name. When I am trying to update it its giving me following error.
SEVERE: Servlet.service() for servlet [kendo] in context with path [/GanttView] threw exception [Request processing failed; nested exception is org.hibernate.QueryException: unexpected char: '@' [Update [@IS_Demand] set sel=1]] with root cause org.hibernate.QueryException: unexpected char: '@' [Update [@IS_Demand] set sel=1]
I don't want to change the name of the table in the database because then I will have to change many things. Is there any way I could access it. I tried many other combinations like
\"@IS_Demand\" or '@IS_Demand' or '[@IS_Demand]'
Anyone knows the answer?
There is a property available you need to set.
<property name="hibernate.globally_quoted_identifiers" value="true"/>
For more details,
AvailableSettings.html#GLOBALLY_QUOTED_IDENTIFIERS
这篇关于表名hibernate中的特殊字符给出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!