参数前缀':'后面不允许有空格 [英] Space is not allowed after parameter prefix ':'
本文介绍了参数前缀':'后面不允许有空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的问题是我尝试插入包含char的文本:在我的查询中
My problem is i try to insert text that contain char : in my query
我试图在char之前添加双反斜杠//但仍然无效。
I have tried to put double backslash // before char : but still not working.
ABNORMALLY.java.lang.IllegalArgumentException:
org.hibernate.QueryException: Space is not allowed after parameter prefix ':'
INSERT INTO TABLE_A (A_ID, TYPE_ID, F_ID, REFNO, RECORD) VALUES
( A_ID_SEQ.nextval, 4 , 9 , 'NY167', q'[LA2010167|SNIP' N CLIP|LMG|1.Unit no\\: 1046, 1 st Floor, Limbang Plaza, 98700 Limbang|2010-12-10||]')
推荐答案
这里Hibernate正在解析包含硬编码值的插入,其中包含冒号。如果重写insert以使用参数,那么Hibernate将不会将该值视为语句的一部分。
Here Hibernate is parsing an insert that contains a hard-coded value that has a colon in it. If you rewrite the insert to use parameters then Hibernate won't see the value as part of the statement.
这篇关于参数前缀':'后面不允许有空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文