[英]sql query work when run it in sqlDeveloper but not work using hibernate
i have a query that i want to run it using hibernate native sqlQuery 我有一个查询,我想使用休眠的本机sqlQuery运行它
when i run query using sql developer it works fine but when hibernate run it ,it throws this exception 当我使用sql Developer运行查询时,它工作正常,但是当hibernate运行它时,它将抛出此异常
.
.
.
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:82)
.
.
.
Caused by: java.sql.SQLSyntaxErrorException: ORA-00911: invalid character
here is my sql query: 这是我的SQL查询:
SELECT car_id,car.plate FROM car WHERE car.plate LIKE '%12%' ORDER BY CAR.CAR_ID;
please help me , 请帮我 ,
thanks in advance 提前致谢
Remove your semicolon ";". 删除分号“;”。 Cheers.
干杯。
Hibernate is case sentitive, write your sql statement in lower case. Hibernate是大小写敏感的,用小写形式编写您的sql语句。 Example:
例:
select car_id,car.plate from car car where car.plate like '%12%' order by car.car_id asc;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.